From 1d5e0a6a7fc9c84ada20e9e9a15f97eac447da4e Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Sat, 18 Nov 2023 22:59:48 +0000 Subject: [PATCH] Revert "tweak: savepoint; test hypothesis over previous stuff." This reverts commit 1bc7c90fcfe0d61ce5f0e84c7e8e1a9127f497b0. --- C/alt/05-refactor-split-array/samples.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/C/alt/05-refactor-split-array/samples.c b/C/alt/05-refactor-split-array/samples.c index 8bdc8a5e..d84eebcf 100644 --- a/C/alt/05-refactor-split-array/samples.c +++ b/C/alt/05-refactor-split-array/samples.c @@ -180,26 +180,19 @@ float mixture(float (*samplers[])(uint32_t*), float* weights, int n_dists, uint3 // Parallization function void paralellize(float (*sampler)(uint32_t* seed), float* results, int n_threads, int n_samples){ - if((N_SAMPLES % n_threads) != 0){ fprintf(stderr, "Number of samples isn't divisible by number of threads, aborting\n"); exit(1); } - int n_samples_per_thread = N_SAMPLES / n_threads; - - float** split_results = malloc(n_threads * sizeof(float*)); - for(int i=0; i