Commit d9460541 by Francois Gygi

fixed processing of current_size

git-svn-id: http://qboxcode.org/svn/qb/trunk@1173 cba15fb0-1239-40c8-b417-11db7ca47a34
parent b727b5f6
......@@ -76,6 +76,7 @@ void SampleReader::readSample (Sample& s, const string uri, bool serial)
int nspin = 1;
int current_ispin = 0;
int current_ikp;
int current_size;
dmat.resize(nspin);
MemBufInputSource* memBufIS = 0;
......@@ -386,13 +387,18 @@ void SampleReader::readSample (Sample& s, const string uri, bool serial)
{
// process SlaterDet
// receive kpoint and weight
double buf[6];
ctxt_.dbcast_recv(6,1,buf,6,0,0);
double buf[7];
ctxt_.dbcast_recv(7,1,buf,7,0,0);
current_ispin=(int) buf[4];
current_ikp=(int) buf[5];
current_size=(int) buf[6];
if ( current_ispin == 0 )
current_wf->add_kpoint(D3vector(buf[0],buf[1],buf[2]),buf[3]);
// resize sd(current_ispin,current_ikp)->nst() == current_size
current_wf->sd(current_ispin,current_ikp)->resize(current_wf->cell(),
current_wf->refcell(), current_wf->ecut(), current_size);
// receive density_matrix
vector<double> dmat_tmp(current_wf->nst());
s.wf.context().dbcast_recv(s.wf.nst(),1,&dmat_tmp[0],s.wf.nst(),0,0);
......
......@@ -325,17 +325,21 @@ void WavefunctionHandler::startElement(const XMLCh* const uri,
wf_.context().ibcast_send(1,1,(int*)&event,1);
// send kpoint and weight to listening nodes
double buf[6];
double buf[7];
buf[0] = current_kx; buf[1] = current_ky; buf[2] = current_kz;
buf[3] = current_weight;
buf[4] = current_ispin;
buf[5] = current_ikp;
wf_.context().dbcast_send(6,1,buf,6);
buf[6] = current_size;
wf_.context().dbcast_send(7,1,buf,7);
// add kpoint only if spin is up (if spin is down,
// the kpoint should be defined already)
if ( current_ispin == 0 )
wf_.add_kpoint(D3vector(current_kx,current_ky,current_kz),current_weight);
assert(current_size==wf_.sd(current_ispin,current_ikp)->nst());
// resize sd(current_ispin,current_ikp)->nst() == current_size
wf_.sd(current_ispin,current_ikp)->resize(wf_.cell(),
wf_.refcell(), wf_.ecut(), current_size);
const Basis& basis = wf_.sd(current_ispin,current_ikp)->basis();
ft = new FourierTransform(basis,nx_,ny_,nz_);
......
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