52 (*it)->Multiplicity = 1.0;
86 r2_accepted += (*it)->Properties(WP::R2ACCEPTED);
87 r2_proposed += (*it)->Properties(WP::R2PROPOSED);
123 int nb = maxIndex - minIndex + 1;
124 std::vector<FullPrecRealType> Zeta(nb);
125 for (
int i = minIndex, ii = 0; i < maxIndex; i++, ii++)
131 while (Zeta[ind] < wCur)
137 for (iw = 0; iw < nw; iw++)
141 while (Zeta[ind] < tryp && Zeta[ind] >= wCur)
155 std::vector<int> plus, minus;
156 for (iw = 0; iw < nw; iw++)
162 plus.insert(plus.end(),
m - 1, iw);
171 int nw_removed = minus.size();
173 int lower =
std::min(plus.size(), minus.size());
177 int im = minus[lower];
178 int ip = plus[lower];
179 W[im]->makeCopy(*(W[ip]));
180 W[im]->setParentID(W[ip]->getWalkerID());
185 std::fill(
dN.begin(),
dN.end(), 0);
222 std::vector<int> minusN, plusN;
227 plusN.insert(plusN.end(),
dN[ip], ip);
231 minusN.insert(minusN.end(), -
dN[ip], ip);
234 int nswap = plusN.size();
237 while (ic < nswap && last >= 0)
242 size_t byteSize = W[im]->byteSize();
243 W[im]->updateBuffer();
244 myComm->comm.send_n(W[im]->DataSet.data(), byteSize, minusN[ic]);
253 std::vector<IndexType> minusN, plusN;
258 plusN.insert(plusN.end(),
dN[ip], ip);
262 minusN.insert(minusN.end(), -
dN[ip], ip);
265 int nswap = plusN.size();
268 while (ic < nswap && last >= 0)
272 int im = minus[last];
273 size_t byteSize = W[im]->byteSize();
274 myComm->comm.receive_n(W[im]->DataSet.data(), byteSize, plusN[ic]);
275 W[im]->copyFromBuffer();
276 W[im]->setParentID(W[im]->getWalkerID());
HamiltonianRef::FullPrecRealType FullPrecRealType
A set of walkers that are to be advanced by Metropolis Monte Carlo.
helper functions for EinsplineSetBuilder
size_t getActiveWalkers() const
return the number of active walkers
int TotalWalkers
total number of walkers
MakeReturn< UnaryNode< FnFabs, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t abs(const Vector< T1, C1 > &l)
void pop_back()
delete the last Walker_t*
FullPrecRealType UnitZeta
random number [0,1)
std::vector< int > ncopy_w
temporary storage for copy counters
int LastWalker
ending index of the local walkers
IndexType MyContext
context id
FullPrecRealType DeltaStep
random number [0,1)/number of walkers
std::vector< FullPrecRealType > wConf
Wrapping information on parallelism.
WalkerList_t::iterator iterator
FIX: a type alias of iterator for an object should not be for just one of many objects it holds...
A collection of functions for dividing fairly.
int FirstWalker
starting index of the local walkers
WalkerProperties::Indexes WP
void recvWalkers(MCWalkerConfiguration &W, const std::vector< IndexType > &minus)
send the missing walkers from other node
Communicate * myComm
pointer to Communicate
std::vector< IndexType > dN
the number of extra/missing walkers
void measureProperties(int iter)
take averages and writes to a file
std::vector< FullPrecRealType > curData
any temporary data includes many ridiculous conversions of integral types to and from fp ...
IndexType NumWalkersCreated
Number of walkers created by this rank.
IndexType num_contexts_
number of contexts
std::vector< FullPrecRealType > wOffset
WalkerReconfigurationMPI(Communicate *c=0)
default constructor
void sendWalkers(MCWalkerConfiguration &W, const std::vector< IndexType > &plus)
send the extra walkers to other node
Indexes
an enum denoting index of physical properties
Base class to control the walkers for DMC simulations.
MCDataType< FullPrecRealType > EnsembleProperty
MCDataType< FullPrecRealType > ensemble_property_
ensemble properties
iterator end()
return the last iterator, [begin(), end())
Declare a global Random Number Generator.
IndexType SwapMode
0 is default
int branch(int iter, MCWalkerConfiguration &W, FullPrecRealType trigger) override
perform branch and swap walkers as required
int swapWalkers(MCWalkerConfiguration &W)
return the surviving Walkers
Declaration of QMCHamiltonian.
FullPrecRealType nwInv
1/(total number of walkers)
iterator begin()
return the first iterator