commit e1b180bd5babf9f4b7e968e11e94ec3730df1957 parent 331c7566f06e7c68a351dc170dc9da645ae97a43 Author: NunoSempere <nuno.sempere@protonmail.com> Date: Fri, 2 Jun 2023 13:56:50 -0600 feat: add timing across 10 runs. Diffstat:
| M | C-optimized/README.md | | | 1 | + |
| M | C-optimized/makefile | | | 5 | +++++ |
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/C-optimized/README.md b/C-optimized/README.md @@ -25,6 +25,7 @@ In Nuño's machine, multithreading actually introduces a noticeable slowdown fac ## To do +- [ ] Use proper profiling tool to capture timing with 1M samples. - [ ] Update above with correct timing - [ ] Add Windows/Powershell time-measuring commands - [ ] Add CUDA? diff --git a/C-optimized/makefile b/C-optimized/makefile @@ -59,5 +59,10 @@ time-linux: OMP_NUM_THREADS=16 /bin/time -f "Time: %es" ./$(OUTPUT) && echo /bin/time -f "Time: %es" ./$(OUTPUT_ONE_THREAD) && echo +time-linux-2: + echo "Requires /bin/time, found on GNU/Linux systems" && echo + @t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..10}; do OMP_NUM_THREADS=2 $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=4; $$t / 10" | bc | sed "s|^|Time for 2 threads: |" | sed 's|$$|s|' + debian-install-dependencies: sudo apt-get install libomp-dev +