25 #if !defined(REMOVE_TRACEMANAGER) 28 using TraceManager = int;
32 #define ENABLE_CLONE_PSI_AND_H 86 #if !defined(REMOVE_TRACEMANAGER) 95 app_log() <<
" Cannot make clones again. Use existing " <<
NumThreads <<
" clones" << std::endl;
111 app_log() <<
" CloneManager::makeClones makes " <<
NumThreads <<
" clones for W/Psi/H." << std::endl;
112 app_log() <<
" Cloning methods for both Psi and H are used" << std::endl;
121 throw std::runtime_error(
"CloneManager::makeClones Inconsist NumThreads and omp_get_num_threads()!\n");
127 wClones_uptr[ip - 1] = std::make_unique<MCWalkerConfiguration>(w);
143 std::vector<TrialWaveFunction*>& psipool,
144 std::vector<QMCHamiltonian*>& hampool)
148 app_log() <<
" Cannot make clones again. Use existing " <<
NumThreads <<
" clones" << std::endl;
167 app_log() <<
" CloneManager::makeClones makes " <<
NumThreads <<
" clones for W/Psi/H Pools." << std::endl;
168 app_log() <<
" Cloning methods for both Psi and H are used" << std::endl;
181 wClones_uptr[ip - 1] = std::make_unique<MCWalkerConfiguration>(w);
183 for (
int ipsi = 0; ipsi < psipool.size(); ipsi++)
187 HPoolClones_uptr[ip - 1][ipsi] = hampool[ipsi]->makeClone(w, *psipool[ipsi]);
201 app_log() <<
" Cannot make clones again. Use existing " <<
NumThreads <<
" clones" << std::endl;
209 app_log() <<
" CloneManager::makeClones makes " <<
NumThreads <<
" clones for guide/wg." << std::endl;
225 app_log() <<
" Cannot make clones again. Use existing " <<
NumThreads <<
" clones" << std::endl;
231 wgClones[0] = std::make_unique<MCWalkerConfiguration>(wg);
235 app_log() <<
" CloneManager::makeClones makes " <<
NumThreads <<
" clones for guide/wg." << std::endl;
239 wgClones[ip] = std::make_unique<MCWalkerConfiguration>(wg);
253 nAcceptTot +=
Movers[ip]->nAccept;
254 nRejectTot +=
Movers[ip]->nReject;
256 #if defined(__GNUC__) || !defined(NDEBUG) 264 vec[ip] =
Movers[ip]->nAccept;
265 nAcceptTot_debug += vec[ip];
266 vec[ip] =
Movers[ip]->nReject;
267 nRejectTot_debug += vec[ip];
269 if (nAcceptTot != nAcceptTot_debug || nRejectTot != nRejectTot_debug)
271 app_warning() <<
" Potential compiler bug detected!" 272 <<
" Overwriting nAcceptTot wrong value " << nAcceptTot <<
" with correct value " << nAcceptTot_debug
274 <<
" Overwriting nRejectTot wrong value " << nRejectTot <<
" with correct value " << nRejectTot_debug
276 nAcceptTot = nAcceptTot_debug;
277 nRejectTot = nRejectTot_debug;
280 return static_cast<RealType>(nAcceptTot) / static_cast<RealType>(nAcceptTot + nRejectTot);
UPtrVector< WalkerLogCollector > wlog_collectors
trace collectors
void pause()
Pause the summary and log streams.
A set of walkers that are to be advanced by Metropolis Monte Carlo.
std::ostream & app_warning()
static std::vector< TrialWaveFunction * > psiClones
virtual ~CloneManager()
virtual destructor
void delete_iter(IT first, IT last)
delete the pointers in [first,last)
std::vector< int > wPerRank
Walkers per MPI rank.
helper functions for EinsplineSetBuilder
QTBase::RealType RealType
static UPtrVector< MCWalkerConfiguration > wgClones
static std::vector< std::vector< TrialWaveFunction * > > PsiPoolClones
static std::vector< TrialWaveFunction * > guideClones
static std::vector< MCWalkerConfiguration * > wClones
static void clearClones()
Collection of Local Energy Operators.
std::vector< QMCUpdateBase * > Movers
update engines
void print_mem(const std::string &title, std::ostream &log)
void resume()
Continue output on the stream used before pausing.
std::unique_ptr< TrialWaveFunction > makeClone(ParticleSet &tqp) const
static UPtrVector< TrialWaveFunction > guideClones_uptr
guide wavefunctions
OutputManagerClass outputManager(Verbosity::HIGH)
static UPtrVector< TrialWaveFunction > psiClones_uptr
trial wavefunctions
QMCTraits::IndexType IndexType
static std::vector< UPtrVector< MCWalkerConfiguration > > WPoolClones_uptr
omp_int_t omp_get_thread_num()
static UPtrVector< MCWalkerConfiguration > wClones_uptr
walkers
omp_int_t omp_get_max_threads()
std::vector< EstimatorManagerBase * > estimatorClones
estimator managers
bool io_node
true, print out file
const IndexType NumThreads
number of threads
void makeClones(MCWalkerConfiguration &w, TrialWaveFunction &psi, QMCHamiltonian &ham)
omp_int_t omp_get_num_threads()
CloneManager()
Constructor.
static std::vector< QMCHamiltonian * > hClones
std::vector< std::reference_wrapper< T > > RefVector
Declaration of HamiltonianPool.
static std::vector< UPtrVector< TrialWaveFunction > > PsiPoolClones_uptr
static UPtrVector< QMCHamiltonian > hClones_uptr
Hamiltonians.
Class to represent a many-body trial wave function.
Manager class to handle multiple threads.
RealType acceptRatio() const
static std::vector< std::vector< QMCHamiltonian * > > HPoolClones
std::vector< TraceManager * > traceClones
trace managers
RefVector< WalkerLogCollector > getWalkerLogCollectorRefs()
QMCState qmc_common
a unique QMCState during a run
std::unique_ptr< QMCHamiltonian > makeClone(ParticleSet &qp, TrialWaveFunction &psi) const
return a clone
static std::vector< std::vector< MCWalkerConfiguration * > > WPoolClones
static std::vector< UPtrVector< QMCHamiltonian > > HPoolClones_uptr