Permalink
Browse files

Use timer_on/timer_off in cceom

  • Loading branch information...
robertodr committed Sep 27, 2018
1 parent 10e4943 commit d3f3ba2b89b0c54cfc4faad9221dcb838417cc71
@@ -72,11 +72,9 @@ void WabefDD(int i, int C_irr) {
sprintf(SIjAb_lbl, "%s %d", "SIjAb", i);
sprintf(CMnEf_lbl, "%s %d", "CMnEf", i);
/* SIjAb += <Ab|Ef> CIjEf -- allow out of core algorithm */
/* SIjAb += <Ab|Ef> CIjEf -- allow out of core algorithm */
#ifdef TIME_CCEOM
timer_on("WabefDD Z");
#endif
if (params.abcd == "OLD") {
global_dpd_->buf4_init(&CMnEf, PSIF_EOM_CMnEf, C_irr, 0, 5, 0, 5, 0, CMnEf_lbl);
@@ -200,9 +198,7 @@ void WabefDD(int i, int C_irr) {
timer_off("ABCD:axpy");
}
#ifdef TIME_CCEOM
timer_off("WabefDD Z");
#endif
/* construct XIjMb = CIjEf * <mb|ef> */
global_dpd_->buf4_init(&X, PSIF_EOM_TMP, C_irr, 10, 0, 10, 0, 0, "WabefDD X(Mb,Ij)");
@@ -87,9 +87,6 @@ PsiReturnType cceom(std::shared_ptr<Wavefunction> ref_wfn, Options &options) {
get_params(options);
get_eom_params(ref_wfn, options);
#ifdef TIME_CCEOM
timer_on("CCEOM");
#endif
form_dpd_dp();
@@ -128,15 +125,12 @@ PsiReturnType cceom(std::shared_ptr<Wavefunction> ref_wfn, Options &options) {
dpd_close(0);
if (params.local) local_done();
cleanup();
#ifdef TIME_CCEOM
timer_off("CCEOM");
#endif
exit_io();
return Success;
}
void init_io() {
tstart();
timer_on("CCEOM");
for (int i = PSIF_CC_MIN; i <= PSIF_CC_MAX; i++) psio_open(i, 1);
}
@@ -145,7 +139,7 @@ void exit_io() {
for (i = PSIF_CC_MIN; i <= PSIF_CC_DIIS_AMP; i++) psio_close(i, 1);
for (i = PSIF_CC_TMP; i <= PSIF_CC_TMP11; i++) psio_close(i, 0);
for (i = PSIF_CC_TMP11 + 1; i <= PSIF_CC_MAX; i++) psio_close(i, 1);
tstop();
timer_off("CCEOM");
}
void form_dpd_dp() {
@@ -148,20 +148,14 @@ void diag() {
int L_start_iter, L_old;
char *keyw;
#ifdef TIME_CCEOM
timer_on("HBAR_EXTRA");
#endif
if (params.wfn == "EOM_CC2")
cc2_hbar_extra();
else
hbar_extra(); /* sort hbar matrix elements for sigma equations */
#ifdef TIME_CCEOM
timer_off("HBAR_EXTRA");
#endif
#ifdef EOM_DEBUG
hbar_norms();
#endif
// if(eom_params.guess == "INPUT")
// read_guess_init();
@@ -177,9 +171,7 @@ void diag() {
keep_going = 1;
num_converged = 0;
if (eom_params.cs_per_irrep[C_irr] == 0) continue;
#ifdef TIME_CCEOM
timer_on("INIT GUESS");
#endif
outfile->Printf("Symmetry of excited state: %s\n", moinfo.irr_labs[moinfo.sym ^ C_irr].c_str());
outfile->Printf("Symmetry of right eigenvector: %s\n", moinfo.irr_labs[C_irr].c_str());
if (params.eom_ref == 0) outfile->Printf("Seeking states with multiplicity of %d\n", eom_params.mult);
@@ -265,9 +257,7 @@ void diag() {
}
}
#ifdef TIME_CCEOM
timer_off("INIT GUESS");
#endif
#ifdef EOM_DEBUG
/* printout initial guesses */
@@ -337,7 +327,6 @@ void diag() {
#ifdef EOM_DEBUG
check_sum("reset", 0, 0);
#endif
#ifdef TIME_CCEOM
timer_on("SIGMA ALL");
if (params.wfn == "EOM_CC2") {
timer_on("sigmacc2");
@@ -369,21 +358,6 @@ void diag() {
}
}
timer_off("SIGMA ALL");
#else
if (params.wfn == "EOM_CC2")
cc2_sigma(i, C_irr);
else {
sigmaSS(i, C_irr);
sigmaSD(i, C_irr);
sigmaDS(i, C_irr);
sigmaDD(i, C_irr);
}
if (((params.wfn == "EOM_CC3") && (cc3_stage > 0)) || eom_params.restart_eom_cc3) {
cc3_HC1(i, C_irr);
cc3_HC1ET1(i, C_irr);
sigmaCC3(i, C_irr, cc3_eval);
}
#endif
if (params.full_matrix) {
sigma00(i, C_irr);
sigma0S(i, C_irr);
@@ -428,9 +402,7 @@ void diag() {
}
}
#ifdef TIME_CCEOM
timer_on("BUILD G");
#endif /*timing*/
/* Form G = C'*S matrix */
G = block_matrix(L, L);
@@ -567,9 +539,7 @@ void diag() {
ignore_G_old = 0;
already_sigma = L;
#ifdef TIME_CCEOM
timer_off("BUILD G");
#endif /* timing */
#ifdef EOM_DEBUG
outfile->Printf("The G Matrix\n");
mat_print(G, L, L, outfile);
@@ -605,9 +575,7 @@ void diag() {
}
outfile->Printf(" Root EOM Energy Delta E Res. Norm Conv?\n");
for (k = 0; k < eom_params.cs_per_irrep[C_irr]; ++k) {
#ifdef TIME_CCEOM
timer_on("CALC RES");
#endif /* timing */
/* rezero residual vector for each root */
if (params.full_matrix) {
@@ -758,9 +726,7 @@ void diag() {
norm = norm_C(&RIA, &Ria, &RIJAB, &Rijab, &RIjAb);
outfile->Printf("Norm of residual vector %d before precondition %18.13lf\n", k, norm);
#endif
#ifdef TIME_CCEOM
timer_off("CALC RES");
#endif /* timing */
/* moved back down 8-06 why was this ever before residual norm?
if(params.eom_ref == 0) precondition_RHF(&RIA, &RIjAb, lambda[k]);
else precondition(&RIA, &Ria, &RIJAB, &Rijab, &RIjAb, lambda[k]); */
@@ -50,7 +50,6 @@ namespace cceom {
EXTERN void check_sum(char *term_lbl, int index, int irrep);
// #define EOM_DEBUG (0)
#define TIME_CCEOM (1)
#define H_IRR (0)
#define MAX(I, J) ((I > J) ? I : J)
@@ -55,9 +55,7 @@ void restart(double **alpha, int L, int num, int C_irr, int ortho, double **alph
dpdbuf4 C2, CMNEF, Cmnef, CMnEf, SIJAB, Sijab, SIjAb;
double dotval, norm;
#ifdef TIME_CCEOM
timer_on("RESTART");
#endif
A_OCC = 0;
A_VIR = 1;
@@ -359,9 +357,7 @@ void restart(double **alpha, int L, int num, int C_irr, int ortho, double **alph
free_block(alpha_tot);
#ifdef TIME_CCEOM
timer_off("RESTART");
#endif
return;
}
@@ -51,7 +51,6 @@ void WmnefDD(int i, int C_irr);
to a Sigma vector stored at Sigma plus 'i' */
void sigmaDD(int i, int C_irr) {
#ifdef TIME_CCEOM
timer_on("FDD");
FDD(i, C_irr);
timer_off("FDD");
@@ -67,13 +66,6 @@ void sigmaDD(int i, int C_irr) {
timer_on("WmnefDD");
WmnefDD(i, C_irr);
timer_off("WmnefDD");
#else
FDD(i, C_irr);
WmnijDD(i, C_irr);
WabefDD(i, C_irr);
WmbejDD(i, C_irr);
WmnefDD(i, C_irr);
#endif
return;
}
@@ -50,7 +50,6 @@ void WnmjeDS(int i, int C_irr);
to a Sigma vector stored at Sigma plus 'i' */
void sigmaDS(int i, int C_irr) {
#ifdef TIME_CCEOM
timer_on("WmaijDS");
WmaijDS(i, C_irr);
timer_off("WmaijDS");
@@ -63,12 +62,6 @@ void sigmaDS(int i, int C_irr) {
timer_on("WbmfeDS");
WbmfeDS(i, C_irr);
timer_off("WbmfeDS");
#else
WmaijDS(i, C_irr);
WabejDS(i, C_irr);
WnmjeDS(i, C_irr);
WbmfeDS(i, C_irr);
#endif
return;
}
@@ -49,7 +49,6 @@ void WmnieSD(int i, int C_irr);
to a Sigma vector stored at Sigma plus 'i' */
void sigmaSD(int i, int C_irr) {
#ifdef TIME_CCEOM
timer_on("FSD");
FSD(i, C_irr);
timer_off("FSD");
@@ -59,11 +58,6 @@ void sigmaSD(int i, int C_irr) {
timer_on("WmnieSD");
WmnieSD(i, C_irr);
timer_off("WmnieSD");
#else
FSD(i, C_irr);
WamefSD(i, C_irr);
WmnieSD(i, C_irr);
#endif
return;
}

0 comments on commit d3f3ba2

Please sign in to comment.