diff --git a/examples/more/00_example_template/example b/examples/more/00_example_template/example index 044e1ca..bcc1765 100755 Binary files a/examples/more/00_example_template/example and b/examples/more/00_example_template/example differ diff --git a/examples/more/01_sample_from_cdf/example b/examples/more/01_sample_from_cdf/example index d4c7734..4b638ff 100755 Binary files a/examples/more/01_sample_from_cdf/example and b/examples/more/01_sample_from_cdf/example differ diff --git a/examples/more/02_sample_from_cdf_beta/example b/examples/more/02_sample_from_cdf_beta/example index da532b0..f8425ea 100755 Binary files a/examples/more/02_sample_from_cdf_beta/example and b/examples/more/02_sample_from_cdf_beta/example differ diff --git a/examples/more/03_ci_beta/example b/examples/more/03_ci_beta/example index e7da5bc..1db0bbe 100755 Binary files a/examples/more/03_ci_beta/example and b/examples/more/03_ci_beta/example differ diff --git a/examples/more/04_nuclear_war/example b/examples/more/04_nuclear_war/example index 3022a5e..f3d9571 100755 Binary files a/examples/more/04_nuclear_war/example and b/examples/more/04_nuclear_war/example differ diff --git a/examples/more/05_burn_10kg_fat/example b/examples/more/05_burn_10kg_fat/example index 39a9a79..66d67cb 100755 Binary files a/examples/more/05_burn_10kg_fat/example and b/examples/more/05_burn_10kg_fat/example differ diff --git a/examples/more/06_nuclear_recovery/example b/examples/more/06_nuclear_recovery/example index 44ddb71..b01ab0d 100755 Binary files a/examples/more/06_nuclear_recovery/example and b/examples/more/06_nuclear_recovery/example differ diff --git a/examples/more/07_algebra/example b/examples/more/07_algebra/example index 7672a30..3505909 100755 Binary files a/examples/more/07_algebra/example and b/examples/more/07_algebra/example differ diff --git a/examples/more/08_algebra_and_conversion/example b/examples/more/08_algebra_and_conversion/example index 2b0f908..ce9cb8b 100755 Binary files a/examples/more/08_algebra_and_conversion/example and b/examples/more/08_algebra_and_conversion/example differ diff --git a/examples/more/09_ergonomic_algebra/example b/examples/more/09_ergonomic_algebra/example index 8318b02..650e302 100755 Binary files a/examples/more/09_ergonomic_algebra/example and b/examples/more/09_ergonomic_algebra/example differ diff --git a/examples/more/10_twitter_thread_example/example b/examples/more/10_twitter_thread_example/example index 779b0ce..3b71894 100755 Binary files a/examples/more/10_twitter_thread_example/example and b/examples/more/10_twitter_thread_example/example differ diff --git a/examples/more/11_billion_lognormals_paralell/example b/examples/more/11_billion_lognormals_paralell/example index 6077ef9..e7c71b9 100755 Binary files a/examples/more/11_billion_lognormals_paralell/example and b/examples/more/11_billion_lognormals_paralell/example differ diff --git a/examples/more/12_time_to_botec_parallel/example b/examples/more/12_time_to_botec_parallel/example index 27e99fe..34570ee 100755 Binary files a/examples/more/12_time_to_botec_parallel/example and b/examples/more/12_time_to_botec_parallel/example differ diff --git a/examples/more/13_parallelize_min/example b/examples/more/13_parallelize_min/example index 8e48c2c..26f3374 100755 Binary files a/examples/more/13_parallelize_min/example and b/examples/more/13_parallelize_min/example differ diff --git a/examples/more/14_check_confidence_interval/example b/examples/more/14_check_confidence_interval/example index b0a9e3a..aeb6b0e 100755 Binary files a/examples/more/14_check_confidence_interval/example and b/examples/more/14_check_confidence_interval/example differ diff --git a/makefile b/makefile index 3fcf7e0..5c21cd9 100644 --- a/makefile +++ b/makefile @@ -24,10 +24,12 @@ lint: clang-tidy squiggle_more.c -- -lm profile: - sudo perf record ./examples/more/12_time_to_botec_parallel/example + sudo perf record -g ./examples/more/12_time_to_botec_parallel/example sudo perf report rm perf.data + sudo perf stat ./examples/more/12_time_to_botec_parallel/example time-linux: + gcc -O3 -Wall -Wextra -Wdouble-promotion -Wconversion examples/more/12_time_to_botec_parallel/example.c squiggle.c squiggle_more.c -lm -fopenmp -o examples/more/12_time_to_botec_parallel/example @echo "Running 100x and taking avg time: $(TTB)" - @t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(TTB); 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_PROC_BIND=TRUE $(TTB); 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 diff --git a/squiggle_more.c b/squiggle_more.c index 99d6b3d..ae1caeb 100644 --- a/squiggle_more.c +++ b/squiggle_more.c @@ -62,7 +62,7 @@ void sampler_parallel(double (*sampler)(uint64_t* seed), double* results, int n_ int i; #pragma omp parallel private(i) { -#pragma omp for +#pragma omp for for (i = 0; i < n_threads; i++) { int lower_bound_inclusive = i * quotient; int upper_bound_not_inclusive = ((i + 1) * quotient); // note the < in the for loop below,