Commit b802e34b by Francois Gygi

Merge branch 'develop'

parents 3f48d3c0 5780a4f7
......@@ -1149,7 +1149,7 @@ void BOSampleStepper::step(int niter)
ostr << " <total_spread> ";
for ( int j = 0; j < 3; j++ )
ostr << setw(10) << total_spread[j];
ostr << setprecision(6) << setw(15) << total_spread[j];
ostr << " </total_spread>" << endl;
D3vector edipole = mlwft[isp_loc]->dipole();
ostr << " <electronic_dipole spin=\"" << ispin
......@@ -1174,13 +1174,13 @@ void BOSampleStepper::step(int niter)
if ( onpe0 )
{
D3vector idipole = atoms.dipole();
cout << setprecision(6);
cout << " <ionic_dipole> " << idipole
<< " </ionic_dipole>" << endl;
cout << " <total_dipole> " << idipole + edipole_sum
<< " </total_dipole>" << endl;
cout << " <total_dipole_length> " << length(idipole + edipole_sum)
<< " </total_dipole_length>" << endl;
cout << "</mlwfs>" << endl;
}
tmap["mlwf"].stop();
}
......
......@@ -95,7 +95,7 @@ int ComputeMLWFCmd::action(int argc, char **argv)
ostr << " <total_spread> ";
for ( int j = 0; j < 3; j++ )
ostr << setw(10) << total_spread[j];
ostr << setprecision(6) << setw(15) << total_spread[j];
ostr << " </total_spread>" << endl;
D3vector edipole = mlwft->dipole();
ostr << " <electronic_dipole spin=\"" << ispin
......@@ -108,17 +108,27 @@ int ComputeMLWFCmd::action(int argc, char **argv)
cout0(ostr.str(),isrc);
MPI_Barrier(MPIdata::comm());
} // ispin
if ( onpe0 )
cout << "</mlwfs>" << endl;
if ( MPIdata::sd_rank() == 0 )
{
D3vector d3tsum;
MPI_Reduce(&edipole_sum[0],&d3tsum[0],3,
MPI_DOUBLE,MPI_SUM,0,MPIdata::sp_comm());
edipole_sum = d3tsum;
}
if ( onpe0 )
{
D3vector idipole = s->atoms.dipole();
cout << setprecision(6);
cout << " <ionic_dipole> " << idipole
<< " </ionic_dipole>" << endl;
cout << " <total_dipole> " << idipole + edipole_sum
<< " </total_dipole>" << endl;
cout << " <total_dipole_length> " << length(idipole + edipole_sum)
<< " </total_dipole_length>" << endl;
cout << "</mlwfs>" << endl;
}
return 0;
}
......@@ -997,7 +997,6 @@ double ExchangeOperator::compute_exchange_at_gamma_(const Wavefunction &wf,
const double *const g_y = vbasis_->gx_ptr(1);
const double *const g_z = vbasis_->gx_ptr(2);
ostringstream ostr;
for ( int isp_loc = 0; isp_loc < wfc_.nsp_loc(); ++isp_loc )
{
const int ispin = wf.isp_global(isp_loc);
......@@ -1060,30 +1059,6 @@ double ExchangeOperator::compute_exchange_at_gamma_(const Wavefunction &wf,
// copy of localization vector from Bisection object
localization_ = bisection_[isp_loc]->localization();
#if TIMING
Timer tmbsize, tmbpair;
tmbsize.start();
#endif
if ( MPIdata::sd_rank() == 0 )
{
ostr << setprecision(10);
ostr << " ExchangeOperator: bisection size: ispin=" << ispin
<< ": " << bisection_[isp_loc]->total_size() << endl;
}
#if TIMING
tmbsize.stop();
tmbpair.start();
#endif
if ( MPIdata::sd_rank() == 0 )
{
ostr << setprecision(10);
ostr << " ExchangeOperator: pair fraction: ispin=" << ispin
<< ": " << bisection_[isp_loc]->pair_fraction() << endl;
}
#if TIMING
tmbpair.stop();
#endif
// copy the orthogonal transformation u to uc_[isp_loc]
*uc_[isp_loc] = bisection_[isp_loc]->u();
......@@ -1360,24 +1335,6 @@ double ExchangeOperator::compute_exchange_at_gamma_(const Wavefunction &wf,
#endif
tmb.stop();
if ( MPIdata::sd_rank() == 0 )
{
#if TIMING
cout << setprecision(3);
cout << " ExchangeOperator: bisection compute transform time: "
<< tmbtransf.real() << " s" << endl;
cout << setprecision(3);
cout << " ExchangeOperator: bisection compute localization time: "
<< tmbcomploc.real() << " s" << endl;
cout << setprecision(3);
cout << " ExchangeOperator: bisection forward time: "
<< tmbfwd.real() << " s" << endl;
#endif
ostr << setprecision(3);
ostr << " ExchangeOperator: bisection time: "
<< tmb.real() << " s" << endl;
ostr << setprecision(10);
}
} // if use_bisection_
tm.start();
......@@ -2248,12 +2205,46 @@ double ExchangeOperator::compute_exchange_at_gamma_(const Wavefunction &wf,
} // for isp_loc
for ( int ispin = 0; ispin < wfc_.nspin(); ++ispin )
if ( use_bisection_ )
{
int isrc = -1;
if ( MPIdata::sd_rank() == 0 )
isrc = MPIdata::rank();
cout0(ostr.str(),isrc);
ostringstream ostr;
for ( int ispin = 0; ispin < wfc_.nspin(); ++ispin )
{
int isp_loc = wfc_.isp_local(ispin);
int isrc = -1;
if ( isp_loc >= 0 )
{
if ( MPIdata::sd_rank() == 0 )
{
ostr.str("");
isrc = MPIdata::rank();
ostr << setprecision(10);
ostr << " ExchangeOperator: bisection size: ispin=" << ispin
<< ": " << bisection_[isp_loc]->total_size() << endl;
ostr << " ExchangeOperator: pair fraction: ispin=" << ispin
<< ": " << bisection_[isp_loc]->pair_fraction() << endl;
}
}
cout0(ostr.str(),isrc);
MPI_Barrier(MPIdata::comm());
}
if ( MPIdata::onpe0() )
{
cout << setprecision(3);
cout << " ExchangeOperator: bisection time: "
<< tmb.real() << " s" << endl;
#if TIMING
cout << setprecision(3);
cout << " ExchangeOperator: bisection compute transform time: "
<< tmbtransf.real() << " s" << endl;
cout << setprecision(3);
cout << " ExchangeOperator: bisection compute localization time: "
<< tmbcomploc.real() << " s" << endl;
cout << setprecision(3);
cout << " ExchangeOperator: bisection forward time: "
<< tmbfwd.real() << " s" << endl;
#endif
}
}
// sum contributions to the exchange energy
......
......@@ -19,5 +19,5 @@
#include "release.h"
std::string release(void)
{
return std::string("rel1_72_2");
return std::string("rel1_72_2dev");
}
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