Пример #1
0
 ///clenup non-static data members
 CloneManager::~CloneManager()
 {
   // delete_iter(CSMovers.begin(),CSMovers.end());
   delete_iter(Movers.begin(),Movers.end());
   delete_iter(branchClones.begin(),branchClones.end());
   delete_iter(estimatorClones.begin(),estimatorClones.end());
 }
Пример #2
0
 ///clenup non-static data members
 CloneManager::~CloneManager()
 {
   delete_iter(Rng.begin(),Rng.end());
   delete_iter(Movers.begin(),Movers.end());
   delete_iter(branchClones.begin(),branchClones.end());
   delete_iter(estimatorClones.begin(),estimatorClones.end());
 }
Пример #3
0
EstimatorManager::~EstimatorManager()
{
  delete_iter(Estimators.begin(), Estimators.end());
  delete_iter(RemoteData.begin(), RemoteData.end());
  delete_iter(h5desc.begin(), h5desc.end());
  if(Collectables)
    delete Collectables;
}
Пример #4
0
ParticleSet::~ParticleSet()
{
  DEBUG_MEMORY("ParticleSet::~ParticleSet");
  delete_iter(DistTables.begin(), DistTables.end());
  if (SK)
    delete SK;
  delete_iter(Sphere.begin(), Sphere.end());
}
Пример #5
0
/** Clean up the vector */
QMCCostFunctionOMP::~QMCCostFunctionOMP()
{
  delete_iter(H_KE_Node.begin(),H_KE_Node.end());
  delete_iter(RngSaved.begin(),RngSaved.end());
  delete_iter(RecordsOnNode.begin(),RecordsOnNode.end());
  delete_iter(DerivRecords.begin(),DerivRecords.end());
  delete_iter(HDerivRecords.begin(),HDerivRecords.end());
}
Пример #6
0
 ///destructor
 LocalECPotential::~LocalECPotential() { 
   delete_iter(PPset.begin(),PPset.end());
   //map<int,RadialPotentialType*>::iterator pit(PPset.begin()), pit_end(PPset.end());
   //while(pit != pit_end) {
   //  delete (*pit).second; ++pit;
   //}
 }
Пример #7
0
void ParticleSet::clearDistanceTables()
{
  //Physically remove the tables
  delete_iter(DistTables.begin(),DistTables.end());
  DistTables.clear();
  //for(int i=0; i< DistTables.size(); i++) DistanceTable::removeTable(DistTables[i]->getName());
  //DistTables.erase(DistTables.begin(),DistTables.end());
}
Пример #8
0
///destructor
NonLocalECPotential::~NonLocalECPotential()
{
  delete_iter(PPset.begin(),PPset.end());
  //map<int,NonLocalECPComponent*>::iterator pit(PPset.begin()), pit_end(PPset.end());
  //while(pit != pit_end) {
  //   delete (*pit).second; ++pit;
  //}
}
Пример #9
0
 void CompositeEstimatorBase::close()
 {
   if(GroupID>-1)
   {
     //for(int p=0; p<hList.size(); p++) H5Gclose(hList[p]);
     delete_iter(oList.begin(),oList.end());
     oList.clear();
     //hList.clear();
     H5Gclose(GroupID);//close all the group
     GroupID=-1;
   }
 }
Пример #10
0
 EstimatorManager::~EstimatorManager()
 { 
   delete_iter(Estimators.begin(), Estimators.end());
   delete_iter(RemoteData.begin(), RemoteData.end());
   delete_iter(h5desc.begin(), h5desc.end());
 }
