QMCPACK
WalkerReconfigurationMPI.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
8 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
9 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
10 //
11 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
12 //////////////////////////////////////////////////////////////////////////////////////
13 
14 
15 #ifndef QMCPLUSPLUS_RECONFIGURATION_WALKER_CONTROLMPI_H
16 #define QMCPLUSPLUS_RECONFIGURATION_WALKER_CONTROLMPI_H
17 
19 
20 namespace qmcplusplus
21 {
22 /** Class to handle walker controls with simple global sum
23  *
24  * Base class to handle serial mode with branching only
25  */
27 {
28  ///total number of walkers
30  ///starting index of the local walkers
32  ///ending index of the local walkers
34  ///random number [0,1)
36  ///random number [0,1)/number of walkers
38  ///1/(total number of walkers)
40  ///the number of extra/missing walkers
41  std::vector<IndexType> dN;
42  //weight per walker
43  std::vector<FullPrecRealType> wConf;
44  //accumulated weight [0,ip) for each ip
45  std::vector<FullPrecRealType> wOffset;
46  //local sum of the weights for each ip
47  std::vector<FullPrecRealType> wSum;
48  //comb
49  //vector<RealType> Zeta;
50 
51  /** default constructor
52  *
53  * Set the SwapMode to zero so that instantiation can be done
54  */
56 
57  /** perform branch and swap walkers as required */
58  int branch(int iter, MCWalkerConfiguration& W, FullPrecRealType trigger) override;
59 
60  /** return the surviving Walkers
61  */
63 
64 
65  /** send the extra walkers to other node
66  * @param plus local indices of the walkers to be sent
67  */
68  void sendWalkers(MCWalkerConfiguration& W, const std::vector<IndexType>& plus);
69 
70  /** send the missing walkers from other node
71  * @param minus local indices of the walkers to be copied
72  */
73  void recvWalkers(MCWalkerConfiguration& W, const std::vector<IndexType>& minus);
74 };
75 } // namespace qmcplusplus
76 #endif
HamiltonianRef::FullPrecRealType FullPrecRealType
A set of walkers that are to be advanced by Metropolis Monte Carlo.
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
Class to handle walker controls with simple global sum.
FullPrecRealType UnitZeta
random number [0,1)
int LastWalker
ending index of the local walkers
FullPrecRealType DeltaStep
random number [0,1)/number of walkers
std::vector< FullPrecRealType > wConf
Wrapping information on parallelism.
Definition: Communicate.h:68
int FirstWalker
starting index of the local walkers
void recvWalkers(MCWalkerConfiguration &W, const std::vector< IndexType > &minus)
send the missing walkers from other node
std::vector< IndexType > dN
the number of extra/missing walkers
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
Base class to control the walkers for DMC simulations.
std::vector< FullPrecRealType > wSum
int branch(int iter, MCWalkerConfiguration &W, FullPrecRealType trigger) override
perform branch and swap walkers as required
int swapWalkers(MCWalkerConfiguration &W)
return the surviving Walkers
FullPrecRealType nwInv
1/(total number of walkers)