Revert "tweak: savepoint; test hypothesis over previous stuff."
This reverts commit 1bc7c90fcf
.
This commit is contained in:
parent
1bc7c90fcf
commit
1d5e0a6a7f
|
@ -180,26 +180,19 @@ float mixture(float (*samplers[])(uint32_t*), float* weights, int n_dists, uint3
|
||||||
|
|
||||||
// Parallization function
|
// Parallization function
|
||||||
void paralellize(float (*sampler)(uint32_t* seed), float* results, int n_threads, int n_samples){
|
void paralellize(float (*sampler)(uint32_t* seed), float* results, int n_threads, int n_samples){
|
||||||
|
|
||||||
if((N_SAMPLES % n_threads) != 0){
|
if((N_SAMPLES % n_threads) != 0){
|
||||||
fprintf(stderr, "Number of samples isn't divisible by number of threads, aborting\n");
|
fprintf(stderr, "Number of samples isn't divisible by number of threads, aborting\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
int n_samples_per_thread = N_SAMPLES / n_threads;
|
// int n_samples_per_thread = N_SAMPLES / n_thread;
|
||||||
|
int sample_index, i, split_array_length;
|
||||||
float** split_results = malloc(n_threads * sizeof(float*));
|
|
||||||
for(int i=0; i<n_threads; i++){
|
|
||||||
split_results[i] = malloc(n_samples_per_thread * sizeof(float));
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t** seeds = malloc(n_threads * sizeof(uint32_t*));
|
uint32_t** seeds = malloc(n_threads * sizeof(uint32_t*));
|
||||||
for (uint32_t i = 0; i < n_threads; i++) {
|
for (uint32_t i = 0; i < n_threads; i++) {
|
||||||
seeds[i] = malloc(sizeof(uint32_t));
|
seeds[i] = malloc(sizeof(uint32_t));
|
||||||
*seeds[i] = i + 1; // xorshift can't start with 0
|
*seeds[i] = i + 1; // xorshift can't start with 0
|
||||||
}
|
}
|
||||||
|
|
||||||
int i;
|
#pragma omp parallelz private(i, sample_index, split_array_length)
|
||||||
#pragma omp parallel private(i)
|
|
||||||
{
|
{
|
||||||
#pragma omp for
|
#pragma omp for
|
||||||
for (i = 0; i < n_threads; i++) {
|
for (i = 0; i < n_threads; i++) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user