Commit caf30d89 by Francois Gygi

rel_1_17_0


git-svn-id: http://qboxcode.org/svn/qb/trunk@244 cba15fb0-1239-40c8-b417-11db7ca47a34
parent d49d2dd2
......@@ -7,7 +7,7 @@ preferrable to use a single-column context when nst is small to avoid
memory problems.
--------------------------------------------------------------------------------
rel1_17_0 candidate
rel1_17_0 2004-08-11
Fixed bug 27: buffer overrun in Context::string_bcast.
Fixed bug 26: inconsistent qbox xmlns namespace in species file and qbox output.
Modified qb.C: use new qbox_xmlns() function to print qbox XML namespace.
......
......@@ -3,9 +3,7 @@
// qb.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: qb.C,v 1.38 2004-05-20 00:23:44 fgygi Exp $
const char* const xmlns_url = "http://www.llnl.gov/casc/fpmd/qbox/1.0";
// $Id: qb.C,v 1.39 2004-08-11 17:56:24 fgygi Exp $
#include <iostream>
#include <string>
......@@ -20,6 +18,7 @@ using namespace std;
#include "isodate.h"
#include "release.h"
#include "qbox_xmlns.h"
#include "Context.h"
#include "UserInterface.h"
......@@ -98,7 +97,7 @@ int main(int argc, char **argv, char **envp)
cout << " I Copyright (c) 2003-2004 I\n";
cout << " ===========================\n\n";
cout << "-->\n";
cout << "<qbox:simulation xmlns:qbox=\"" << xmlns_url << "\">" << endl;
cout << "<qbox:simulation xmlns:qbox=\"" << qbox_xmlns() << "\">" << endl;
cout << "<release> " << release() << " " << TARGET << " </release>" << endl;
// Identify executable name, checksum, size and link date
......
////////////////////////////////////////////////////////////////////////////////
//
// qbox_xmlns.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: qbox_xmlns.C,v 1.1 2004-08-11 17:56:24 fgygi Exp $
#include "qbox_xmlns.h"
std::string qbox_xmlns(void)
{
return std::string("http://www.llnl.gov/casc/fpmd/qbox/ns/qbox-1.0");
}
////////////////////////////////////////////////////////////////////////////////
//
// qbox_xmlns.h:
//
////////////////////////////////////////////////////////////////////////////////
// $Id: qbox_xmlns.h,v 1.1 2004-08-11 17:56:24 fgygi Exp $
#ifndef QBOX_XMLNS_H
#include <string>
std::string qbox_xmlns(void);
#endif
......@@ -3,10 +3,10 @@
// release.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: release.C,v 1.3 2004-06-01 22:46:21 fgygi Exp $
// $Id: release.C,v 1.4 2004-08-11 17:56:24 fgygi Exp $
#include "release.h"
std::string release(void)
{
return std::string("1.16.0");
return std::string("1.17.0");
}
......@@ -5,10 +5,10 @@
xmlns:xlink="http://www.w3.org/1999/xlink">
<annotation>
<documentation> $Id: species.xsd,v 1.2 2003-05-16 16:14:00 fgygi Exp $
<documentation> $Id: species.xsd,v 1.3 2004-08-11 17:56:24 fgygi Exp $
Qbox atomic species specification schema.
The Quantum Box project. Francois Gygi, Lawrence Livermore National Laboratory.
Copyright (c) 2003 The Regents of the University of California.
Francois Gygi, Lawrence Livermore National Laboratory.
Copyright (c) 2003-2004 The Regents of the University of California.
</documentation>
</annotation>
......
......@@ -27,7 +27,7 @@ int main(int argc, char **argv)
Context ctxt_global;
int mype = ctxt_global.mype();
cout << " Process " << mype << " on " << processor_name << endl;
//cout << " Process " << mype << " on " << processor_name << endl;
if ( argc != 14 )
{
......@@ -43,25 +43,31 @@ int main(int argc, char **argv)
double ecut = atof(argv[10]);
D3vector kpoint(atof(argv[11]),atof(argv[12]),atof(argv[13]));
cout << " ctxt_global: " << ctxt_global;
cout << " ctxt_global.comm(): " << ctxt_global.comm() << endl;
//cout << " ctxt_global: " << ctxt_global;
//cout << " ctxt_global.comm(): " << ctxt_global.comm() << endl;
Context ctxt(ctxt_global,'c');
cout << " ctxt: " << ctxt;
cout << " ctxt.comm(): " << ctxt.comm() << endl;
//cout << " ctxt: " << ctxt;
//cout << " ctxt.comm(): " << ctxt.comm() << endl;
Basis basis(ctxt,kpoint);
basis.resize(cell,cell,ecut);
FourierTransform ft(basis,basis.np(0),basis.np(1),basis.np(2));
vector<complex<double> > x(basis.localsize());
cout << " basis.localsize() = " << basis.localsize() << endl;
cout << " basis.np() = " << basis.np(0) << " " << basis.np(1)
<< " " << basis.np(2) << endl;
double flops = 5.0 * ft.np012() *
( log((double)basis.np(0)) + log((double)basis.np(1)) +
log((double)basis.np(2)) ) / log(2.0);
cout << " flop count: " << flops << endl;
if ( ctxt.onpe0() )
{
cout << " basis.localsize() = " << basis.localsize() << endl;
cout << " basis.np() = " << basis.np(0) << " " << basis.np(1)
<< " " << basis.np(2) << endl;
cout << " flop count: " << flops << endl;
}
cout.setf(ios::fixed,ios::floatfield);
cout.setf(ios::right,ios::adjustfield);
cout << setprecision(6);
const double rc = 1.0;
#if 1
// Initialize with Fourier coefficients of a normalized gaussian distribution
......@@ -84,8 +90,10 @@ int main(int argc, char **argv)
tm.start();
ft.backward(&x[0],&f[0]);
tm.stop();
cout << " fwd time: " << tm.cpu() << " / " << tm.real()
<< " " << 1.e-6*flops/tm.real() << " MFlops" << endl;
cout << " " << basis.np(0) << " " << basis.np(1)
<< " " << basis.np(2) << " ";
cout << " bwd time: " << tm.cpu() << " / " << tm.real()
<< " " << 1.e-6*flops/tm.real() << " MFlops" << endl;
#if 0
for ( int i = 0; i < basis.localsize(); i++ )
......@@ -107,11 +115,15 @@ int main(int argc, char **argv)
tsum += real(f[i]);
MPI_Allreduce(&tsum,&sum,1,MPI_DOUBLE,MPI_SUM,ctxt.comm());
cout << " sum: " << sum * omega / ft.np012() << endl;
if ( ctxt.onpe0() )
cout << " sum: " << sum * omega / ft.np012() << endl;
FourierTransform ft2(basis,2*basis.np(0),2*basis.np(1),2*basis.np(2));
vector<complex<double> > f2(ft2.np012loc());
tm.reset();
tm.start();
ft2.backward(&x[0],&f2[0]);
tm.stop();
// integral in r space must be 1.0
tsum = 0.0;
......@@ -119,8 +131,14 @@ int main(int argc, char **argv)
tsum += real(f2[i]);
MPI_Allreduce(&tsum,&sum,1,MPI_DOUBLE,MPI_SUM,ctxt.comm());
cout << " " << 2*basis.np(0) << " " << 2*basis.np(1)
<< " " << 2*basis.np(2) << " ";
cout << " bwd time: " << tm.cpu() << " / " << tm.real()
<< " " << 1.e-6*flops/tm.real() << " MFlops" << endl;
cout << " sum on f2: " << sum * omega / ft2.np012() << endl;
#if 0
//////////////////////////////////////////////////////////////////////////////
// Integration of a 2-norm normalized plane wave
//////////////////////////////////////////////////////////////////////////////
......@@ -183,38 +201,45 @@ int main(int argc, char **argv)
cout << " sum gaussian^2: " << sum / ft.np012() << endl;
#endif
//////////////////////////////////////////////////////////////////////////////
// Test forward transform
//////////////////////////////////////////////////////////////////////////////
for ( int i = 0; i < ft.np0(); i++ )
for ( int j = 0; j < ft.np1(); j++ )
for ( int k = 0; k < ft.np2_loc(); k++ )
f[ft.index(i,j,k)] = cos(k*2*M_PI/ft.np2()) + sin(i*2*M_PI/ft.np0()) ;
ft.forward(&f[0],&x[0]);
for ( int i = 0; i < ft2.np0(); i++ )
for ( int j = 0; j < ft2.np1(); j++ )
for ( int k = 0; k < ft2.np2_loc(); k++ )
f2[ft2.index(i,j,k)] = cos(k*2*M_PI/ft2.np2()) + sin(i*2*M_PI/ft2.np0()) ;
ft2.forward(&f2[0],&x[0]);
#if 0
for ( int i = 0; i < basis.localsize(); i++ )
cout << basis.kv(3*i) << " " << basis.kv(3*i+1) << " " << basis.kv(3*i+2)
<< " x[G]= " << x[i] << endl;
#endif
tm.reset();
tm.start();
ft.forward(&f[0],&x[0]);
ft2.forward(&f2[0],&x[0]);
tm.stop();
cout << " " << 2*basis.np(0) << " " << 2*basis.np(1)
<< " " << 2*basis.np(2) << " ";
cout << " fwd time: " << tm.cpu() << " / " << tm.real()
<< " " << 1.e-6*flops/tm.real() << " MFlops" << endl;
tm.reset();
tm.start();
ft.backward(&x[0],&f[0]);
ft2.backward(&x[0],&f2[0]);
tm.stop();
cout << " " << 2*basis.np(0) << " " << 2*basis.np(1)
<< " " << 2*basis.np(2) << " ";
cout << " bwd2 time: " << tm.cpu() << " / " << tm.real()
<< " " << 1.e-6*flops/tm.real() << " MFlops" << endl;
tm.reset();
tm.start();
ft.forward(&f[0],&x[0]);
ft2.forward(&f2[0],&x[0]);
tm.stop();
cout << " " << 2*basis.np(0) << " " << 2*basis.np(1)
<< " " << 2*basis.np(2) << " ";
cout << " fwd2 time: " << tm.cpu() << " / " << tm.real()
<< " " << 1.e-6*flops/tm.real() << " MFlops" << endl;
......
......@@ -8,6 +8,7 @@
#include <iomanip>
#include <fstream>
#include <cstdio>
#include "qbox_xmlns.h"
using namespace std;
int main(int argc, char **argv)
......@@ -44,9 +45,12 @@ int main(int argc, char **argv)
}
cout << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
cout << "<qbox:species xmlns:qbox=\"http://www.llnl.gov/casc/fpmd/qbox/ns/qbox-1.0\"" << endl;
cout << "<qbox:species xmlns:qbox=\""
<< qbox_xmlns()
<< "\"" << endl;
cout << " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " << endl;
cout << " xsi:schemaLocation=\"http://www.llnl.gov/casc/fpmd/qbox/ns/qbox-1.0 " << endl;
cout << " xsi:schemaLocation=\"";
cout << qbox_xmlns();
cout << " species.xsd\">" << endl;
cout << "<description>" << psname_buf << "</description>" << endl;
cout << "<symbol>X</symbol>" << endl;
......
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