Example #1
0
    void CloneManager::makeClones(TrialWaveFunction& guide)
  {

    if(guideClones.size()) 
    {
      app_log() << "  Cannot make guideClones again. Use existing " << NumThreads << " clones" << endl;
      return;
    }

    guideClones.resize(NumThreads,0);
    guideClones[0]=&guide;

    if(NumThreads==1) return;

    app_log() << "  CloneManager::makeClones makes " << NumThreads << " clones for guide." <<endl;
    OhmmsInfo::Log->turnoff();
    OhmmsInfo::Warn->turnoff();
    char pname[16];
    for(int ip=1; ip<NumThreads; ++ip) 
    {
      guideClones[ip]=guide.makeClone(*wClones[ip]);
    }
    OhmmsInfo::Log->reset();
    OhmmsInfo::Warn->reset();
  }
Example #2
0
  void CloneManager::makeClones(MCWalkerConfiguration& w, 
      TrialWaveFunction& psi, QMCHamiltonian& ham)
  {

    if(wClones.size()) {
      app_log() << "  Cannot make clones again. Use existing " << NumThreads << " clones" << endl;
      return;
    }

    app_log() << "Number of threads = " << NumThreads << endl;
    wClones.resize(NumThreads,0);
    psiClones.resize(NumThreads,0);
    hClones.resize(NumThreads,0);

    wClones[0]=&w;
    psiClones[0]=&psi;
    hClones[0]=&ham;

#if defined(ENABLE_CLONE_PSI_AND_H)
    char pname[16];
    for(int ip=1; ip<NumThreads; ++ip) 
    {
      sprintf(pname,"%s.c%i",w.getName().c_str(),ip);
      wClones[ip]=new MCWalkerConfiguration(w);
      wClones[ip]->setName(pname);
      psiClones[ip]=psi.makeClone(*wClones[ip]);
      hClones[ip]=ham.makeClone(*wClones[ip],*psiClones[ip]);
    }
#else
    cloneEngine.clone(w,psi,ham,wClones,psiClones,hClones);
#endif
  }
Example #3
0
  void CloneManager::makeClones(MCWalkerConfiguration& w, 
      TrialWaveFunction& psi, QMCHamiltonian& ham)
  {

    if(wClones.size()) 
    {
      app_log() << "  Cannot make clones again. Use existing " << NumThreads << " clones" << endl;
      return;
    }

    wClones.resize(NumThreads,0);
    psiClones.resize(NumThreads,0);
    hClones.resize(NumThreads,0);

    wClones[0]=&w;
    psiClones[0]=&psi;
    hClones[0]=&ham;

    if(NumThreads==1) return;

    app_log() << "  CloneManager::makeClones makes " << NumThreads << " clones for W/Psi/H." <<endl;
#if defined(ENABLE_CLONE_PSI_AND_H)
    app_log() << "  Cloning methods for both Psi and H are used" << endl;
    OhmmsInfo::Log->turnoff();
    OhmmsInfo::Warn->turnoff();
    char pname[16];
    for(int ip=1; ip<NumThreads; ++ip) 
    {
      wClones[ip]=new MCWalkerConfiguration(w);
      psiClones[ip]=psi.makeClone(*wClones[ip]);
      hClones[ip]=ham.makeClone(*wClones[ip],*psiClones[ip]);
    }
    OhmmsInfo::Log->reset();
    OhmmsInfo::Warn->reset();
#else
    app_log() << "Old parse method is used." << endl;
    cloneEngine.clone(w,psi,ham,wClones,psiClones,hClones);
#endif
  }