Пример #11
0
  void EstimatorManager::start(int blocks, bool record)
  {
   for(int i=0; i<Estimators.size(); i++) 
        Estimators[i]->setNumberOfBlocks(blocks);
    reset();
    RecordCount=0;
    energyAccumulator.clear();
    varAccumulator.clear();

    BlockAverages.setValues(0.0);
    AverageCache.resize(BlockAverages.size());
    SquaredAverageCache.resize(BlockAverages.size());
    PropertyCache.resize(BlockProperties.size());

    //count the buffer size for message
    BufferSize=2*AverageCache.size()+PropertyCache.size();

#if defined(QMC_ASYNC_COLLECT)
    int sources=myComm->size();
#else
    int sources=2;
#endif

    //allocate buffer for data collection
    if(RemoteData.empty())
      for(int i=0; i<sources; ++i) RemoteData.push_back(new BufferType(BufferSize));
    else
      for(int i=0; i<RemoteData.size(); ++i) RemoteData[i]->resize(BufferSize);

#if defined(DEBUG_ESTIMATOR_ARCHIVE)
    if(record && DebugArchive ==0)
    {
      char fname[128];
      sprintf(fname,"%s.p%03d.scalar.dat",myComm->getName().c_str(), myComm->rank());
      DebugArchive = new ofstream(fname);
      addHeader(*DebugArchive);
    }
#endif

    //set Options[RECORD] to enable/disable output 
    Options.set(RECORD,record&&Options[MANAGE]);

    if(Options[RECORD])
    {
      if(Archive) delete Archive;
      string fname(myComm->getName());
      fname.append(".scalar.dat");
      Archive = new ofstream(fname.c_str());
      addHeader(*Archive);

      if(h5desc.size())
      {
        delete_iter(h5desc.begin(),h5desc.end());
        h5desc.clear();
      }

      fname=myComm->getName()+".stat.h5";
      h_file= H5Fcreate(fname.c_str(),H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT);
      for(int i=0; i<Estimators.size(); i++) 
        Estimators[i]->registerObservables(h5desc,h_file);

#if defined(QMC_ASYNC_COLLECT)
      if(Options[COLLECT])
      {//issue a irecv
        pendingRequests=0;
        for(int i=1,is=0; i<myComm->size(); i++,is++) 
        {
          myRequest[is]=myComm->irecv(i,i,*RemoteData[i]);//request only has size-1
          pendingRequests++;
        }
      }
#endif
    }
  }
Пример #12
0
 CompositeEstimatorBase::~CompositeEstimatorBase()
 {
   close();
   delete_iter(dList.begin(), dList.end());
 }
Пример #13
0
 CompositeEstimatorSet::~CompositeEstimatorSet()
 { 
   delete_iter(Estimators.begin(), Estimators.end());
   //close the file
   if(GroupID>=-1) H5Fclose(GroupID);
 }
Пример #14
0
 RPAJastrow::~RPAJastrow() 
 {
   delete_iter(Psi.begin(), Psi.end());
   delete myHandler;
 }
Пример #15
0
CSUpdateBase::~CSUpdateBase()
{
  delete_iter(G1.begin(),G1.end());
  delete_iter(L1.begin(),L1.end());
}
Пример #16
0
 EstimatorManager::~EstimatorManager()
 { 
   delete_iter(Estimators.begin(), Estimators.end());
   if(CompEstimators) delete CompEstimators;
   delete_iter(RemoteData.begin(), RemoteData.end());
 }
