![]() |
QMCPACK
|
A collection of functions for dividing fairly. More...
Go to the source code of this file.
Functions | |
template<typename IType > | |
std::tuple< IType, IType > | FairDivideBoundary (IType me, IType ntot, IType npart) |
Partition ntot over npart. More... | |
template<class IV > | |
void | FairDivide (int ntot, int npart, IV &adist) |
Partition ntot over npart. More... | |
template<class IV > | |
std::vector< IV > | fairDivide (IV ntot, IV npart) |
return the occupation vector for ntot entities partitioned npart ways. More... | |
void | FairDivideAligned (const int ntot, const int base, const int npart, const int me, int &first, int &last) |
Partition ntot over npart and the size of each partition is a multiple of base size. More... | |
template<class IV > | |
void | FairDivideLow (int ntot, int npart, IV &adist) |
partition ntot elements among npart More... | |
template<class IV > | |
int | FairDivideHigh (int me, int ntot, int npart, IV &adist) |
partition ntot elements among npart More... | |
template<class IV > | |
int | FairDivideLow (int me, int ntot, int npart, IV &adist) |
partition ntot elements among npart More... | |
A collection of functions for dividing fairly.
Definition in file FairDivide.h.
|
inline |
Partition ntot over npart.
ntot | the total size |
npart | the number of partitions |
adist | an index array |
Simply divide ntot data among npart partitions so that the size of each group cannot differ by more than 1.
The array adist contains the offset for the i-th group, i.e., adist[i+1]-adist[i] is the number of elements for the i-th group.
Definition at line 57 of file FairDivide.h.
Referenced by QMCCostFunctionBatched::checkConfigurations(), QMCCostFunctionBatched::correlatedSampling(), and QMCCostFunctionBatched::fillOverlapHamiltonianMatrices().
std::vector<IV> fairDivide | ( | IV | ntot, |
IV | npart | ||
) |
return the occupation vector for ntot entities partitioned npart ways.
Definition at line 77 of file FairDivide.h.
References OMPstd::fill_n().
Referenced by QMCDriverNew::adjustGlobalWalkerCount(), MCPopulation::redistributeWalkers(), and qmcplusplus::TEST_CASE().
|
inline |
Partition ntot over npart and the size of each partition is a multiple of base size.
ntot | the total size |
base | the base size |
npart | the number of partitions |
me | my partition id [0,ntot) |
first | the beginning of my partition, can be equal and larger than ntot |
last | the end of my partition, must be smaller than ntot |
Definition at line 96 of file FairDivide.h.
References qmcplusplus::Units::mass::me, and omptarget::min().
Referenced by SoaDistanceTableAB< T, D, SC >::evaluate(), SplineC2R< ST >::evaluateDetRatios(), SplineC2C< ST >::evaluateDetRatios(), SplineR2R< ST >::evaluateDetRatios(), SplineC2R< ST >::evaluateValue(), SplineC2C< ST >::evaluateValue(), SplineR2R< ST >::evaluateValue(), SplineC2COMPTarget< ST >::evaluateValue(), SplineC2ROMPTarget< ST >::evaluateValue(), SplineC2R< ST >::evaluateVGH(), SplineR2R< ST >::evaluateVGH(), SplineC2C< ST >::evaluateVGH(), SplineC2COMPTarget< ST >::evaluateVGH(), SplineC2ROMPTarget< ST >::evaluateVGH(), SplineC2R< ST >::evaluateVGHGH(), SplineR2R< ST >::evaluateVGHGH(), SplineC2C< ST >::evaluateVGHGH(), SplineC2COMPTarget< ST >::evaluateVGHGH(), SplineC2ROMPTarget< ST >::evaluateVGHGH(), SplineC2R< ST >::evaluateVGL(), SplineR2R< ST >::evaluateVGL(), SplineC2C< ST >::evaluateVGL(), and qmcplusplus::TEST_CASE().
|
inline |
Partition ntot over npart.
me | index of boundaries being returned |
ntot | the total size |
npart | the number of partitions |
Simply divide ntot data among npart partitions so that the size of each group cannot differ by more than 1. Return the boundaries of the partition associated with partition 'me'
Definition at line 35 of file FairDivide.h.
References qmcplusplus::Units::mass::me.
|
inline |
partition ntot elements among npart
me | rank [0,ntot) |
ntot | total number of elements |
npart | number of partitions |
adist | distribution offset |
mypart satisfies adist[mypart] <= me < adist[mypart+1]
Definition at line 140 of file FairDivide.h.
References qmcplusplus::Units::mass::me.
|
inline |
partition ntot elements among npart
ntot | total number of elements |
npart | number of partitions |
adist | distribution offset |
adist[ip-1]-adist[ip] is the number of elements of ip partition This method makes the zero-th node equal to or less than 1.
Definition at line 114 of file FairDivide.h.
Referenced by HybridRepSetReader< SA >::create_atomic_centers_Gspace(), WalkerControlMPI::determineNewWalkerPopulation(), WalkerControl::determineNewWalkerPopulation(), SplineC2R< ST >::gather_tables(), SplineR2R< ST >::gather_tables(), SplineC2C< ST >::gather_tables(), SplineC2COMPTarget< ST >::gather_tables(), SplineC2ROMPTarget< ST >::gather_tables(), qmcplusplus::generateCuspInfo(), HybridRepSetReader< SA >::initialize_hybrid_pio_gather(), SplineSetReader< typename SA::SplineBase >::initialize_spline_pio_gather(), HDFWalkerInput_0_4::read_hdf5(), HDFWalkerInput_0_4::read_hdf5_scatter(), HDFWalkerInput_0_4::read_phdf5(), RMC::resetReptiles(), VMC::resetRun(), CSVMC::resetRun(), DMC::resetUpdateEngines(), DMC::run(), and qmcplusplus::TEST_CASE().
|
inline |
partition ntot elements among npart
me | rank [0,ntot) |
ntot | total number of elements |
npart | number of partitions |
adist | distribution offset |
mypart satisfies adist[mypart] <= me < adist[mypart+1]
Definition at line 171 of file FairDivide.h.
References qmcplusplus::Units::mass::me.