Commit 0c77dcad authored by Francois Gygi's avatar Francois Gygi
Browse files

rel1_63_6

git-svn-id: http://qboxcode.org/svn/qb/branches/rel1_63@1908 cba15fb0-1239-40c8-b417-11db7ca47a34
parents 91c419be 05ea370e
......@@ -60,8 +60,8 @@ BOSampleStepper::~BOSampleStepper()
s_.ctxt_.dmax(1,1,&tmax,1);
if ( s_.ctxt_.myproc()==0 )
{
cout << "<timing name=\""
<< (*i).first << "\""
string s = "name=\"" + (*i).first + "\"";
cout << "<timing " << left << setw(22) << s
<< " min=\"" << setprecision(3) << tmin << "\""
<< " max=\"" << setprecision(3) << tmax << "\"/>"
<< endl;
......@@ -1191,7 +1191,8 @@ void BOSampleStepper::step(int niter)
s_.ctxt_.dmax(1,1,&tmax,1);
if ( onpe0 )
{
cout << " <timing name=\"iteration\""
string s = "name=\"iteration\"";
cout << "<timing " << left << setw(22) << s
<< " min=\"" << setprecision(3) << tmin << "\""
<< " max=\"" << setprecision(3) << tmax << "\"/>"
<< endl;
......
......@@ -434,8 +434,8 @@ void Bisection::compute_transform(const SlaterDet& sd, int maxsweep, double tol)
ctxt_.dmax(1,1,&tmax,1);
if ( ctxt_.myproc()==0 )
{
cout << "<timing name=\""
<< (*i).first << "\""
string s = "name=\"" + (*i).first + "\"";
cout << "<timing " << left << setw(22) << s
<< " min=\"" << setprecision(3) << tmin << "\""
<< " max=\"" << setprecision(3) << tmax << "\"/>"
<< endl;
......
......@@ -83,8 +83,8 @@ class BisectionCmd : public Cmd
{
cout << " BisectionCmd: lx=" << nLevels[0]
<< " ly=" << nLevels[1]
<< " lz=" << nLevels[2]
<< " threshold=" << epsilon << endl;
<< " lz=" << nLevels[2]
<< " threshold=" << epsilon << endl;
// print localization vectors and overlaps
int sum = 0;
......
......@@ -69,8 +69,8 @@ CPSampleStepper::~CPSampleStepper(void)
s_.ctxt_.dmax(1,1,&tmax,1);
if ( s_.ctxt_.myproc()==0 )
{
cout << "<timing name=\""
<< (*i).first << "\""
string s = "name=\"" + (*i).first + "\"";
cout << "<timing " << left << setw(22) << s
<< " min=\"" << setprecision(3) << tmin << "\""
<< " max=\"" << setprecision(3) << tmax << "\"/>"
<< endl;
......@@ -268,7 +268,8 @@ void CPSampleStepper::step(int niter)
s_.ctxt_.dmax(1,1,&tmax,1);
if ( s_.ctxt_.myproc()==0 )
{
cout << " <timing name=\"iteration\""
string s = "name=\"iteration\"";
cout << "<timing " << left << setw(22) << s
<< " min=\"" << setprecision(3) << tmin << "\""
<< " max=\"" << setprecision(3) << tmax << "\"/>"
<< endl;
......
......@@ -109,8 +109,8 @@ ChargeDensity::~ChargeDensity(void)
ctxt_.dmax(1,1,&tmax,1);
if ( ctxt_.myproc()==0 )
{
cout << "<timing name=\""
<< (*i).first << "\""
string s = "name=\"" + (*i).first + "\"";
cout << "<timing " << left << setw(22) << s
<< " min=\"" << setprecision(3) << tmin << "\""
<< " max=\"" << setprecision(3) << tmax << "\"/>"
<< endl;
......
......@@ -162,8 +162,8 @@ ElectricEnthalpy::~ElectricEnthalpy(void)
s_.ctxt_.dmax(1,1,&tmax,1);
if ( pol_type_ != off && s_.ctxt_.myproc()==0 )
{
cout << "<timing name=\""
<< (*i).first << "\""
string s = "name=\"" + (*i).first + "\"";
cout << "<timing " << left << setw(22) << s
<< " min=\"" << setprecision(3) << tmin << "\""
<< " max=\"" << setprecision(3) << tmax << "\"/>"
<< endl;
......
......@@ -209,8 +209,8 @@ EnergyFunctional::~EnergyFunctional(void)
s_.ctxt_.dmax(1,1,&tmax,1);
if ( s_.ctxt_.myproc()==0 )
{
cout << "<timing name=\""
<< (*i).first << "\""
string s = "name=\"" + (*i).first + "\"";
cout << "<timing " << left << setw(22) << s
<< " min=\"" << setprecision(3) << tmin << "\""
<< " max=\"" << setprecision(3) << tmax << "\"/>"
<< endl;
......
......@@ -589,8 +589,9 @@ void FourierTransform::bwd(complex<double>* val)
int inc1 = 1, inc2 = np2_, ntrans = nvec_, isign = -1, initflag = 0;
double scale = 1.0;
dcft_(&initflag,&zvec_[0],&inc1,&inc2,&zvec_[0],&inc1,&inc2,&np2_,&ntrans,
&isign,&scale,&aux1zb[0],&naux1z,&aux2[0],&naux2);
if ( ntrans > 0 )
dcft_(&initflag,&zvec_[0],&inc1,&inc2,&zvec_[0],&inc1,&inc2,&np2_,&ntrans,
&isign,&scale,&aux1zb[0],&naux1z,&aux2[0],&naux2);
#elif USE_FFTW2
/*
* void fftw(fftw_plan plan, int howmany,
......@@ -834,29 +835,35 @@ void FourierTransform::bwd(complex<double>* val)
// transform only non-zero vectors along x
// First block: positive y indices: [0,ntrans0_]
ntrans = ntrans0_;
inc1 = 1;
inc2 = np0_;
istart = k * np0_ * np1_;
length = np0_;
dcft_(&initflag,&val[istart],&inc1,&inc2,&val[istart],&inc1,&inc2,
&length,&ntrans,&isign,&scale,&aux1xb[0],&naux1x,&aux2[0],&naux2);
// Second block: negative y indices: [np1-ntrans0_,np1-1]
inc1 = 1;
inc2 = np0_;
istart = np0_ * ( (np1_-ntrans) + k * np1_ );
length = np0_;
dcft_(&initflag,&val[istart],&inc1,&inc2,&val[istart],&inc1,&inc2,
&length,&ntrans,&isign,&scale,&aux1xb[0],&naux1x,&aux2[0],&naux2);
if ( ntrans > 0 )
{
inc1 = 1;
inc2 = np0_;
istart = k * np0_ * np1_;
length = np0_;
dcft_(&initflag,&val[istart],&inc1,&inc2,&val[istart],&inc1,&inc2,
&length,&ntrans,&isign,&scale,&aux1xb[0],&naux1x,&aux2[0],&naux2);
// Second block: negative y indices: [np1-ntrans0_,np1-1]
inc1 = 1;
inc2 = np0_;
istart = np0_ * ( (np1_-ntrans) + k * np1_ );
length = np0_;
dcft_(&initflag,&val[istart],&inc1,&inc2,&val[istart],&inc1,&inc2,
&length,&ntrans,&isign,&scale,&aux1xb[0],&naux1x,&aux2[0],&naux2);
}
// transform along y for all values of x
ntrans = np0_;
inc1 = np0_;
inc2 = 1;
istart = k * np0_ * np1_;
length = np1_;
dcft_(&initflag,&val[istart],&inc1,&inc2,&val[istart],&inc1,&inc2,
&length,&ntrans,&isign,&scale,&aux1yb[0],&naux1y,&aux2[0],&naux2);
if ( ntrans > 0 )
{
inc1 = np0_;
inc2 = 1;
istart = k * np0_ * np1_;
length = np1_;
dcft_(&initflag,&val[istart],&inc1,&inc2,&val[istart],&inc1,&inc2,
&length,&ntrans,&isign,&scale,&aux1yb[0],&naux1y,&aux2[0],&naux2);
}
#endif // USE_ESSL_2DFFT
} // k
......@@ -1062,28 +1069,34 @@ void FourierTransform::fwd(complex<double>* val)
double scale = 1.0;
// transform along y for all values of x
ntrans = np0_;
inc1 = np0_;
inc2 = 1;
istart = k * np0_ * np1_;
length = np1_;
dcft_(&initflag,&val[istart],&inc1,&inc2,&val[istart],&inc1,&inc2,
&length,&ntrans,&isign,&scale,&aux1yf[0],&naux1y,&aux2[0],&naux2);
if ( ntrans > 0 )
{
inc1 = np0_;
inc2 = 1;
istart = k * np0_ * np1_;
length = np1_;
dcft_(&initflag,&val[istart],&inc1,&inc2,&val[istart],&inc1,&inc2,
&length,&ntrans,&isign,&scale,&aux1yf[0],&naux1y,&aux2[0],&naux2);
}
// transform only non-zero vectors along x
ntrans = ntrans0_;
inc1 = 1;
inc2 = np0_;
istart = k * np0_ * np1_;
length = np0_;
dcft_(&initflag,&val[istart],&inc1,&inc2,&val[istart],&inc1,&inc2,
&length,&ntrans,&isign,&scale,&aux1xf[0],&naux1x,&aux2[0],&naux2);
inc1 = 1;
inc2 = np0_;
istart = np0_ * ( (np1_-ntrans) + k * np1_ );
length = np0_;
dcft_(&initflag,&val[istart],&inc1,&inc2,&val[istart],&inc1,&inc2,
&length,&ntrans,&isign,&scale,&aux1xf[0],&naux1x,&aux2[0],&naux2);
if ( ntrans > 0 )
{
inc1 = 1;
inc2 = np0_;
istart = k * np0_ * np1_;
length = np0_;
dcft_(&initflag,&val[istart],&inc1,&inc2,&val[istart],&inc1,&inc2,
&length,&ntrans,&isign,&scale,&aux1xf[0],&naux1x,&aux2[0],&naux2);
inc1 = 1;
inc2 = np0_;
istart = np0_ * ( (np1_-ntrans) + k * np1_ );
length = np0_;
dcft_(&initflag,&val[istart],&inc1,&inc2,&val[istart],&inc1,&inc2,
&length,&ntrans,&isign,&scale,&aux1xf[0],&naux1x,&aux2[0],&naux2);
}
#endif // USE_ESSL_2DFFT
} // k
#elif USE_FFTW2
......@@ -1275,8 +1288,9 @@ void FourierTransform::fwd(complex<double>* val)
int inc1 = 1, inc2 = np2_, ntrans = nvec_, isign = 1, initflag = 0;
double scale = 1.0 / np012();
dcft_(&initflag,&zvec_[0],&inc1,&inc2,&zvec_[0],&inc1,&inc2,&np2_,&ntrans,
&isign,&scale,&aux1zf[0],&naux1z,&aux2[0],&naux2);
if ( ntrans > 0 )
dcft_(&initflag,&zvec_[0],&inc1,&inc2,&zvec_[0],&inc1,&inc2,&np2_,&ntrans,
&isign,&scale,&aux1zf[0],&naux1z,&aux2[0],&naux2);
#elif USE_FFTW2
#if _OPENMP
......@@ -1386,13 +1400,16 @@ void FourierTransform::init_lib(void)
// initialize z transforms
int ntrans = nvec_;
inc1 = 1; inc2 = np2_;
isign = -1;
dcft_(&initflag,p,&inc1,&inc2,p,&inc1,&inc2,&np2_,&ntrans,
&isign,&scale,&aux1zb[0],&naux1z,&aux2[0],&naux2);
isign = 1; scale = 1.0 / np012();
dcft_(&initflag,p,&inc1,&inc2,p,&inc1,&inc2,&np2_,&ntrans,
&isign,&scale,&aux1zf[0],&naux1z,&aux2[0],&naux2);
if ( ntrans > 0 )
{
inc1 = 1; inc2 = np2_;
isign = -1;
dcft_(&initflag,p,&inc1,&inc2,p,&inc1,&inc2,&np2_,&ntrans,
&isign,&scale,&aux1zb[0],&naux1z,&aux2[0],&naux2);
isign = 1; scale = 1.0 / np012();
dcft_(&initflag,p,&inc1,&inc2,p,&inc1,&inc2,&np2_,&ntrans,
&isign,&scale,&aux1zf[0],&naux1z,&aux2[0],&naux2);
}
#else // USE_ESSL_2DFFT
naux1x = (int) (20000 + 2.28 * np0_);
......@@ -1420,30 +1437,39 @@ void FourierTransform::init_lib(void)
// x transforms
inc1 = 1; inc2 = np0_; ntrans = ntrans0_;
isign = -1;
dcft_(&initflag,p,&inc1,&inc2,p,&inc1,&inc2,&np0_,&ntrans,
&isign,&scale,&aux1xb[0],&naux1x,&aux2[0],&naux2);
isign = 1;
dcft_(&initflag,p,&inc1,&inc2,p,&inc1,&inc2,&np0_,&ntrans,
&isign,&scale,&aux1xf[0],&naux1x,&aux2[0],&naux2);
if ( ntrans > 0 )
{
isign = -1;
dcft_(&initflag,p,&inc1,&inc2,p,&inc1,&inc2,&np0_,&ntrans,
&isign,&scale,&aux1xb[0],&naux1x,&aux2[0],&naux2);
isign = 1;
dcft_(&initflag,p,&inc1,&inc2,p,&inc1,&inc2,&np0_,&ntrans,
&isign,&scale,&aux1xf[0],&naux1x,&aux2[0],&naux2);
}
// y transforms
inc1 = np0_; inc2 = 1; ntrans = ntrans1_;
isign = -1;
dcft_(&initflag,p,&inc1,&inc2,p,&inc1,&inc2,&np1_,&ntrans,
&isign,&scale,&aux1yb[0],&naux1y,&aux2[0],&naux2);
isign = 1;
dcft_(&initflag,p,&inc1,&inc2,p,&inc1,&inc2,&np1_,&ntrans,
&isign,&scale,&aux1yf[0],&naux1y,&aux2[0],&naux2);
if ( ntrans > 0 )
{
isign = -1;
dcft_(&initflag,p,&inc1,&inc2,p,&inc1,&inc2,&np1_,&ntrans,
&isign,&scale,&aux1yb[0],&naux1y,&aux2[0],&naux2);
isign = 1;
dcft_(&initflag,p,&inc1,&inc2,p,&inc1,&inc2,&np1_,&ntrans,
&isign,&scale,&aux1yf[0],&naux1y,&aux2[0],&naux2);
}
// z transforms
inc1 = 1; inc2 = np2_; ntrans = ntrans2_;
isign = -1;
dcft_(&initflag,p,&inc1,&inc2,p,&inc1,&inc2,&np2_,&ntrans,
&isign,&scale,&aux1zb[0],&naux1z,&aux2[0],&naux2);
isign = 1; scale = 1.0 / np012();
dcft_(&initflag,p,&inc1,&inc2,p,&inc1,&inc2,&np2_,&ntrans,
&isign,&scale,&aux1zf[0],&naux1z,&aux2[0],&naux2);
if ( ntrans > 0 )
{
isign = -1;
dcft_(&initflag,p,&inc1,&inc2,p,&inc1,&inc2,&np2_,&ntrans,
&isign,&scale,&aux1zb[0],&naux1z,&aux2[0],&naux2);
isign = 1; scale = 1.0 / np012();
dcft_(&initflag,p,&inc1,&inc2,p,&inc1,&inc2,&np2_,&ntrans,
&isign,&scale,&aux1zf[0],&naux1z,&aux2[0],&naux2);
}
#endif // USE_ESSL_2DFFT
......
......@@ -77,7 +77,8 @@ CXXFLAGS += -DTARGET='"$(TARGET)"'
Base64Transcoder.o
$(LD) $(DFLAGS) -o $@ $^ $(LDFLAGS)
testWavefunction: testWavefunction.o Wavefunction.o SlaterDet.o \
Basis.o FourierTransform.o Matrix.o UnitCell.o Context.o
Basis.o FourierTransform.o Matrix.o UnitCell.o Context.o \
Base64Transcoder.o
$(LD) $(DFLAGS) -o $@ $^ $(LDFLAGS)
testEnergyFunctional: testEnergyFunctional.o EnergyFunctional.o Basis.o \
SlaterDet.o Matrix.o UnitCell.o Context.o FourierTransform.o \
......
......@@ -40,8 +40,8 @@ NonLocalPotential::~NonLocalPotential(void)
ctxt_.dmax(1,1,&tmax,1);
if ( ctxt_.myproc()==0 )
{
cout << "<timing name=\""
<< (*i).first << "\""
string s = "name=\"" + (*i).first + "\"";
cout << "<timing " << left << setw(22) << s
<< " min=\"" << setprecision(3) << tmin << "\""
<< " max=\"" << setprecision(3) << tmax << "\"/>"
<< endl;
......
......@@ -54,8 +54,8 @@ SampleStepper::~SampleStepper(void)
s_.ctxt_.dmax(1,1,&tmax,1);
if ( s_.ctxt_.myproc()==0 )
{
cout << "<timing name=\""
<< (*i).first << "\""
string s = "name=\"" + (*i).first + "\"";
cout << "<timing " << left << setw(22) << s
<< " min=\"" << setprecision(3) << tmin << "\""
<< " max=\"" << setprecision(3) << tmax << "\"/>"
<< endl;
......
......@@ -95,8 +95,8 @@ SlaterDet::~SlaterDet()
ctxt_.dmax(1,1,&tmax,1);
if ( ctxt_.myproc()==0 )
{
cout << "<timing name=\""
<< (*i).first << "\""
string s = "name=\"" + (*i).first + "\"";
cout << "<timing " << left << setw(22) << s
<< " min=\"" << setprecision(3) << tmin << "\""
<< " max=\"" << setprecision(3) << tmax << "\"/>"
<< endl;
......
......@@ -486,6 +486,7 @@ void UserInterface::processCmdsServer ( string inputfilename,
}
// wait before retrying
sync();
usleep(200000);
} // while !done
......
......@@ -19,5 +19,5 @@
#include "release.h"
std::string release(void)
{
return std::string("1.63.5");
return std::string("1.63.6");
}
......@@ -15,7 +15,6 @@
// testBasisMapping.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: testBasisMapping.C,v 1.4 2008-09-08 15:56:20 fgygi Exp $
#include "Context.h"
#include "Basis.h"
......@@ -54,9 +53,9 @@ int main(int argc, char **argv)
Timer tm;
Context ctxt(npr,npc);
Context ctxt(MPI_COMM_WORLD,npr,npc);
Basis basis(ctxt,kpoint);
Basis basis(ctxt.comm(),kpoint);
basis.resize(cell,cell,ecut);
cout << " np0=" << basis.np(0)
......
......@@ -53,7 +53,7 @@ int main(int argc, char **argv)
Timer tm;
Context ctxt(npr,npc);
Context ctxt(MPI_COMM_WORLD,npr,npc);
SlaterDet sd(ctxt,kpoint);
cout << sd.context();
......
......@@ -15,7 +15,6 @@
// testWavefunction.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: testWavefunction.C,v 1.9 2008-09-08 15:56:20 fgygi Exp $
#include "Context.h"
#include "Wavefunction.h"
......@@ -50,7 +49,7 @@ int main(int argc, char **argv)
int nspin = atoi(argv[13]);
int nkp = atoi(argv[14]);
Context ctxt;
Context ctxt(MPI_COMM_WORLD);
Wavefunction wf(ctxt);
Timer tm;
......@@ -82,7 +81,7 @@ int main(int argc, char **argv)
{
for ( int ikp = 0; ikp < wf.nkp(); ikp++ )
{
if ( wf.sd(ispin,ikp) != 0 && wf.sdcontext(ispin,ikp)->active() )
if ( wf.sd(ispin,ikp) != 0 )
{
cout << "wf.sd(ispin=" << ispin << ",ikp=" << ikp << "): "
<< wf.sd(ispin,ikp)->c().m() << "x"
......
......@@ -15,8 +15,6 @@
// testXMLGFPreprocessor.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: testXMLGFPreprocessor.C,v 1.4 2008-09-08 15:56:20 fgygi Exp $
#include <iostream>
#include <cassert>
......@@ -41,7 +39,7 @@ int main(int argc, char** argv)
const int nc = atoi(argv[2]);
const char* const filename = argv[3];
Context ctxt(nr,nc); // context on which gfdata is defined
Context ctxt(MPI_COMM_WORLD,nr,nc); // context on which gfdata is defined
DoubleMatrix gfdata(ctxt);
string xmlcontent;
......
......@@ -10,11 +10,9 @@
// See the file COPYING in the root directory of this distribution
// or <http://www.gnu.org/licenses/>.
//
// $Id: testjacobi.C,v 1.5 2008-09-08 15:56:20 fgygi Exp $
// test the Jacobi implementation of the Matrix class
//
// test jacobi
//
// use: testjacobi
// use: testjacobi nprow npcol n nb
//
#include <cassert>
......@@ -84,7 +82,7 @@ int main(int argc, char **argv)
MPI_Bcast(&nb_a, 1, MPI_INT, 0, MPI_COMM_WORLD);
#endif
{
Context ctxt(nprow,npcol);
Context ctxt(MPI_COMM_WORLD,nprow,npcol);
if ( mype == 0 )
{
......
......@@ -17,7 +17,6 @@
// use: testjade nprow npcol m mb
//
////////////////////////////////////////////////////////////////////////////////
// $Id: testjade.C,v 1.4 2008-09-08 15:56:20 fgygi Exp $
#include <cassert>
#include <cstdlib>
......@@ -143,7 +142,7 @@ int main(int argc, char **argv)
MPI_Bcast(&nb_a, 1, MPI_INT, 0, MPI_COMM_WORLD);
#endif
{
Context ctxt(nprow,npcol);
Context ctxt(MPI_COMM_WORLD,nprow,npcol);
if ( mype == 0 )
{
......
Supports Markdown
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