Skip to content

Commit 2a15c29

Browse files
committed
use random initialization per CPU before every MPI-MC integration, currently made happen implicitly
1 parent 84c497e commit 2a15c29

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/MPIVMC.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ namespace MPIVMC
4949
#endif
5050
}
5151

52-
void Integrate(MCI * const mci, const long &Nmc, double * average, double * error, int NfindMRT2stepIterations, int NdecorrelationSteps, int nblocks=-1)
52+
void Integrate(MCI * const mci, const long &Nmc, double * average, double * error, int NfindMRT2stepIterations, int NdecorrelationSteps, bool randomizeWalkers = false, int nblocks=-1)
5353
{
54+
if (randomizeWalkers) {
55+
mci->newRandomX();
56+
}
5457
#if USE_MPI==1
5558
MPIMCI::integrate(mci, Nmc, average, error, NfindMRT2stepIterations, NdecorrelationSteps, nblocks < 0 ? 16 : nblocks); // if compiling with USE_MPI, set default block count to 16
5659
#else
@@ -64,11 +67,11 @@ namespace MPIVMC
6467
// if compiling with USE_MPI, set fixed defaults (totaling 5000 quick no-sample steps)
6568
int stepsMRT2 = findMRT2step ? 25 : 0;
6669
int stepsDecorr = initialdecorrelation ? 2500 : 0;
67-
Integrate(mci, Nmc, average, error, stepsMRT2, stepsDecorr, nblocks < 0 ? 16 : nblocks); // if compiling with USE_MPI, set fixed defaults (totaling 5000 quick no-sample steps)
70+
Integrate(mci, Nmc, average, error, stepsMRT2, stepsDecorr, true, nblocks < 0 ? 16 : nblocks); // if compiling with USE_MPI, also use random initial walker positions and fixed blocking
6871
#else
6972
int stepsMRT2 = findMRT2step ? -1 : 0;
7073
int stepsDecorr = initialdecorrelation ? -1 : 0;
71-
Integrate(mci, Nmc, average, error, stepsMRT2, stepsDecorr, nblocks < 0 ? 0 : nblocks);
74+
Integrate(mci, Nmc, average, error, stepsMRT2, stepsDecorr, false, nblocks < 0 ? 0 : nblocks);
7275
#endif
7376

7477
}

0 commit comments

Comments
 (0)