Skip to content

Commit

Permalink
fix: Correct indexing in construction of Latin hypercube
Browse files Browse the repository at this point in the history
Was previously only populating the first part of the array (up to the number of MPI processes) of random numbers used to shuffle the Latin hypercube columns, causing most elements to be zero, and thereby resulting in non-random shuffling that left parameters correlated.
  • Loading branch information
abensonca committed Aug 6, 2024
1 parent a341a7f commit fd4a868
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ subroutine latinHypercubeSamples(self,simulationStates,modelParameters_)
x =0.0d0
do i=0,self%countSamples-1
if (mod(i,mpiSelf%count()) /= mpiSelf%rank()) cycle
x(mpiSelf%rank())=self%randomNumberGenerator_%uniformSample()
x(i)=self%randomNumberGenerator_%uniformSample()
end do
y =mpiSelf%sum(x)
call mpiBarrier()
Expand Down

0 comments on commit fd4a868

Please sign in to comment.