QMCPACK
WalkerControlMPI.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) 2020 QMCPACK developers.
6 //
7 // File developed by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Lab
8 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
9 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
10 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
11 //
12 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
13 //////////////////////////////////////////////////////////////////////////////////////
14 
15 
16 #ifndef QMCPLUSPLUS_WALKER_CONTROL_MPI_H
17 #define QMCPLUSPLUS_WALKER_CONTROL_MPI_H
18 
20 #include "Utilities/TimerManager.h"
21 
22 namespace qmcplusplus
23 {
24 struct WalkerControlMPITest;
25 
26 /** Class to handle walker controls with simple global sum
27  *
28  * Base class to handle serial mode with branching only
29  */
31 {
32  int Cur_pop;
33  int Cur_max;
34  int Cur_min;
36  // Number of walkers sent during the exchange
37  // This semi-persistent state is only here because we keep zeroing curData
38  // defensively?
40 
41  /** default constructor
42  *
43  * \param[in] comm can not be null it is not checked.
44  */
46 
47  /** creates the distribution plan
48  *
49  * populates the minus and plus vectors they contain 1 copy of a partition index
50  * for each adjustment in population to the context.
51  * \todo fix this argument salad
52  *
53  * \param[in] cur_pop_pop population taking multiplicity into account
54  * \param[in] num_contexts number of MPI processes
55  * \param[in] my_context i.e this processes MPI rank
56  * \param[in/out] num_per_rank as if all walkers were copied out to multiplicity
57  * \param[out] fair_offset running population count at each partition boundary
58  * \param[out] minus list of partition indexes one occurrence for each walker removed
59  * \param[out] plus list of partition indexes one occurrence for each walker added
60  */
61  static void determineNewWalkerPopulation(int cur_pop,
62  int num_contexts,
63  int my_context,
64  std::vector<int>& num_per_rank,
65  std::vector<int>& fair_offset,
66  std::vector<int>& minus,
67  std::vector<int>& plus);
68 
69  /** legacy: perform branch and swap walkers as required */
70  int branch(int iter, MCWalkerConfiguration& W, FullPrecRealType trigger) override;
71 
72  /** legacy: swap implementation
73  */
75 
76  // Testing wrappers
78 };
79 
80 } // namespace qmcplusplus
81 #endif
A set of walkers that are to be advanced by Metropolis Monte Carlo.
int branch(int iter, MCWalkerConfiguration &W, FullPrecRealType trigger) override
legacy: perform branch and swap walkers as required
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
timer_manager class.
static void determineNewWalkerPopulation(int cur_pop, int num_contexts, int my_context, std::vector< int > &num_per_rank, std::vector< int > &fair_offset, std::vector< int > &minus, std::vector< int > &plus)
creates the distribution plan
WalkerControlMPI(Communicate *comm)
default constructor
Wrapping information on parallelism.
Definition: Communicate.h:68
Class to handle walker controls with simple global sum.
void swapWalkersSimple(MCWalkerConfiguration &W)
legacy: swap implementation
Base class to control the walkers for DMC simulations.
QMCTraits::FullPrecRealType FullPrecRealType
typedef of FullPrecRealType
QMCTraits::IndexType IndexType
typedef of IndexType