forked from edeprince3/gpu_dfcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gpu_dfcc.cu
126 lines (114 loc) · 4.74 KB
/
gpu_dfcc.cu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
*@BEGIN LICENSE
*
* GPU-accelerated density-fitted coupled-cluster, a plugin to:
*
* PSI4: an ab initio quantum chemistry software package
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*@END LICENSE
*/
#include <psi4/libplugin/plugin.h>
#include <psi4/psi4-dec.h>
#include <psi4/liboptions/liboptions.h>
#include <psi4/libpsio/psio.hpp>
#include "dfcc_fnocc.h"
#include "frozen_natural_orbitals.h"
#include "ccsd.h"
INIT_PLUGIN
using namespace std;
namespace psi{ namespace fnocc {
extern "C" PSI_API
int read_options(std::string name, Options& options)
{
if (name == "GPU_DFCC"|| options.read_globals()) {
/*- Do dgemm timings? ! expert -*/
options.add_bool("DGEMM_TIMINGS",false);
/*- Maximum amount of pinned CPU memory (mb) -*/
options.add_int("MAX_MAPPED_MEMORY",7000);
/*- Override number of GPUs detected? -*/
options.add_int("NUM_GPUS",0);
/*- Do time each cc diagram? -*/
options.add_bool("CC_TIMINGS",false);
/*- Convergence for the CC energy. Note that convergence is
met only when E_CONVERGENCE and R_CONVERGENCE are satisfied. -*/
options.add_double("E_CONVERGENCE", 1.0e-8);
/*- Convergence for the CC amplitudes. Note that convergence is
met only when E_CONVERGENCE and R_CONVERGENCE are satisfied. -*/
options.add_double("R_CONVERGENCE", 1.0e-7);
/*- Maximum number of CC iterations -*/
options.add_int("MAXITER", 100);
/*- Desired number of DIIS vectors -*/
options.add_int("DIIS_MAX_VECS", 8);
/*- Do use low memory option for triples contribution? Note that this
option is enabled automatically if the memory requirements of the
conventional algorithm would exceed the available resources -*/
//options.add_bool("TRIPLES_LOW_MEMORY",false);
/*- Do compute triples contribution? !expert -*/
options.add_bool("COMPUTE_TRIPLES", true);
/*- Do use MP2 NOs to truncate virtual space for CCSD and (T)? -*/
options.add_bool("NAT_ORBS", false);
/*- Cutoff for occupation of MP2 NO orbitals in FNO-CCSD(T)
( only valid if |gpu_dfcc__nat_orbs| = true ) -*/
options.add_double("OCC_TOLERANCE", 1.0e-6);
/*- Do SCS-MP2? -*/
options.add_bool("SCS_MP2", false);
/*- Do SCS-CCSD? -*/
options.add_bool("SCS_CCSD", false);
/*- Do SCS-CEPA? Note that the scaling factors will be identical
to those for SCS-CCSD. -*/
options.add_bool("SCS_CEPA", false);
/*- Opposite-spin scaling factor for SCS-MP2 -*/
options.add_double("MP2_SCALE_OS",1.20);
/*- Same-spin scaling factor for SCS-MP2 -*/
options.add_double("MP2_SCALE_SS",1.0/3.0);
/*- Oppposite-spin scaling factor for SCS-CCSD -*/
options.add_double("CC_SCALE_OS", 1.27);
/*- Same-spin scaling factor for SCS-CCSD -*/
options.add_double("CC_SCALE_SS",1.13);
options.add_str("CC_TYPE","");
/*- Do use density fitting in CC? This keyword is used internally
by the driver. Changing its value will have no effect on the
computation. ! expert -*/
options.add_bool("DFCC",false);
/*- Auxilliary basis for df-ccsd(t). -*/
options.add_str("DF_BASIS_CC","");
/*- Tolerance for Cholesky decomposition of the ERI tensor.
( only valid if |gpu_dfcc__df_basis_cc| = cholesky or
|scf__scf_type|=cd -*/
options.add_double("CHOLESKY_TOLERANCE",1.0e-4);
options.add_str("SCF_TYPE","DF");
options.add_str("ACTIVE_GPUS","");
}
return true;
}
extern "C" PSI_API
SharedWavefunction gpu_dfcc(SharedWavefunction ref_wfn, Options& options)
{
std::shared_ptr<Wavefunction> wfn;
std::shared_ptr<DFFrozenNO> fno(new DFFrozenNO(ref_wfn,options));
fno->ThreeIndexIntegrals();
if ( options.get_bool("NAT_ORBS") ) {
fno->ComputeNaturalOrbitals();
wfn = (std::shared_ptr<Wavefunction>)fno;
}else {
wfn = ref_wfn;
}
std::shared_ptr<GPUDFCoupledCluster> ccsd (new GPUDFCoupledCluster(wfn,options));
ccsd->compute_energy();
return (SharedWavefunction)ccsd;
}
}} // End namespaces