Skip to content
Snippets Groups Projects
Commit 276947c0 authored by Moises Fernandez's avatar Moises Fernandez
Browse files

Changed to use Dynamic Shared Memory and fix curand with a number of randoms not multiplo of 2

parent 4d103eb9
No related branches found
No related tags found
No related merge requests found
...@@ -145,12 +145,19 @@ void runmcmc_burnin( //INPUT ...@@ -145,12 +145,19 @@ void runmcmc_burnin( //INPUT
nrandoms = totalrandoms; nrandoms = totalrandoms;
iters_step= opts.nburn.value(); iters_step= opts.nburn.value();
steps = 0; steps = 0;
} }
if(nrandoms%2){ //CURAND must generates multiples of 2 randoms
nrandoms++;
}
myfile << "Process " << opts.nburn.value() << " iterations divided in "<< steps << " steps with "<< iters_step << " iterations in each one" << "\n"; myfile << "Process " << opts.nburn.value() << " iterations divided in "<< steps << " steps with "<< iters_step << " iterations in each one" << "\n";
int last_step = opts.nburn.value() - (iters_step*steps); int last_step = opts.nburn.value() - (iters_step*steps);
int last_randoms= (last_step*minrandoms); int last_randoms= (last_step*minrandoms);
if(last_randoms%2){ //CURAND must generates multiples of 2 randoms
last_randoms++;
}
myfile << "Last step with " << last_step << " iterations" << "\n"; myfile << "Last step with " << last_step << " iterations" << "\n";
...@@ -317,12 +324,19 @@ void runmcmc_record( //INPUT ...@@ -317,12 +324,19 @@ void runmcmc_record( //INPUT
nrandoms = totalrandoms; nrandoms = totalrandoms;
iters_step= opts.njumps.value(); iters_step= opts.njumps.value();
steps = 0; steps = 0;
} }
if(nrandoms%2){ //CURAND must generates multiples of 2 randoms
nrandoms++;
}
myfile << "Process " << opts.njumps.value() << " iterations divided in "<< steps << " steps with "<< iters_step << " iterations in each one" << "\n"; myfile << "Process " << opts.njumps.value() << " iterations divided in "<< steps << " steps with "<< iters_step << " iterations in each one" << "\n";
int last_step = opts.njumps.value() - (iters_step*steps); int last_step = opts.njumps.value() - (iters_step*steps);
int last_randoms= (last_step*minrandoms); int last_randoms= (last_step*minrandoms);
if(last_randoms%2){ //CURAND must generates multiples of 2 randoms
last_randoms++;
}
myfile << "Last step with " << last_step << " iterations" << "\n"; myfile << "Last step with " << last_step << " iterations" << "\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment