Skip to content

Commit 7c36791

Browse files
committed
random test passmethod
1 parent 35ef7bd commit 7c36791

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

atintegrators/TestRandomPass.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* RandomPass.c
1+
/* RandomPass.c
22
Accelerator Toolbox
33
44
Test of random generators
@@ -21,14 +21,15 @@ static void RandomPass(double *r_in,
2121
pcg32_random_t* thread_rng,
2222
int num_particles)
2323
{
24-
double common_val = atrandn_r(common_rng, 0.0, 0.001);
24+
double common_val;
2525
#ifdef MPI
2626
int rank;
2727
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
2828
#else
2929
int rank = 0;
3030
#endif /* MPI */
3131

32+
common_val = atrandn_r(common_rng, 0.0, 0.001);
3233
for (int c = 0; c<num_particles; c++) { /*Loop over particles */
3334
double *r6 = r_in+c*6;
3435
r6[0] = atrandn_r(thread_rng, 0.0, 0.001);
@@ -37,6 +38,7 @@ static void RandomPass(double *r_in,
3738
r6[5] = 0.01*c;
3839
}
3940

41+
common_val = atrandn_r(common_rng, 0.0, 0.001);
4042
#pragma omp parallel for if (num_particles > OMP_PARTICLE_THRESHOLD) default(none) \
4143
shared(r_in, num_particles, common_val, thread_rng)
4244
for (int c = 0; c<num_particles; c++) { /*Loop over particles */

0 commit comments

Comments
 (0)