![]() |
QMCPACK
|
Class to handle walker controls with simple global sum. More...
Inheritance diagram for WalkerReconfigurationMPI:
Collaboration diagram for WalkerReconfigurationMPI:Public Member Functions | |
| WalkerReconfigurationMPI (Communicate *c=0) | |
| default constructor More... | |
| int | branch (int iter, MCWalkerConfiguration &W, FullPrecRealType trigger) override |
| perform branch and swap walkers as required More... | |
| int | swapWalkers (MCWalkerConfiguration &W) |
| return the surviving Walkers More... | |
| void | sendWalkers (MCWalkerConfiguration &W, const std::vector< IndexType > &plus) |
| send the extra walkers to other node More... | |
| void | recvWalkers (MCWalkerConfiguration &W, const std::vector< IndexType > &minus) |
| send the missing walkers from other node More... | |
Public Member Functions inherited from WalkerControlBase | |
| WalkerControlBase (Communicate *c) | |
| default constructor More... | |
| virtual | ~WalkerControlBase () |
| empty destructor to clean up the derived classes More... | |
| void | start () |
| start a block More... | |
| void | setWalkerID (MCWalkerConfiguration &walkers) |
| start controller and initialize the IDs of walkers More... | |
| void | measureProperties (int iter) |
| take averages and writes to a file More... | |
| void | setTrialEnergy (FullPrecRealType et) |
| set the trial energy More... | |
| FullPrecRealType | getValue (int i) |
| return a value accumulated during a block More... | |
| FullPrecRealType | getCurrentValue (int i) |
| return a current value More... | |
| int | doNotBranch (int iter, MCWalkerConfiguration &W) |
| legacy: return global population update properties without branching More... | |
| int | sortWalkers (MCWalkerConfiguration &W) |
| legacy: sort Walkers between good and bad and prepare branching More... | |
| int | applyNmaxNmin (int current_population) |
| legacy: apply per rank limit Nmax and Nmin More... | |
| int | copyWalkers (MCWalkerConfiguration &W) |
| legacy: copy good walkers to W More... | |
| virtual void | reset () |
| reset to accumulate data More... | |
| bool | put (xmlNodePtr cur) |
| void | setMinMax (int nw_in, int nmax_in) |
| int | get_n_max () const |
| int | get_n_min () const |
| FullPrecRealType | get_target_sigma () const |
| MCDataType< FullPrecRealType > & | get_ensemble_property () |
| void | set_ensemble_property (MCDataType< FullPrecRealType > &ensemble_property) |
| IndexType | get_num_contexts () const |
| IndexType | get_method () const |
| void | set_method (IndexType method) |
Public Member Functions inherited from MPIObjectBase | |
| MPIObjectBase (Communicate *c) | |
| constructor with communicator More... | |
| int | rank () const |
| return the rank of the communicator More... | |
| int | getGroupID () const |
| return the group id of the communicator More... | |
| Communicate * | getCommunicator () const |
| return myComm More... | |
| Communicate & | getCommRef () const |
| return a TEMPORARY reference to Communicate More... | |
| mpi_comm_type | getMPI () const |
| return MPI communicator if one wants to use MPI directly More... | |
| bool | is_manager () const |
| return true if the rank == 0 More... | |
| const std::string & | getName () const |
| return the name More... | |
| void | setName (const std::string &aname) |
Public Attributes | |
| int | TotalWalkers |
| total number of walkers More... | |
| int | FirstWalker |
| starting index of the local walkers More... | |
| int | LastWalker |
| ending index of the local walkers More... | |
| FullPrecRealType | UnitZeta |
| random number [0,1) More... | |
| FullPrecRealType | DeltaStep |
| random number [0,1)/number of walkers More... | |
| FullPrecRealType | nwInv |
| 1/(total number of walkers) More... | |
| std::vector< IndexType > | dN |
| the number of extra/missing walkers More... | |
| std::vector< FullPrecRealType > | wConf |
| std::vector< FullPrecRealType > | wOffset |
| std::vector< FullPrecRealType > | wSum |
Additional Inherited Members | |
Public Types inherited from WalkerControlBase | |
| enum | { ENERGY_INDEX = 0, ENERGY_SQ_INDEX, WALKERSIZE_INDEX, WEIGHT_INDEX, EREF_INDEX, R2ACCEPTED_INDEX, R2PROPOSED_INDEX, FNSIZE_INDEX, RNONESIZE_INDEX, RNSIZE_INDEX, B_ENERGY_INDEX, B_WGT_INDEX, SENTWALKERS_INDEX, LE_MAX } |
| An enum to access curData and accumData for reduction. More... | |
| using | Walker_t = MCWalkerConfiguration::Walker_t |
| typedef of Walker_t More... | |
| using | FullPrecRealType = QMCTraits::FullPrecRealType |
| typedef of FullPrecRealType More... | |
| using | IndexType = QMCTraits::IndexType |
| typedef of IndexType More... | |
Public Types inherited from MPIObjectBase | |
| using | mpi_comm_type = Communicate::mpi_comm_type |
Static Public Member Functions inherited from WalkerControlBase | |
| static std::vector< IndexType > | syncFutureWalkersPerRank (Communicate *comm, IndexType n_walkers) |
Protected Attributes inherited from WalkerControlBase | |
| IndexType | method_ |
| id for the method More... | |
| IndexType | n_min_ |
| minimum number of walkers More... | |
| IndexType | n_max_ |
| maximum number of walkers More... | |
| IndexType | MaxCopy |
| maximum copy per walker More... | |
| IndexType | NumWalkers |
| current number of walkers per processor More... | |
| FullPrecRealType | trialEnergy |
| trial energy energy More... | |
| FullPrecRealType | target_sigma_ |
| target sigma to limit fluctuations of the trial energy More... | |
| std::vector< int > | NumPerRank |
| number of particle per rank More... | |
| std::vector< int > | OffSet |
| offset of the particle index More... | |
| std::vector< int > | FairOffSet |
| offset of the particle index for a fair distribution More... | |
| std::filesystem::path | dmcFname |
| filename for dmc.dat More... | |
| std::unique_ptr< std::ofstream > | dmcStream |
| file to save energy histogram More... | |
| IndexType | NumWalkersCreated |
| Number of walkers created by this rank. More... | |
| IndexType | MyContext |
| context id More... | |
| IndexType | num_contexts_ |
| number of contexts More... | |
| IndexType | SwapMode |
| 0 is default More... | |
| std::vector< FullPrecRealType > | accumData |
| any accumulated data over a block More... | |
| std::vector< FullPrecRealType > | curData |
| any temporary data includes many ridiculous conversions of integral types to and from fp More... | |
| std::vector< std::unique_ptr< Walker_t > > | good_w |
| temporary storage for good and bad walkers More... | |
| std::vector< std::unique_ptr< Walker_t > > | bad_w |
| std::vector< int > | ncopy_w |
| temporary storage for copy counters More... | |
| bool | use_nonblocking |
| Use non-blocking isend/irecv. More... | |
| MCDataType< FullPrecRealType > | ensemble_property_ |
| ensemble properties More... | |
Protected Attributes inherited from MPIObjectBase | |
| Communicate * | myComm |
| pointer to Communicate More... | |
| std::string | ClassName |
| class Name More... | |
| std::string | myName |
| name of the object More... | |
Class to handle walker controls with simple global sum.
Base class to handle serial mode with branching only
Definition at line 26 of file WalkerReconfigurationMPI.h.
| WalkerReconfigurationMPI | ( | Communicate * | c = 0 | ) |
default constructor
Set the SwapMode to zero so that instantiation can be done
set SwapMode
Definition at line 31 of file WalkerReconfigurationMPI.cpp.
References WalkerControlBase::SwapMode.
|
overridevirtual |
perform branch and swap walkers as required
Reimplemented from WalkerControlBase.
Definition at line 36 of file WalkerReconfigurationMPI.cpp.
References WalkerConfigurations::begin(), WalkerConfigurations::end(), WalkerControlBase::ensemble_property_, WalkerConfigurations::EnsembleProperty, WalkerControlBase::measureProperties(), WalkerReconfigurationMPI::swapWalkers(), and MCDataType< T >::Weight.
| void recvWalkers | ( | MCWalkerConfiguration & | W, |
| const std::vector< IndexType > & | minus | ||
| ) |
send the missing walkers from other node
| minus | local indices of the walkers to be copied |
Definition at line 251 of file WalkerReconfigurationMPI.cpp.
References qmcplusplus::abs(), WalkerReconfigurationMPI::dN, MPIObjectBase::myComm, WalkerControlBase::MyContext, WalkerControlBase::num_contexts_, and WalkerControlBase::NumWalkersCreated.
Referenced by WalkerReconfigurationMPI::swapWalkers().
| void sendWalkers | ( | MCWalkerConfiguration & | W, |
| const std::vector< IndexType > & | plus | ||
| ) |
send the extra walkers to other node
| plus | local indices of the walkers to be sent |
Definition at line 220 of file WalkerReconfigurationMPI.cpp.
References qmcplusplus::abs(), WalkerReconfigurationMPI::dN, MPIObjectBase::myComm, WalkerControlBase::MyContext, and WalkerControlBase::num_contexts_.
Referenced by WalkerReconfigurationMPI::swapWalkers().
| int swapWalkers | ( | MCWalkerConfiguration & | W | ) |
return the surviving Walkers
Definition at line 58 of file WalkerReconfigurationMPI.cpp.
References qmcplusplus::abs(), Communicate::allreduce(), Communicate::bcast(), WalkerConfigurations::begin(), WalkerControlBase::curData, WalkerReconfigurationMPI::DeltaStep, WalkerReconfigurationMPI::dN, qmcplusplus::Units::charge::e, WalkerConfigurations::end(), WalkerControlBase::ENERGY_INDEX, WalkerControlBase::ENERGY_SQ_INDEX, WalkerConfigurations::EnsembleProperty, WalkerControlBase::EREF_INDEX, WalkerReconfigurationMPI::FirstWalker, WalkerControlBase::FNSIZE_INDEX, WalkerConfigurations::getActiveWalkers(), WalkerReconfigurationMPI::LastWalker, WalkerControlBase::LE_MAX, qmcplusplus::Units::distance::m, omptarget::min(), MPIObjectBase::myComm, WalkerControlBase::MyContext, WalkerControlBase::ncopy_w, WalkerControlBase::num_contexts_, MCDataType< T >::NumSamples, WalkerControlBase::NumWalkersCreated, WalkerReconfigurationMPI::nwInv, WalkerConfigurations::pop_back(), WalkerControlBase::R2ACCEPTED_INDEX, WalkerControlBase::R2PROPOSED_INDEX, Random, WalkerReconfigurationMPI::recvWalkers(), WalkerControlBase::RNONESIZE_INDEX, WalkerReconfigurationMPI::sendWalkers(), WalkerControlBase::SENTWALKERS_INDEX, WalkerReconfigurationMPI::TotalWalkers, WalkerReconfigurationMPI::UnitZeta, WalkerControlBase::WALKERSIZE_INDEX, WalkerReconfigurationMPI::wConf, MCDataType< T >::Weight, WalkerControlBase::WEIGHT_INDEX, and WalkerReconfigurationMPI::wOffset.
Referenced by WalkerReconfigurationMPI::branch().
| FullPrecRealType DeltaStep |
random number [0,1)/number of walkers
Definition at line 37 of file WalkerReconfigurationMPI.h.
Referenced by WalkerReconfigurationMPI::swapWalkers().
| std::vector<IndexType> dN |
the number of extra/missing walkers
Definition at line 41 of file WalkerReconfigurationMPI.h.
Referenced by WalkerReconfigurationMPI::recvWalkers(), WalkerReconfigurationMPI::sendWalkers(), and WalkerReconfigurationMPI::swapWalkers().
| int FirstWalker |
starting index of the local walkers
Definition at line 31 of file WalkerReconfigurationMPI.h.
Referenced by WalkerReconfigurationMPI::swapWalkers().
| int LastWalker |
ending index of the local walkers
Definition at line 33 of file WalkerReconfigurationMPI.h.
Referenced by WalkerReconfigurationMPI::swapWalkers().
| FullPrecRealType nwInv |
1/(total number of walkers)
Definition at line 39 of file WalkerReconfigurationMPI.h.
Referenced by WalkerReconfigurationMPI::swapWalkers().
| int TotalWalkers |
total number of walkers
Definition at line 29 of file WalkerReconfigurationMPI.h.
Referenced by WalkerReconfigurationMPI::swapWalkers().
| FullPrecRealType UnitZeta |
random number [0,1)
Definition at line 35 of file WalkerReconfigurationMPI.h.
Referenced by WalkerReconfigurationMPI::swapWalkers().
| std::vector<FullPrecRealType> wConf |
Definition at line 43 of file WalkerReconfigurationMPI.h.
Referenced by WalkerReconfigurationMPI::swapWalkers().
| std::vector<FullPrecRealType> wOffset |
Definition at line 45 of file WalkerReconfigurationMPI.h.
Referenced by WalkerReconfigurationMPI::swapWalkers().
| std::vector<FullPrecRealType> wSum |
Definition at line 47 of file WalkerReconfigurationMPI.h.