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) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Ken Esler, kpesler@gmail.com, University of Illinois at Urbana-Champaign
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 // Raymond Clay III, j.k.rofling@gmail.com, Lawrence Livermore National Laboratory
11 //
12 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
13 //////////////////////////////////////////////////////////////////////////////////////
14
15
16 #include "VMCFactory.h"
17 #include "QMCDrivers/VMC/VMC.h"
18 #include "QMCDrivers/QMCDriverInterface.h"
19 #include "QMCDrivers/CorrelatedSampling/CSVMC.h"
20 #if defined(QMC_BUILD_COMPLETE)
21 //REMOVE Broken warping
22 //#if !defined(QMC_COMPLEX)
23 //#include "QMCDrivers/VMC/VMCMultipleWarp.h"
24 //#include "QMCDrivers/VMC/VMCPbyPMultiWarp.h"
25 //#endif
26 //#include "QMCDrivers/CorrelatedSampling/CSVMC.h"
27 #endif
28 #include "Message/OpenMP.h"
29
30 #ifdef QMC_CUDA
31 #include "QMCDrivers/VMC/VMC_CUDA.h"
32 #endif
33
34 namespace qmcplusplus
35 {
create(MCWalkerConfiguration & w,TrialWaveFunction & psi,QMCHamiltonian & h,Communicate * comm,bool enable_profiling)36 QMCDriverInterface* VMCFactory::create(MCWalkerConfiguration& w,
37 TrialWaveFunction& psi,
38 QMCHamiltonian& h,
39 Communicate* comm,
40 bool enable_profiling)
41 {
42 int np = omp_get_max_threads();
43 //(SPACEWARP_MODE,MULTIPE_MODE,UPDATE_MODE)
44 QMCDriverInterface* qmc = nullptr;
45 #ifdef QMC_CUDA
46 if (VMCMode & 16)
47 qmc = new VMCcuda(w, psi, h, comm, enable_profiling);
48 else
49 #endif
50 if (VMCMode == 0 || VMCMode == 1) //(0,0,0) (0,0,1)
51 {
52 qmc = new VMC(w, psi, h, comm, enable_profiling);
53 }
54 //else if(VMCMode == 2) //(0,1,0)
55 //{
56 // qmc = new VMCMultiple(w,psi,h);
57 //}
58 //else if(VMCMode == 3) //(0,1,1)
59 //{
60 // qmc = new VMCPbyPMultiple(w,psi,h);
61 //}
62 else if (VMCMode == 2 || VMCMode == 3)
63 {
64 qmc = new CSVMC(w, psi, h, comm);
65 }
66 //#if !defined(QMC_COMPLEX)
67 // else if(VMCMode == 6) //(1,1,0)
68 // {
69 // qmc = new VMCMultipleWarp(w,psi,h, ptclpool);
70 // }
71 // else if(VMCMode == 7) //(1,1,1)
72 // {
73 // qmc = new VMCPbyPMultiWarp(w,psi,h, ptclpool);
74 // }
75 //#endif
76 // else if(VMCMode == 8) //(only possible for WFMC run)
77 // {
78 // qmc = new WFMCSingleOMP(w,psi,h,hpool,ppool);
79 // }
80 qmc->setUpdateMode(VMCMode & 1);
81 return qmc;
82 }
83 } // namespace qmcplusplus
84