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 @@
// 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 "Wavefunction.h"
......@@ -40,7 +40,7 @@ void MDWavefunctionStepper::update(Wavefunction& dwf)
{
if ( wf_.sdcontext(ispin,ikp)->active() )
{
tmap_["update_psi"].start();
tmap_["md_update_wf"].start();
// Verlet update of wf
// cp = c + (c - cm) - dt2/m * hpsi
// This is implemented (for each coefficient) as:
......@@ -77,7 +77,7 @@ void MDWavefunctionStepper::update(Wavefunction& dwf)
cm[2*i+1] = ctmp1;
}
}
tmap_["update_psi"].stop();
tmap_["md_update_wf"].stop();
tmap_["riccati"].start();
wf_.sd(ispin,ikp)->riccati(*(wfv->sd(ispin,ikp)));
......
......@@ -3,7 +3,7 @@
// 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 "Wavefunction.h"
......@@ -42,6 +42,7 @@ void PSDAWavefunctionStepper::update(Wavefunction& dwf)
DoubleMatrix a(c_proxy.context(),c_proxy.n(),c_proxy.n(),
c_proxy.nb(),c_proxy.nb());
tmap_["psda_residual"].start();
// factor 2.0 in next line: G and -G
a.gemm('t','n',2.0,c_proxy,cp_proxy,0.0);
// rank-1 update correction
......@@ -49,10 +50,12 @@ void PSDAWavefunctionStepper::update(Wavefunction& dwf)
// cp = cp - c * a
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)
// Apply preconditioner K and store -K(HV-VA) in dwf
tmap_["psda_prec"].start();
const valarray<double>& diag = prec_.diag(ispin,ikp);
double* c = (double*) wf_.sd(ispin,ikp)->c().valptr();
......@@ -82,9 +85,12 @@ void PSDAWavefunctionStepper::update(Wavefunction& dwf)
dcn[2*i+1] = f1;
}
}
tmap_["psda_prec"].stop();
// dwf now contains the preconditioned descent
// direction -K(HV-VA)
tmap_["psda_update_wf"].start();
// Anderson extrapolation
if ( extrapolate_ )
{
......@@ -178,6 +184,7 @@ void PSDAWavefunctionStepper::update(Wavefunction& dwf)
}
}
extrapolate_ = true;
tmap_["psda_update_wf"].stop();
enum ortho_type { GRAM, LOWDIN, ORTHO_ALIGN, RICCATI };
//const ortho_type ortho = GRAM;
......@@ -187,20 +194,27 @@ void PSDAWavefunctionStepper::update(Wavefunction& dwf)
switch ( ortho )
{
case GRAM:
tmap_["gram"].start();
wf_.sd(ispin,ikp)->gram();
//wf_.sd(ispin,ikp)->align(*wf_last_.sd(ispin,ikp));
tmap_["gram"].stop();
break;
case LOWDIN:
tmap_["lowdin"].start();
wf_.sd(ispin,ikp)->lowdin();
tmap_["lowdin"].stop();
break;
case ORTHO_ALIGN:
tmap_["ortho_align"].start();
wf_.sd(ispin,ikp)->ortho_align(*wf_last_.sd(ispin,ikp));
tmap_["ortho_align"].stop();
break;
case RICCATI:
tmap_["riccati"].start();
wf_.sd(ispin,ikp)->riccati(*wf_last_.sd(ispin,ikp));
tmap_["riccati"].stop();
break;
}
}
......
......@@ -3,7 +3,7 @@
// 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 "Wavefunction.h"
......@@ -32,6 +32,7 @@ void PSDWavefunctionStepper::update(Wavefunction& dwf)
{
// compute A = V^T H V and descent direction HV - VA
tmap_["psd_residual"].start();
if ( wf_.sd(ispin,ikp)->basis().real() )
{
// proxy real matrices c, cp
......@@ -53,9 +54,11 @@ void PSDWavefunctionStepper::update(Wavefunction& dwf)
// not implemented in the complex case
assert(false);
}
tmap_["psd_residual"].stop();
// dwf.sd->c() now contains the descent direction (HV-VA)
tmap_["psd_update_wf"].start();
const valarray<double>& diag = prec_.diag(ispin,ikp);
double* coeff = (double*) wf_.sd(ispin,ikp)->c().valptr();
......@@ -79,6 +82,7 @@ void PSDWavefunctionStepper::update(Wavefunction& dwf)
c[2*i+1] -= delta_im;
}
}
tmap_["psd_update_wf"].stop();
tmap_["gram"].start();
wf_.sd(ispin,ikp)->gram();
......
......@@ -3,7 +3,7 @@
// 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 "Wavefunction.h"
......@@ -37,9 +37,9 @@ void SDWavefunctionStepper::update(Wavefunction& dwf)
if ( wf_.sdcontext(ispin,ikp)->active() )
{
// 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());
tmap_["update_psi"].stop();
tmap_["sd_update_wf"].stop();
tmap_["gram"].start();
wf_.sd(ispin,ikp)->gram();
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