Пример #17
0
void QMCCostFunctionOMP::getConfigurations(const string& aroot)
{
  //makeClones(W,Psi,H);
  if (H_KE_Node.empty())
  {
    app_log() << "  QMCCostFunctionOMP is created with " << NumThreads << endl;
    //make H_KE_Node
    H_KE_Node.resize(NumThreads,0);
    RecordsOnNode.resize(NumThreads,0);
    DerivRecords.resize(NumThreads,0);
    HDerivRecords.resize(NumThreads,0);
  }
  app_log() << "   Loading configuration from MCWalkerConfiguration::SampleStack " << endl;
  app_log() << "    number of walkers before load " << W.getActiveWalkers() << endl;
  app_log()<<"  Using Nonlocal PP in Opt: "<<includeNonlocalH<<endl;
  OhmmsInfo::Log->turnoff();
  OhmmsInfo::Warn->turnoff();
  //#pragma omp parallel for
  for (int ip=0; ip<NumThreads; ++ip)
  {
    if (H_KE_Node[ip]==0)
    {
      H_KE_Node[ip]= new QMCHamiltonian;
      H_KE_Node[ip]->addOperator(hClones[ip]->getHamiltonian("Kinetic"),"Kinetic");
      if (includeNonlocalH.c_str()!="no")
      {
        QMCHamiltonianBase* a=hClones[ip]->getHamiltonian(includeNonlocalH.c_str());
        if(a)
        {
          app_log()<<" Found non-local Hamiltonian element named "<<includeNonlocalH<<endl;
          H_KE_Node[ip]->addOperator(a,includeNonlocalH.c_str());
        }
        else
          app_log()<<" Did not find non-local Hamiltonian element named "<<includeNonlocalH<<endl;
      }
    }
  }

  app_log() << "    number of walkers before load: ";
  nVMCWalkers.resize(NumThreads);
  for (int ip=0; ip<NumThreads; ++ip)
  {
    nVMCWalkers[ip]=wClones[ip]->getActiveWalkers();
    app_log() <<  wClones[ip]->getActiveWalkers() <<  " " ;
  }
  app_log() << endl;

#pragma omp parallel for
  for (int ip=0; ip<NumThreads; ++ip)
  {
    wClones[ip]->loadEnsemble();
  }

  //load walkers from SampleStack
  OhmmsInfo::Log->reset();
  OhmmsInfo::Warn->reset();
  app_log() << "    number of walkers after load: ";
  wPerNode[0]=0;
  for (int ip=0; ip<NumThreads; ++ip)
  {
    wPerNode[ip+1]=wPerNode[ip]+wClones[ip]->getActiveWalkers();
    app_log() <<  wClones[ip]->getActiveWalkers() <<  " " ;
  }
  app_log() << endl;
  app_log().flush();

  if (dLogPsi.size() != wPerNode[NumThreads])
  {
    delete_iter(dLogPsi.begin(),dLogPsi.end());
    delete_iter(d2LogPsi.begin(),d2LogPsi.end());
    int nptcl=W.getTotalNum();
    int nwtot=wPerNode[NumThreads];
    dLogPsi.resize(nwtot);
    d2LogPsi.resize(nwtot);
    for (int i=0; i<nwtot; ++i)
      dLogPsi[i]=new ParticleGradient_t(nptcl);
    for (int i=0; i<nwtot; ++i)
      d2LogPsi[i]=new ParticleLaplacian_t(nptcl);
  }
  //JNKIM TO JEREMY
  //for(int ip=1; ip<NumThreads;++ip)
  //{
  //  opt_variables_type dummy;
  //  psiClone->checkInVariables(dummy);
  //  PsiClone[ip]->checkOutVariables(OptVariablesForPsi);
  //}
}
Пример #18
0
 WMConstraints::~WMConstraints() {
   delete_iter(FuncList.begin(), FuncList.end());
 }
Пример #19
0
/** Destructor
*
*@warning Have not decided whether Z is cleaned up by TrialWaveFunction
*  or not. It will depend on I/O implementation.
*/
TrialWaveFunction::~TrialWaveFunction()
{
  delete_iter(Z.begin(),Z.end());
  //delete_iter(SPOSet.begin(),SPOSet.end());
  //delete_iter(myTimers.begin(),myTimers.end());
}
Пример #20
0
MultiChain::~MultiChain() 
{
  delete_iter(Beads.begin(),Beads.end());
}
Пример #21
0
 ScaledPadeConstraints::~ScaledPadeConstraints() {
   delete_iter(FuncList.begin(), FuncList.end());
 }
Пример #22
0
ProductOrbital::~ProductOrbital()
{
  delete_iter(Psi.begin(), Psi.end());
  delete Constraints;
}