Commit d49d2dd2 by Francois Gygi

rel_1_17_0


git-svn-id: http://qboxcode.org/svn/qb/trunk@243 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 5fd62b76
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// ChargeDensity.C // ChargeDensity.C
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: ChargeDensity.C,v 1.6 2004-06-01 23:08:08 fgygi Exp $ // $Id: ChargeDensity.C,v 1.7 2004-08-11 17:56:24 fgygi Exp $
#include "ChargeDensity.h" #include "ChargeDensity.h"
#include "Basis.h" #include "Basis.h"
...@@ -141,8 +141,8 @@ void ChargeDensity::update_density(void) ...@@ -141,8 +141,8 @@ void ChargeDensity::update_density(void)
{ {
cout.setf(ios::fixed,ios::floatfield); cout.setf(ios::fixed,ios::floatfield);
cout.setf(ios::right,ios::adjustfield); cout.setf(ios::right,ios::adjustfield);
cout << " <total_electronic_charge> " << setprecision(8) << sum cout << " <!-- total_electronic_charge: " << setprecision(8) << sum
<< " </total_electronic_charge>" << endl; << " -->" << endl;
} }
vft_->forward(&rhotmp[0],&rhog[ispin][0]); vft_->forward(&rhotmp[0],&rhog[ispin][0]);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// Context.C // Context.C
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: Context.C,v 1.9 2003-11-20 20:22:33 fgygi Exp $ // $Id: Context.C,v 1.10 2004-08-11 17:56:24 fgygi Exp $
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
...@@ -317,8 +317,13 @@ struct ContextRep ...@@ -317,8 +317,13 @@ struct ContextRep
} }
MPI_Bcast(&len,1,MPI_INT,isrc,comm()); MPI_Bcast(&len,1,MPI_INT,isrc,comm());
char* buf = new char[len+1]; char* buf = new char[len+1];
s.copy(buf,string::npos); // s is initialized only on task isrc
buf[len] = 0; if ( mype() == isrc )
{
s.copy(buf,string::npos);
buf[len]=0;
assert(buf[len]=='\0');
}
MPI_Bcast(buf,len+1,MPI_CHAR,isrc,comm()); MPI_Bcast(buf,len+1,MPI_CHAR,isrc,comm());
s = buf; s = buf;
delete [] buf; delete [] buf;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// EnergyFunctional.C // EnergyFunctional.C
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: EnergyFunctional.C,v 1.17 2004-03-11 21:52:31 fgygi Exp $ // $Id: EnergyFunctional.C,v 1.18 2004-08-11 17:56:24 fgygi Exp $
#include "EnergyFunctional.h" #include "EnergyFunctional.h"
#include "Sample.h" #include "Sample.h"
...@@ -328,7 +328,7 @@ double EnergyFunctional::energy(bool compute_hpsi, Wavefunction& dwf, ...@@ -328,7 +328,7 @@ double EnergyFunctional::energy(bool compute_hpsi, Wavefunction& dwf,
} // ispin } // ispin
// sum contains the contributions to ekin, etc.. from this task // sum contains the contributions to ekin, etc.. from this task
wf.context().dsum(14,1,&sum[0],1); wf.context().dsum(14,1,&sum[0],14);
ekin_ = sum[0]; ekin_ = sum[0];
sigma_ekin[0] = sum[1]; sigma_ekin[0] = sum[1];
...@@ -374,7 +374,7 @@ double EnergyFunctional::energy(bool compute_hpsi, Wavefunction& dwf, ...@@ -374,7 +374,7 @@ double EnergyFunctional::energy(bool compute_hpsi, Wavefunction& dwf,
// potential energy: integral of electronic charge times ionic local pot. // potential energy: integral of electronic charge times ionic local pot.
tsum = 0.0; tsum = 0.0;
int len=2*ngloc,inc1=1; int len=2*ngloc,inc1=1;
tsum[0] = 2.0 * ddot_(&len,(double*)&rhoelg[0],&inc1, tsum[0] = 2.0 * ddot(&len,(double*)&rhoelg[0],&inc1,
(double*)&vion_local_g[0],&inc1); (double*)&vion_local_g[0],&inc1);
// remove double counting for G=0 // remove double counting for G=0
if ( vbasis_->context().myrow() == 0 ) if ( vbasis_->context().myrow() == 0 )
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// FourierTransform.C // FourierTransform.C
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: FourierTransform.C,v 1.11 2004-03-11 21:48:39 fgygi Exp $ // $Id: FourierTransform.C,v 1.12 2004-08-11 17:56:24 fgygi Exp $
// The following macros must be defined: USE_FFTW, USE_ESSL, USE_ESSL_2DFFT // The following macros must be defined: USE_FFTW, USE_ESSL, USE_ESSL_2DFFT
...@@ -27,9 +27,10 @@ typedef int MPI_Comm; ...@@ -27,9 +27,10 @@ typedef int MPI_Comm;
#if USE_FFTW #if USE_FFTW
#include "fftw.h" #include "fftw.h"
extern "C" { #ifdef ADD_
void zdscal_(int *,double *,complex<double> *,int *); #define zdscal zdscal_
} #endif
extern "C" void zdscal(int *n,double *alpha,complex<double> *x,int *incx);
#elif USE_ESSL #elif USE_ESSL
extern "C" { extern "C" {
void dcft_(int *initflag, complex<double> *x, int *inc2x, int *inc3x, void dcft_(int *initflag, complex<double> *x, int *inc2x, int *inc3x,
...@@ -957,7 +958,7 @@ void FourierTransform::fwd(complex<double>* val) ...@@ -957,7 +958,7 @@ void FourierTransform::fwd(complex<double>* val)
(FFTW_COMPLEX*)0,0,0); (FFTW_COMPLEX*)0,0,0);
int len = zvec_.size(); int len = zvec_.size();
double fac = 1.0 / ( np0_ * np1_ * np2_ ); double fac = 1.0 / ( np0_ * np1_ * np2_ );
zdscal_(&len,&fac,&zvec_[0],&inc1); zdscal(&len,&fac,&zvec_[0],&inc1);
#else #else
// No library // No library
/* Transform along z */ /* Transform along z */
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// FourierTransform.h // FourierTransform.h
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: FourierTransform.h,v 1.6 2003-11-20 20:27:06 fgygi Exp $ // $Id: FourierTransform.h,v 1.7 2004-08-11 17:56:24 fgygi Exp $
#ifndef FOURIERTRANSFORM_H #ifndef FOURIERTRANSFORM_H
#define FOURIERTRANSFORM_H #define FOURIERTRANSFORM_H
...@@ -14,9 +14,6 @@ using namespace std; ...@@ -14,9 +14,6 @@ using namespace std;
#if USE_FFTW #if USE_FFTW
#include "fftw.h" #include "fftw.h"
extern "C" void zdscal_(int *n,double *alpha,complex<double> *x,int *incx);
extern "C" void zcopy_(int *n,complex<double> *x, int *incx,
complex<double> *y, int *incy);
#endif #endif
class Basis; class Basis;
...@@ -57,7 +54,7 @@ class FourierTransform ...@@ -57,7 +54,7 @@ class FourierTransform
vector<double> aux2; vector<double> aux2;
int naux1x,naux1y,naux1z,naux2; int naux1x,naux1y,naux1z,naux2;
#endif #endif
#elif USE_FFTW #elif USE_FFTW || USE_FFTW3
fftw_plan fwplan0,fwplan1,fwplan2,bwplan0,bwplan1,bwplan2; fftw_plan fwplan0,fwplan1,fwplan2,bwplan0,bwplan1,bwplan2;
#else #else
// no library // no library
......
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# $Id: Makefile,v 1.25 2004-06-02 21:40:40 fgygi Exp $ # $Id: Makefile,v 1.26 2004-08-11 17:56:24 fgygi Exp $
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
include $(TARGET).mk include $(TARGET).mk
...@@ -28,7 +28,7 @@ CXXFLAGS += -DTARGET='"$(TARGET)"' ...@@ -28,7 +28,7 @@ CXXFLAGS += -DTARGET='"$(TARGET)"'
MDWavefunctionStepper.o SDIonicStepper.o MDIonicStepper.o \ MDWavefunctionStepper.o SDIonicStepper.o MDIonicStepper.o \
PSDWavefunctionStepper.o PSDAWavefunctionStepper.o \ PSDWavefunctionStepper.o PSDAWavefunctionStepper.o \
SDCellStepper.o ConfinementPotential.o Preconditioner.o \ SDCellStepper.o ConfinementPotential.o Preconditioner.o \
release.o isodate.o $(PLTOBJECTS) release.o qbox_xmlns.o isodate.o $(PLTOBJECTS)
$(LD) $(DFLAGS) -o $@ $^ $(LDFLAGS) $(LD) $(DFLAGS) -o $@ $^ $(LDFLAGS)
SamplePrint: SamplePrint.o SamplePrintHandlers.o SamplePrint: SamplePrint.o SamplePrintHandlers.o
$(LD) $(DFLAGS) -o $@ $^ $(LDFLAGS) $(LD) $(DFLAGS) -o $@ $^ $(LDFLAGS)
...@@ -81,11 +81,14 @@ CXXFLAGS += -DTARGET='"$(TARGET)"' ...@@ -81,11 +81,14 @@ CXXFLAGS += -DTARGET='"$(TARGET)"'
$(LD) $(DFLAGS) -o $@ $^ $(LDFLAGS) $(LD) $(DFLAGS) -o $@ $^ $(LDFLAGS)
testMemParse: testMemParse.o testMemParse: testMemParse.o
$(LD) $(DFLAGS) -o $@ $^ $(LDFLAGS) $(LD) $(DFLAGS) -o $@ $^ $(LDFLAGS)
xmlSpecies: xmlSpecies.o xmlSpecies: xmlSpecies.o qbox_xmlns.o
$(LD) $(DFLAGS) -o $@ $^ $(LDFLAGS) $(LD) $(DFLAGS) -o $@ $^ $(LDFLAGS)
xmlget: xmlget.o xmlget: xmlget.o
$(LD) -o xmlget xmlget.C -I$(XERCESCDIR)/include \ $(LD) -o xmlget xmlget.C -I$(XERCESCDIR)/include \
-L$(XERCESCDIR)/lib -lxerces-c -L$(XERCESCDIR)/lib -lxerces-c
xmlextract: xmlextract.o
$(LD) -o xmlextract xmlextract.C -I$(XERCESCDIR)/include \
-L$(XERCESCDIR)/lib -lxerces-c
testXMLGFPreprocessor: testXMLGFPreprocessor.o XMLGFPreprocessor.o Context.o \ testXMLGFPreprocessor: testXMLGFPreprocessor.o XMLGFPreprocessor.o Context.o \
Base64Transcoder.o Matrix.o Base64Transcoder.o Matrix.o
$(LD) $(DFLAGS) -o $@ $^ $(LDFLAGS) $(LD) $(DFLAGS) -o $@ $^ $(LDFLAGS)
...@@ -114,7 +117,7 @@ SampleStepper.o EnergyFunctional.o ...@@ -114,7 +117,7 @@ SampleStepper.o EnergyFunctional.o
rm -rf ti_files rm -rf ti_files
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
ctags : ctags :
ctags *.[Ch] etags -o tags *.[Ch]
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
html : html :
enscript -Ecpp --color -Whtml --toc -pqbsrc.html *.h *.C enscript -Ecpp --color -Whtml --toc -pqbsrc.html *.h *.C
......
...@@ -3,16 +3,13 @@ ...@@ -3,16 +3,13 @@
// NonLocalPotential.C // NonLocalPotential.C
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: NonLocalPotential.C,v 1.11 2004-06-01 22:45:30 fgygi Exp $ // $Id: NonLocalPotential.C,v 1.12 2004-08-11 17:56:24 fgygi Exp $
#include "NonLocalPotential.h" #include "NonLocalPotential.h"
#include "blas.h" #include "blas.h"
#if AIX #if AIX
extern "C" void vsincos(double *x, double *y, double *z, int *n); extern "C" void vsincos(double *x, double *y, double *z, int *n);
#elif OSF1
extern "C" void vcos_sin_(double *x, int *ix, double *y, int *iy,
double *z, int *iz, int *n);
#endif #endif
...@@ -934,14 +931,11 @@ void NonLocalPotential::update_eigr(vector<vector<double> >& tau) ...@@ -934,14 +931,11 @@ void NonLocalPotential::update_eigr(vector<vector<double> >& tau)
double* gx = const_cast<double*>(basis_.gx_ptr(0)); double* gx = const_cast<double*>(basis_.gx_ptr(0));
int iafirst = ctxt_.mycol() * nalocmax[is]; int iafirst = ctxt_.mycol() * nalocmax[is];
dgemm_(&cn,&cn,&ngwl,&nalocis,&k,&mone, dgemm(&cn,&cn,&ngwl,&nalocis,&k,&mone,
gx,&ngwl, &tau[is][3*iafirst],&k, &zero,&gr[0],&ngwl); gx,&ngwl, &tau[is][3*iafirst],&k, &zero,&gr[0],&ngwl);
#if AIX #if AIX
vsincos(&singr[is][0],&cosgr[is][0],&gr[0],&len); vsincos(&singr[is][0],&cosgr[is][0],&gr[0],&len);
#elif OSF1
int inc1 = 1;
vcos_sin_(&gr[0],&inc1,&cosgr[is][0],&inc1,&singr[is][0],&inc1,&len);
#else #else
for ( int i = 0; i < len; i++ ) for ( int i = 0; i < len; i++ )
{ {
......
...@@ -3,13 +3,14 @@ ...@@ -3,13 +3,14 @@
// SaveCmd.C: // SaveCmd.C:
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: SaveCmd.C,v 1.7 2004-05-20 00:18:42 fgygi Exp $ // $Id: SaveCmd.C,v 1.8 2004-08-11 17:56:24 fgygi Exp $
#include "SaveCmd.h" #include "SaveCmd.h"
#include "fstream" #include "fstream"
#include "isodate.h" #include "isodate.h"
#include "release.h" #include "release.h"
#include "qbox_xmlns.h"
#ifdef USE_CSTDIO_LFS #ifdef USE_CSTDIO_LFS
#include <cstdio> #include <cstdio>
...@@ -81,13 +82,18 @@ int SaveCmd::action(int argc, char **argv) ...@@ -81,13 +82,18 @@ int SaveCmd::action(int argc, char **argv)
if ( ui->onpe0() ) if ( ui->onpe0() )
{ {
outfile = fopen(filename,"w"); outfile = fopen(filename,"w");
char *header = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" string header("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<qbox:sample xmlns:qbox=\"http://www.llnl.gov/casc/fpmd/qbox/ns/qbox-1.0\"\n" "<qbox:sample xmlns:qbox=\"");
header += qbox_xmlns();
header += string("\"\n");
header += string(
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n" " xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n");
" xsi:schemaLocation=\"http://www.llnl.gov/casc/fpmd/qbox/ns/qbox-1.0 sample.xsd\">\n"; header += string(" xsi:schemaLocation=\"");
off_t len = strlen(header); header += qbox_xmlns();
fwrite(header,sizeof(char),len,outfile); header += string(" sample.xsd\">\n");
off_t len = header.size();
fwrite(header.c_str(),sizeof(char),len,outfile);
string desc = string("<description> Created ") + string desc = string("<description> Created ") +
isodate() +string(" by qbox-") + release() + isodate() +string(" by qbox-") + release() +
...@@ -125,10 +131,13 @@ int SaveCmd::action(int argc, char **argv) ...@@ -125,10 +131,13 @@ int SaveCmd::action(int argc, char **argv)
os os
<<"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" <<"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
<<"<qbox:sample xmlns:qbox=\"http://www.llnl.gov/casc/fpmd/qbox/ns/qbox-1.0\"\n" <<"<qbox:sample xmlns:qbox=\""
<< qbox_xmlns()
<< "\"\n"
<<" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" <<" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
<<" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n" <<" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n"
<<" xsi:schemaLocation=\"http://www.llnl.gov/casc/fpmd/qbox/ns/qbox-1.0 sample.xsd\">" <<" xsi:schemaLocation=\""
<< qbox_xmlns() << " sample.xsd\">"
<< endl; << endl;
os << "<description> Created " << isodate() << " by qbox-" << release() os << "<description> Created " << isodate() << " by qbox-" << release()
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// SlaterDet.C // SlaterDet.C
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: SlaterDet.C,v 1.26 2004-04-20 22:12:42 fgygi Exp $ // $Id: SlaterDet.C,v 1.27 2004-08-11 17:56:24 fgygi Exp $
#include "SlaterDet.h" #include "SlaterDet.h"
#include "FourierTransform.h" #include "FourierTransform.h"
...@@ -273,7 +273,7 @@ void SlaterDet::rs_mul_add(FourierTransform& ft, ...@@ -273,7 +273,7 @@ void SlaterDet::rs_mul_add(FourierTransform& ft,
int len = 4 * mloc; int len = 4 * mloc;
int inc1 = 1; int inc1 = 1;
double alpha = 1.0; double alpha = 1.0;
daxpy_(&len,&alpha,(double*)&ctmp[0],&inc1,&dcp[2*n*mloc],&inc1); daxpy(&len,&alpha,(double*)&ctmp[0],&inc1,&dcp[2*n*mloc],&inc1);
} }
if ( nstloc() % 2 != 0 ) if ( nstloc() % 2 != 0 )
{ {
...@@ -292,7 +292,7 @@ void SlaterDet::rs_mul_add(FourierTransform& ft, ...@@ -292,7 +292,7 @@ void SlaterDet::rs_mul_add(FourierTransform& ft,
int len = 2 * mloc; int len = 2 * mloc;
int inc1 = 1; int inc1 = 1;
double alpha = 1.0; double alpha = 1.0;
daxpy_(&len,&alpha,(double*)&ctmp[0],&inc1,&dcp[2*n*mloc],&inc1); daxpy(&len,&alpha,(double*)&ctmp[0],&inc1,&dcp[2*n*mloc],&inc1);
} }
} }
else else
...@@ -307,7 +307,7 @@ void SlaterDet::rs_mul_add(FourierTransform& ft, ...@@ -307,7 +307,7 @@ void SlaterDet::rs_mul_add(FourierTransform& ft,
int len = 2 * mloc; int len = 2 * mloc;
int inc1 = 1; int inc1 = 1;
double alpha = 1.0; double alpha = 1.0;
daxpy_(&len,&alpha,(double*)&ctmp[0],&inc1,&dcp[2*n*mloc],&inc1); daxpy(&len,&alpha,(double*)&ctmp[0],&inc1,&dcp[2*n*mloc],&inc1);
} }
} }
...@@ -767,7 +767,7 @@ double SlaterDet::dot(const SlaterDet& sd) const ...@@ -767,7 +767,7 @@ double SlaterDet::dot(const SlaterDet& sd) const
int len = c_proxy.nloc(); int len = c_proxy.nloc();
// stride of scalar product is mloc // stride of scalar product is mloc
int stride = c_proxy.mloc(); int stride = c_proxy.mloc();
sum = ddot_(&len,c,&stride,sdc,&stride); sum = ddot(&len,c,&stride,sdc,&stride);
} }
ctxt_.dsum(1,1,&sum,1); ctxt_.dsum(1,1,&sum,1);
return d - sum; return d - sum;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// XCPotential.C // XCPotential.C
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: XCPotential.C,v 1.3 2004-02-04 19:55:17 fgygi Exp $ // $Id: XCPotential.C,v 1.4 2004-08-11 17:56:24 fgygi Exp $
#include "XCPotential.h" #include "XCPotential.h"
#include "Basis.h" #include "Basis.h"
...@@ -164,7 +164,7 @@ void XCPotential::update(vector<vector<double> >& vr, bool compute_stress, ...@@ -164,7 +164,7 @@ void XCPotential::update(vector<vector<double> >& vr, bool compute_stress,
vft_.backward(&tmp1[0],&tmpr[0]); vft_.backward(&tmp1[0],&tmpr[0]);
int inc2=2, inc1=1; int inc2=2, inc1=1;
double *grj = xcf_->grad_rho[j]; double *grj = xcf_->grad_rho[j];
dcopy_(&np012loc_,(double*)&tmpr[0],&inc2,grj,&inc1); dcopy(&np012loc_,(double*)&tmpr[0],&inc2,grj,&inc1);
} }
} }
else else
...@@ -188,8 +188,8 @@ void XCPotential::update(vector<vector<double> >& vr, bool compute_stress, ...@@ -188,8 +188,8 @@ void XCPotential::update(vector<vector<double> >& vr, bool compute_stress,
double *grj_dn = xcf_->grad_rho_dn[j]; double *grj_dn = xcf_->grad_rho_dn[j];
int inc2=2, inc1=1; int inc2=2, inc1=1;
double* p = (double*) &tmpr[0]; double* p = (double*) &tmpr[0];
dcopy_(&np012loc_,p, &inc2,grj_up,&inc1); dcopy(&np012loc_,p, &inc2,grj_up,&inc1);
dcopy_(&np012loc_,p+1,&inc2,grj_dn,&inc1); dcopy(&np012loc_,p+1,&inc2,grj_dn,&inc1);
} // j } // j
} }
...@@ -224,11 +224,11 @@ void XCPotential::update(vector<vector<double> >& vr, bool compute_stress, ...@@ -224,11 +224,11 @@ void XCPotential::update(vector<vector<double> >& vr, bool compute_stress,
int inc1 = 1, inc2 = 2; int inc1 = 1, inc2 = 2;
if ( j == 0 ) if ( j == 0 )
{ {
dcopy_(&np012loc_,(double*)&tmpr[0],&inc2,&vxctmp[0][0],&inc1); dcopy(&np012loc_,(double*)&tmpr[0],&inc2,&vxctmp[0][0],&inc1);
} }
else else
{ {
daxpy_(&np012loc_,&one,(double*)&tmpr[0],&inc2,&vxctmp[0][0],&inc1); daxpy(&np012loc_,&one,(double*)&tmpr[0],&inc2,&vxctmp[0][0],&inc1);
} }
} }
} }
...@@ -265,13 +265,13 @@ void XCPotential::update(vector<vector<double> >& vr, bool compute_stress, ...@@ -265,13 +265,13 @@ void XCPotential::update(vector<vector<double> >& vr, bool compute_stress,
double* p = (double*) &tmpr[0]; double* p = (double*) &tmpr[0];
if ( j == 0 ) if ( j == 0 )
{ {
dcopy_(&np012loc_,p ,&inc2,&vxctmp[0][0],&inc1); dcopy(&np012loc_,p ,&inc2,&vxctmp[0][0],&inc1);
dcopy_(&np012loc_,p+1,&inc2,&vxctmp[1][0],&inc1); dcopy(&np012loc_,p+1,&inc2,&vxctmp[1][0],&inc1);
} }
else else
{ {
daxpy_(&np012loc_,&one,p ,&inc2,&vxctmp[0][0],&inc1); daxpy(&np012loc_,&one,p ,&inc2,&vxctmp[0][0],&inc1);
daxpy_(&np012loc_,&one,p+1,&inc2,&vxctmp[1][0],&inc1); daxpy(&np012loc_,&one,p+1,&inc2,&vxctmp[1][0],&inc1);
} }
} // j } // j
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// BLAS Header file // BLAS Header file
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: blas.h,v 1.2 2003-11-27 01:16:34 fgygi Exp $ // $Id: blas.h,v 1.3 2004-08-11 17:56:24 fgygi Exp $
#ifndef BLAS_H #ifndef BLAS_H
#define BLAS_H #define BLAS_H
...@@ -14,108 +14,73 @@ using namespace std; ...@@ -14,108 +14,73 @@ using namespace std;
// default value for most compilers // default value for most compilers
#define FTN_LINK extern "C" #define FTN_LINK extern "C"
#ifdef LINUX #ifdef ADD_
#define FTN_LINK extern "C" #define dcopy dcopy_
#endif #define zcopy zcopy_
#define daxpy daxpy_
#ifdef SUNOS #define ddot ddot_
#define FTN_LINK extern "C" #define drot drot_
#endif #define dasum dasum_
#define dsbmv dsbmv_
#ifdef OSF1 #define dgemm dgemm_
#define FTN_LINK extern "C" #define dgesv dgesv_
#endif #define dgemv dgemv_
#define dscal dscal_
#ifdef HPUX #define dsyev dsyev_
#define FTN_LINK extern "C" #define zdscal zdscal_
#define dcopy_ dcopy #define idamax idamax_
#define zcopy_ zcopy #define dvea dvea_
#define daxpy_ daxpy #define dyax dyax_
#define ddot_ ddot #define dnaxpy dnaxpy_
#define dasum_ dasum #define dger dger_
#define dsbmv_ dsbmv
#define dgemm_ dgemm
#define dgemv_ dgemv
#define dgesv_ dgesv
#define dscal_ dscal
#define dsyev_ dsyev
#define zdscal_ zdscal
#define idamax_ idamax
#endif
#ifdef AIX
//#define FTN_LINK extern "FORTRAN"
#define FTN_LINK extern "C"
#define dcopy_ dcopy
#define zcopy_ zcopy
#define daxpy_ daxpy
#define ddot_ ddot
#define drot_ drot
#define dasum_ dasum
#define dsbmv_ dsbmv
#define dgemm_ dgemm
#define dgesv_ dgesv
#define dgemv_ dgemv
#define dscal_ dscal
#define dsyev_ dsyev
#define zdscal_ zdscal
#define idamax_ idamax
#define dvea_ dvea
#define dyax_ dyax
#define dnaxpy_ dnaxpy
#define dger_ dger
#endif
#ifndef FTN_LINK
#error "blas.h: undefined platform"
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
FTN_LINK { FTN_LINK {
#endif #endif
void dcopy_(int *n, double *x, int *incx, void dcopy(int *n, double *x, int *incx,
double *y, int *incy ); double *y, int *incy );
void zcopy_(int *n, complex<double> *x, int *incx, void zcopy(int *n, complex<double> *x, int *incx,
complex<double> *y, int *incy ); complex<double> *y, int *incy );
void daxpy_(int *n, double *alpha, double *x, int *incx, void daxpy(int *n, double *alpha, double *x, int *incx,
double *y, int *incy ); double *y, int *incy );
double ddot_(const int *n, const double *a, const int *inca, double ddot(const int *n, const double *a, const int *inca,
const double *b, const int *incb); const double *b, const int *incb);
void drot_(int*, double*, int*, double*, int*, double*, double*); void drot(int*, double*, int*, double*, int*, double*, double*);
void dgemm_(char *ta, char *tb, int *m, int *n, int *k, void dgemm(char *ta, char *tb, int *m, int *n, int *k,
double *alpha, double *a, int *lda, double *b, int *ldb, double *alpha, double *a, int *lda, double *b, int *ldb,
double *beta, double *c, int *ldc); double *beta, double *c, int *ldc);
void dgemv_( char *ta, int *m, int *n, void dgemv( char *ta, int *m, int *n,
double *alpha, double *a, int *tda, double *alpha, double *a, int *tda,
double *x, int *incx, double *x, int *incx,
double *beta, double *y, int *incy ); double *beta, double *y, int *incy );
void dger_(int *,int *, double *, double *, int *, void dger(int *,int *, double *, double *, int *,
double *, int *, double *, int *); double *, int *, double *, int *);
void dscal_(int *len, double *alpha, double *x, int *incx); void dscal(int *len, double *alpha, double *x, int *incx);
double dasum_(int *len, double *x, int *incx); double dasum(int *len, double *x, int *incx);
int idamax_(int *len, double *x, int *incx); int idamax(int *len, double *x, int *incx);
void dsyev_(char *c1,char *c2,int *n, void dsyev(char *c1,char *c2,int *n,
double *a,int *lda, double *wr, double *a,int *lda, double *wr,
double *wrk,int *lwrk, int *ierr); double *wrk,int *lwrk, int *ierr);
void zdscal_(int *n,double *alpha,complex<double> *x,int *incx); void zdscal_(int *n,double *alpha,complex<double> *x,int *incx);
void dgbmv_(char *trans, int *m, int *n, void dgbmv(char *trans, int *m, int *n,
int *kl, int *ku, double *alpha, double *a, int *kl, int *ku, double *alpha, double *a,
int *lda, double *x, int *incx, double *beta, int *lda, double *x, int *incx, double *beta,
double *y, int *incy); double *y, int *incy);
void dsbmv_(char *uplo, int *n, int *k, void dsbmv(char *uplo, int *n, int *k,
double *alpha, double *a, int *lda, double *x, int *incx, double *alpha, double *a, int *lda, double *x, int *incx,
double *beta, double *y, int *incy); double *beta, double *y, int *incy);
void sspev_(char *vec,char *uplo,int *size,double *ap, void sspev(char *vec,char *uplo,int *size,double *ap,
double *wr,double *z,int *n,double *wrk,int *ierr); double *wr,double *z,int *n,double *wrk,int *ierr);
void dgesv_(int *n, int *nrhs, double *a, int *lda, int *ipiv, void dgesv(int *n, int *nrhs, double *a, int *lda, int *ipiv,
double *b, int *ldb, int *info); double *b, int *ldb, int *info);
void dvea_(int*,double*,int*,double*,int*,double*,int*); void dvea(int*,double*,int*,double*,int*,double*,int*);
void dyax_(int*,double*,double*,int*,double*,int*); void dyax(int*,double*,double*,int*,double*,int*);
void dnaxpy_(int*,int*,double*,int*,double*,int*,int*,double*,int*,int*); void dnaxpy(int*,int*,double*,int*,double*,int*,int*,double*,int*,int*);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -3,13 +3,14 @@ ...@@ -3,13 +3,14 @@
# mcr.mk # mcr.mk
# #
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# $Id: mcr.mk,v 1.7 2004-06-02 21:40:40 fgygi Exp $ # $Id: mcr.mk,v 1.8 2004-08-11 17:56:24 fgygi Exp $
# #
PLT=LINUX PLT=LINUX
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
GCCDIR=/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66 GCCDIR=/usr/lib/gcc-lib/i386-redhat-linux/3.2.3
MPIDIR=/usr/lib/mpi MPIDIR=/usr/lib/mpi
XERCESCDIR=$(HOME)/software/xml/icc-7.0/xerces-c-src2_2_0 XERCESCDIR=$(HOME)/software/xml/xerces-c-src2_2_0