@echo "Requires /bin/time, found on GNU/Linux systems"&&echo
@echo "Running 100x and taking avg time: OMP_NUM_THREADS=1 $(OUTPUT)"
@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do OMP_NUM_THREADS=1 $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}');echo"scale=2; 1000 * $$t / 100"| bc | sed "s|^|Time using 1 thread: |"| sed 's|$$|ms|'&&echo
@echo "Running 100x and taking avg time: OMP_NUM_THREADS=2 $(OUTPUT)"
@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do OMP_NUM_THREADS=2 $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}');echo"scale=2; 1000 * $$t / 100"| bc | sed "s|^|Time using 2 threads: |"| sed 's|$$|ms|'&&echo
@echo "Running 100x and taking avg time: OMP_NUM_THREADS=4 $(OUTPUT)"
@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do OMP_NUM_THREADS=4 $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}');echo"scale=2; 1000 * $$t / 100"| bc | sed "s|^|Time for 4 threads: |"| sed 's|$$|ms|'&&echo
@echo "Running 100x and taking avg time: OMP_NUM_THREADS=8 $(OUTPUT)"
@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do OMP_NUM_THREADS=8 $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}');echo"scale=2; 1000 * $$t / 100"| bc | sed "s|^|Time using 8 threads: |"| sed 's|$$|ms|'&&echo
@echo "Running 100x and taking avg time: OMP_NUM_THREADS=16 $(OUTPUT)"
@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do OMP_NUM_THREADS=16 $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}');echo"scale=2; 1000 * $$t / 100"| bc | sed "s|^|Time using 16 threads: |"| sed 's|$$|ms|'&&echo
@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do OMP_NUM_THREADS=16 $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}');echo"scale=2; 1000 * $$t / 100"| bc | sed "s|^|Time using 16 threads: |"| sed 's|$$|ms|'&&echo
time-linux-simple:
@echo "Requires /bin/time, found on GNU/Linux systems"&&echo