Commit c265761b by Francois Gygi

cleaned up timers.


git-svn-id: http://qboxcode.org/svn/qb/trunk@293 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 9ea1dacf
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// MDWavefunctionStepper.C // MDWavefunctionStepper.C
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: MDWavefunctionStepper.C,v 1.4 2004-05-03 23:19:57 fgygi Exp $ // $Id: MDWavefunctionStepper.C,v 1.5 2004-11-10 22:35:23 fgygi Exp $
#include "MDWavefunctionStepper.h" #include "MDWavefunctionStepper.h"
#include "Wavefunction.h" #include "Wavefunction.h"
...@@ -40,7 +40,7 @@ void MDWavefunctionStepper::update(Wavefunction& dwf) ...@@ -40,7 +40,7 @@ void MDWavefunctionStepper::update(Wavefunction& dwf)
{ {
if ( wf_.sdcontext(ispin,ikp)->active() ) if ( wf_.sdcontext(ispin,ikp)->active() )
{ {
tmap_["update_psi"].start(); tmap_["md_update_wf"].start();
// Verlet update of wf // Verlet update of wf
// cp = c + (c - cm) - dt2/m * hpsi // cp = c + (c - cm) - dt2/m * hpsi
// This is implemented (for each coefficient) as: // This is implemented (for each coefficient) as:
...@@ -77,7 +77,7 @@ void MDWavefunctionStepper::update(Wavefunction& dwf) ...@@ -77,7 +77,7 @@ void MDWavefunctionStepper::update(Wavefunction& dwf)
cm[2*i+1] = ctmp1; cm[2*i+1] = ctmp1;
} }
} }
tmap_["update_psi"].stop(); tmap_["md_update_wf"].stop();
tmap_["riccati"].start(); tmap_["riccati"].start();
wf_.sd(ispin,ikp)->riccati(*(wfv->sd(ispin,ikp))); wf_.sd(ispin,ikp)->riccati(*(wfv->sd(ispin,ikp)));
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// PSDAWavefunctionStepper.C // PSDAWavefunctionStepper.C
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: PSDAWavefunctionStepper.C,v 1.7 2004-04-17 01:15:55 fgygi Exp $ // $Id: PSDAWavefunctionStepper.C,v 1.8 2004-11-10 22:35:23 fgygi Exp $
#include "PSDAWavefunctionStepper.h" #include "PSDAWavefunctionStepper.h"
#include "Wavefunction.h" #include "Wavefunction.h"
...@@ -42,6 +42,7 @@ void PSDAWavefunctionStepper::update(Wavefunction& dwf) ...@@ -42,6 +42,7 @@ void PSDAWavefunctionStepper::update(Wavefunction& dwf)
DoubleMatrix a(c_proxy.context(),c_proxy.n(),c_proxy.n(), DoubleMatrix a(c_proxy.context(),c_proxy.n(),c_proxy.n(),
c_proxy.nb(),c_proxy.nb()); c_proxy.nb(),c_proxy.nb());
tmap_["psda_residual"].start();
// factor 2.0 in next line: G and -G // factor 2.0 in next line: G and -G
a.gemm('t','n',2.0,c_proxy,cp_proxy,0.0); a.gemm('t','n',2.0,c_proxy,cp_proxy,0.0);
// rank-1 update correction // rank-1 update correction
...@@ -49,10 +50,12 @@ void PSDAWavefunctionStepper::update(Wavefunction& dwf) ...@@ -49,10 +50,12 @@ void PSDAWavefunctionStepper::update(Wavefunction& dwf)
// cp = cp - c * a // cp = cp - c * a
cp_proxy.gemm('n','n',-1.0,c_proxy,a,1.0); cp_proxy.gemm('n','n',-1.0,c_proxy,a,1.0);
tmap_["psda_residual"].stop();
// dwf.sd->c() now contains the descent direction (HV-VA) // dwf.sd->c() now contains the descent direction (HV-VA)
// Apply preconditioner K and store -K(HV-VA) in dwf // Apply preconditioner K and store -K(HV-VA) in dwf
tmap_["psda_prec"].start();
const valarray<double>& diag = prec_.diag(ispin,ikp); const valarray<double>& diag = prec_.diag(ispin,ikp);
double* c = (double*) wf_.sd(ispin,ikp)->c().valptr(); double* c = (double*) wf_.sd(ispin,ikp)->c().valptr();
...@@ -82,9 +85,12 @@ void PSDAWavefunctionStepper::update(Wavefunction& dwf) ...@@ -82,9 +85,12 @@ void PSDAWavefunctionStepper::update(Wavefunction& dwf)
dcn[2*i+1] = f1; dcn[2*i+1] = f1;
} }
} }
tmap_["psda_prec"].stop();
// dwf now contains the preconditioned descent // dwf now contains the preconditioned descent
// direction -K(HV-VA) // direction -K(HV-VA)
tmap_["psda_update_wf"].start();
// Anderson extrapolation // Anderson extrapolation
if ( extrapolate_ ) if ( extrapolate_ )
{ {
...@@ -178,6 +184,7 @@ void PSDAWavefunctionStepper::update(Wavefunction& dwf) ...@@ -178,6 +184,7 @@ void PSDAWavefunctionStepper::update(Wavefunction& dwf)
} }
} }
extrapolate_ = true; extrapolate_ = true;
tmap_["psda_update_wf"].stop();
enum ortho_type { GRAM, LOWDIN, ORTHO_ALIGN, RICCATI }; enum ortho_type { GRAM, LOWDIN, ORTHO_ALIGN, RICCATI };
//const ortho_type ortho = GRAM; //const ortho_type ortho = GRAM;
...@@ -187,20 +194,27 @@ void PSDAWavefunctionStepper::update(Wavefunction& dwf) ...@@ -187,20 +194,27 @@ void PSDAWavefunctionStepper::update(Wavefunction& dwf)
switch ( ortho ) switch ( ortho )
{ {
case GRAM: case GRAM:
tmap_["gram"].start();
wf_.sd(ispin,ikp)->gram(); wf_.sd(ispin,ikp)->gram();
//wf_.sd(ispin,ikp)->align(*wf_last_.sd(ispin,ikp)); tmap_["gram"].stop();
break; break;
case LOWDIN: case LOWDIN:
tmap_["lowdin"].start();
wf_.sd(ispin,ikp)->lowdin(); wf_.sd(ispin,ikp)->lowdin();
tmap_["lowdin"].stop();
break; break;
case ORTHO_ALIGN: case ORTHO_ALIGN:
tmap_["ortho_align"].start();
wf_.sd(ispin,ikp)->ortho_align(*wf_last_.sd(ispin,ikp)); wf_.sd(ispin,ikp)->ortho_align(*wf_last_.sd(ispin,ikp));
tmap_["ortho_align"].stop();
break; break;
case RICCATI: case RICCATI:
tmap_["riccati"].start();
wf_.sd(ispin,ikp)->riccati(*wf_last_.sd(ispin,ikp)); wf_.sd(ispin,ikp)->riccati(*wf_last_.sd(ispin,ikp));
tmap_["riccati"].stop();
break; break;
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// PSDWavefunctionStepper.C // PSDWavefunctionStepper.C
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: PSDWavefunctionStepper.C,v 1.5 2004-04-17 01:15:55 fgygi Exp $ // $Id: PSDWavefunctionStepper.C,v 1.6 2004-11-10 22:35:23 fgygi Exp $
#include "PSDWavefunctionStepper.h" #include "PSDWavefunctionStepper.h"
#include "Wavefunction.h" #include "Wavefunction.h"
...@@ -32,6 +32,7 @@ void PSDWavefunctionStepper::update(Wavefunction& dwf) ...@@ -32,6 +32,7 @@ void PSDWavefunctionStepper::update(Wavefunction& dwf)
{ {
// compute A = V^T H V and descent direction HV - VA // compute A = V^T H V and descent direction HV - VA
tmap_["psd_residual"].start();
if ( wf_.sd(ispin,ikp)->basis().real() ) if ( wf_.sd(ispin,ikp)->basis().real() )
{ {
// proxy real matrices c, cp // proxy real matrices c, cp
...@@ -53,9 +54,11 @@ void PSDWavefunctionStepper::update(Wavefunction& dwf) ...@@ -53,9 +54,11 @@ void PSDWavefunctionStepper::update(Wavefunction& dwf)
// not implemented in the complex case // not implemented in the complex case
assert(false); assert(false);
} }
tmap_["psd_residual"].stop();
// dwf.sd->c() now contains the descent direction (HV-VA) // dwf.sd->c() now contains the descent direction (HV-VA)
tmap_["psd_update_wf"].start();
const valarray<double>& diag = prec_.diag(ispin,ikp); const valarray<double>& diag = prec_.diag(ispin,ikp);
double* coeff = (double*) wf_.sd(ispin,ikp)->c().valptr(); double* coeff = (double*) wf_.sd(ispin,ikp)->c().valptr();
...@@ -79,6 +82,7 @@ void PSDWavefunctionStepper::update(Wavefunction& dwf) ...@@ -79,6 +82,7 @@ void PSDWavefunctionStepper::update(Wavefunction& dwf)
c[2*i+1] -= delta_im; c[2*i+1] -= delta_im;
} }
} }
tmap_["psd_update_wf"].stop();
tmap_["gram"].start(); tmap_["gram"].start();
wf_.sd(ispin,ikp)->gram(); wf_.sd(ispin,ikp)->gram();
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// SDWavefunctionStepper.C // SDWavefunctionStepper.C
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: SDWavefunctionStepper.C,v 1.2 2004-02-04 19:55:16 fgygi Exp $ // $Id: SDWavefunctionStepper.C,v 1.3 2004-11-10 22:35:23 fgygi Exp $
#include "SDWavefunctionStepper.h" #include "SDWavefunctionStepper.h"
#include "Wavefunction.h" #include "Wavefunction.h"
...@@ -37,9 +37,9 @@ void SDWavefunctionStepper::update(Wavefunction& dwf) ...@@ -37,9 +37,9 @@ void SDWavefunctionStepper::update(Wavefunction& dwf)
if ( wf_.sdcontext(ispin,ikp)->active() ) if ( wf_.sdcontext(ispin,ikp)->active() )
{ {
// c = c - dt2bye * hpsi // c = c - dt2bye * hpsi
tmap_["update_psi"].start(); tmap_["sd_update_wf"].start();
wf_.sd(ispin,ikp)->c().axpy(-dt2bye_,dwf.sd(ispin,ikp)->c()); wf_.sd(ispin,ikp)->c().axpy(-dt2bye_,dwf.sd(ispin,ikp)->c());
tmap_["update_psi"].stop(); tmap_["sd_update_wf"].stop();
tmap_["gram"].start(); tmap_["gram"].start();
wf_.sd(ispin,ikp)->gram(); wf_.sd(ispin,ikp)->gram();
tmap_["gram"].stop(); tmap_["gram"].stop();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment