Permalink
Browse files

Merge pull request #1222 from obrien951/fnocc_timer

Fnocc timer
  • Loading branch information...
andysim committed Sep 7, 2018
2 parents b8a446a + 8fc4766 commit 543b3935528a1eb07a93e2a15a08f715e40a9903
@@ -189,7 +189,10 @@ double CoupledCluster::compute_energy() {
// CCSD or QCISD
if (!options_.get_bool("RUN_MP3") && !options_.get_bool("RUN_MP4")) {
timer_on("FNOCC: CCSD");
status = CCSDIterations();
timer_off("FNOCC: CCSD");
// ccsd energy
if (isccsd) {
@@ -278,19 +281,27 @@ double CoupledCluster::compute_energy() {
// triples
if (isLowMemory) {
if (do_cc) {
timer_on("FNOCC: triples");
status = lowmemory_triples();
timer_off("FNOCC: triples");
}
if (do_mp) {
ccmethod = 2;
timer_on("FNOCC: triples");
status = lowmemory_triples();
timer_off("FNOCC: triples");
}
} else {
if (do_cc) {
timer_on("FNOCC: triples");
status = triples();
timer_off("FNOCC: triples");
}
if (do_mp) {
ccmethod = 2;
timer_on("FNOCC: triples");
status = triples();
timer_off("FNOCC: triples");
}
}
if (status == Failure) {
@@ -485,7 +485,9 @@ void DFCoupledCluster::CCResidual() {
start = omp_get_wtime();
}
timer_on("FNOCC: Vabcd1");
Vabcd1();
timer_off("FNOCC: Vabcd1");
if (timer) {
outfile->Printf(" A2 = t(c,d,i,j) (ac|bd) %6.2lf\n",
omp_get_wtime() - start);
@@ -69,7 +69,9 @@ double DFCoupledCluster::compute_energy() {
// WriteBanner();
AllocateMemory();
timer_on("FNOCC: CCSD");
status = CCSDIterations();
timer_off("FNOCC: CCSD");
// free some memory!
free(Fij);
@@ -211,10 +213,15 @@ double DFCoupledCluster::compute_energy() {
tstart();
ccmethod = 0;
if (isLowMemory)
if (isLowMemory) {
timer_on("FNOCC: triples");
status = lowmemory_triples();
else
timer_off("FNOCC: triples");
} else {
timer_on("FNOCC: triples");
status = triples();
timer_off("FNOCC: triples");
}
if (status == Failure) {
throw PsiException("Whoops, the (T) correction died.", __FILE__, __LINE__);
@@ -237,6 +244,7 @@ double DFCoupledCluster::compute_energy() {
free(Qvv);
}
// free remaining memory
free(Fia);
free(Fai);
@@ -32,6 +32,7 @@
#include "psi4/libtrans/integraltransform.h"
#include "psi4/libtrans/mospace.h"
#include "psi4/liboptions/liboptions.h"
#include "psi4/libqt/qt.h"
namespace psi {
namespace fnocc {
@@ -63,17 +64,25 @@ SharedWavefunction fnocc(SharedWavefunction ref_wfn, Options &options) {
ints->set_dpd_id(0);
ints->set_keep_iwl_so_ints(true);
ints->set_keep_dpd_so_ints(true);
timer_on("FNOCC: Initializing Integrals");
ints->initialize();
timer_off("FNOCC: Initializing Integrals");
timer_on("FNOCC: Two Elec Int Trans.");
ints->transform_tei(MOSpace::all, MOSpace::all, MOSpace::all, MOSpace::all);
timer_off("FNOCC: Two Elec Int Trans.");
tstop();
if (!options.get_bool("RUN_CEPA")) {
auto ccsd = std::make_shared<CoupledCluster>(wfn, options);
timer_on("FNOCC: CC energy");
ccsd->compute_energy();
timer_off("FNOCC: CC energy");
return ccsd;
} else {
auto cepa = std::make_shared<CoupledPair>(wfn, options);
timer_on("FNOCC: CEPA energy");
cepa->compute_energy();
timer_off("FNOCC: CEPA energy");
return cepa;
}
@@ -104,10 +113,14 @@ SharedWavefunction fnocc(SharedWavefunction ref_wfn, Options &options) {
#ifdef GPUCC
auto ccsd = std::make_shared<GPUDFCoupledCluster>(wfn, options);
timer_on("FNOCC: CC energy");
ccsd->compute_energy();
timer_off("FNOCC: CC energy");
#else
auto ccsd = std::make_shared<DFCoupledCluster>(wfn, options);
timer_on("FNOCC: CC energy");
ccsd->compute_energy();
timer_off("FNOCC: CC energy");
#endif
tstop();

0 comments on commit 543b393

Please sign in to comment.