mirror of https://github.com/QMCPACK/qmcpack.git
Merge branch 'develop' into test_density
This commit is contained in:
commit
8097003ae7
|
@ -2,7 +2,11 @@
|
|||
# Usage: ctest -s script,build
|
||||
# build = debug / optimized / valgrind / coverage
|
||||
# Note: this test will use use the number of processors defined in the variable N_PROCS,
|
||||
# the enviornmental variable N_PROCS, or the number of processors availible (if not specified)
|
||||
# the enviornmental variables
|
||||
# N_PROCS, or the number of processors availible (if not specified)
|
||||
# N_PROCS_BUILD, or N_PROCS (if not specified)
|
||||
# N_CONCURRENT_TESTS, or N_PROCS (if not specified)
|
||||
# TEST_SITE_NAME, or HOSTNAME (if not specified)
|
||||
|
||||
# Set platform specific variables
|
||||
SITE_NAME( HOSTNAME )
|
||||
|
@ -54,12 +58,6 @@ ELSEIF( ${HOSTNAME} MATCHES "titan" )
|
|||
SET( CTEST_CMAKE_GENERATOR "Unix Makefiles")
|
||||
SET( CTEST_SITE "titan.ccs.ornl.gov" )
|
||||
SET( N_PROCS_BUILD 8 )
|
||||
ELSEIF( ${HOSTNAME} MATCHES "cetus" )
|
||||
# Setup for cetus.alcf.anl.gov BlueGene/Q
|
||||
SET( CTEST_CMAKE_GENERATOR "Unix Makefiles")
|
||||
SET( CTEST_SITE "cetus.alcf.anl.gov" )
|
||||
SET( N_PROCS 24)
|
||||
SET( TEST_PARALLEL_LEVEL 1 )
|
||||
ELSEIF( ${HOSTNAME} MATCHES "billmp1" )
|
||||
# Setup for billmp1.ornl.gov Mac
|
||||
SET( CC /opt/mpich/install/mpich-3.2/bin/mpicc )
|
||||
|
@ -76,12 +74,6 @@ ELSEIF( ${HOSTNAME} MATCHES "billmp1" )
|
|||
ELSE()
|
||||
SET( CTEST_BUILD_NAME Clang-Release-Mac )
|
||||
ENDIF()
|
||||
ELSEIF( ${HOSTNAME} MATCHES "ryzen-box" )
|
||||
SET( CC mpicc )
|
||||
SET( CXX mpicxx )
|
||||
SET( CTEST_CMAKE_GENERATOR "Unix Makefiles")
|
||||
SET( QMC_OPTIONS "${QMC_OPTIONS};-DCMAKE_PREFIX_PATH=/opt/OpenBLAS" )
|
||||
SET( N_PROCS 16)
|
||||
ELSE()
|
||||
MESSAGE( MESSAGE "Unknown host: ${HOSTNAME}. Using generic setting." )
|
||||
SET( CTEST_CMAKE_GENERATOR "Unix Makefiles")
|
||||
|
@ -159,12 +151,12 @@ IF( NOT DEFINED N_PROCS )
|
|||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
MESSAGE("Testing with ${N_PROCS} processors")
|
||||
|
||||
# Set the number of processors
|
||||
IF( NOT DEFINED N_PROCS_BUILD )
|
||||
IF ( DEFINED $ENV{N_PROCS_BUILD} )
|
||||
SET( N_PROCS_BUILD $ENV{N_PROCS_BUILD} )
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Set basic variables
|
||||
SET( CTEST_PROJECT_NAME "QMCPACK" )
|
||||
|
@ -183,13 +175,12 @@ IF ( BUILD_SERIAL )
|
|||
SET( CTEST_BUILD_COMMAND "${MAKE_CMD} -i" )
|
||||
ELSEIF ( DEFINED N_PROCS_BUILD )
|
||||
SET( CTEST_BUILD_COMMAND "${MAKE_CMD} -i -j ${N_PROCS_BUILD}" )
|
||||
MESSAGE("Building with ${N_PROCS_BUILD} processors")
|
||||
ELSE()
|
||||
SET( CTEST_BUILD_COMMAND "${MAKE_CMD} -i -j ${N_PROCS}" )
|
||||
MESSAGE("Building with ${N_PROCS} processors")
|
||||
ENDIF()
|
||||
|
||||
MESSAGE("Building with ${N_PROCS_BUILD} processors")
|
||||
MESSAGE("Testing with ${N_PROCS} processors")
|
||||
|
||||
# Set valgrind options
|
||||
SET( VALGRIND_COMMAND_OPTIONS "--tool=memcheck --leak-check=yes --track-fds=yes --num-callers=50 --show-reachable=yes --suppressions=${QMC_SOURCE_DIR}/src/ValgrindSuppresionFile" )
|
||||
IF ( USE_VALGRIND )
|
||||
|
@ -272,11 +263,14 @@ ENDIF()
|
|||
MESSAGE("Configure options:")
|
||||
MESSAGE(" ${CTEST_OPTIONS}")
|
||||
|
||||
|
||||
# Configure and run the tests
|
||||
IF ( NOT DEFINED CTEST_SITE )
|
||||
SET( CTEST_SITE $ENV{TEST_SITE_NAME} )
|
||||
ENDIF()
|
||||
IF ( NOT DEFINED CTEST_SITE )
|
||||
SET( CTEST_SITE ${HOSTNAME} )
|
||||
ENDIF()
|
||||
|
||||
# Configure and run the tests
|
||||
CTEST_START("${CTEST_DASHBOARD}")
|
||||
CTEST_UPDATE()
|
||||
CTEST_CONFIGURE(
|
||||
|
@ -294,7 +288,7 @@ ELSEIF (CTEST_COVERAGE_COMMAND)
|
|||
# Skip the normal tests when doing coverage
|
||||
ELSE()
|
||||
# CTEST_TEST( INCLUDE short PARALLEL_LEVEL ${N_PROCS} )
|
||||
IF( DEFINED TEST_PARALLEL_LEVEL )
|
||||
IF( DEFINED ENV{N_CONCURRENT_TESTS} )
|
||||
CTEST_TEST( PARALLEL_LEVEL ${TEST_PARALLEL_LEVEL} )
|
||||
ELSE()
|
||||
CTEST_TEST( PARALLEL_LEVEL ${N_PROCS} )
|
||||
|
|
|
@ -61,6 +61,7 @@ public:
|
|||
EwaldHandler(ParticleSet& ref, mRealType kc_in=-1.0)
|
||||
: LRHandlerBase(kc_in)
|
||||
{
|
||||
LRHandlerBase::ClassName="EwaldHandler";
|
||||
Sigma=LR_kc=ref.Lattice.LR_kc;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ public:
|
|||
EwaldHandler3D(ParticleSet& ref, mRealType kc_in=-1.0)
|
||||
: LRHandlerBase(kc_in)
|
||||
{
|
||||
LRHandlerBase::ClassName="EwaldHandler3D";
|
||||
Sigma=LR_kc=ref.Lattice.LR_kc;
|
||||
}
|
||||
|
||||
|
@ -105,6 +106,16 @@ public:
|
|||
{
|
||||
return -2.0*Sigma*std::exp(-Sigma*Sigma*r*r)/(std::sqrt(M_PI)*r) - erfc(Sigma*r)*rinv*rinv;
|
||||
}
|
||||
/** evaluate the first derivative of the long range part (in real space) at r
|
||||
*
|
||||
* @param r radius
|
||||
*/
|
||||
inline mRealType lrDf(mRealType r)
|
||||
{
|
||||
mRealType rinv=1.0/r;
|
||||
return 2.0*Sigma*std::exp(-Sigma*Sigma*r*r)/(std::sqrt(M_PI)*r) - erf(Sigma*r)*rinv*rinv;
|
||||
}
|
||||
|
||||
|
||||
void fillFk(KContainer& KList);
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ struct LRHandlerBase
|
|||
|
||||
|
||||
//constructor
|
||||
explicit LRHandlerBase(mRealType kc):LR_kc(kc) {}
|
||||
explicit LRHandlerBase(mRealType kc):LR_kc(kc),ClassName("LRHandlerBase") {}
|
||||
|
||||
// virtual destructor
|
||||
virtual ~LRHandlerBase() {}
|
||||
|
@ -256,9 +256,18 @@ struct LRHandlerBase
|
|||
virtual mRealType evaluateLR(mRealType r)=0;
|
||||
virtual mRealType srDf(mRealType r, mRealType rinv)=0;
|
||||
|
||||
virtual mRealType lrDf(mRealType r)
|
||||
{
|
||||
APP_ABORT("Error: lrDf(r) is not implemented in "+ClassName+"\n");
|
||||
return 0.0;
|
||||
};
|
||||
|
||||
/** make clone */
|
||||
virtual LRHandlerBase* makeClone(ParticleSet& ref)=0;
|
||||
|
||||
protected:
|
||||
std::string ClassName;
|
||||
|
||||
};
|
||||
|
||||
/** LRHandler without breakup.
|
||||
|
|
|
@ -76,6 +76,7 @@ public:
|
|||
rV_force(0), rV_energy(0), drV_force(0), rV_stress(0), drV_stress(0)
|
||||
|
||||
{
|
||||
LRHandlerBase::ClassName="LRHandlerSRCoulomb";
|
||||
myFunc.reset(ref);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,10 +54,12 @@ public:
|
|||
BreakupBasisType Basis; //This needs a Lattice for the constructor...
|
||||
Func myFunc;
|
||||
|
||||
|
||||
//Constructor
|
||||
LRHandlerTemp(ParticleSet& ref, mRealType kc_in=-1.0):
|
||||
LRHandlerBase(kc_in),FirstTime(true), Basis(ref.LRBox)
|
||||
{
|
||||
LRHandlerBase::ClassName="LRHandlerTemp";
|
||||
myFunc.reset(ref);
|
||||
}
|
||||
|
||||
|
@ -144,6 +146,22 @@ public:
|
|||
v += coefs[n]*Basis.h(n,r);
|
||||
return v;
|
||||
}
|
||||
/** evaluate the contribution from the long-range part for for spline
|
||||
*/
|
||||
inline mRealType lrDf(mRealType r)
|
||||
{
|
||||
mRealType dv=0.0;
|
||||
if(r<LR_rc)
|
||||
{
|
||||
for(int n=0; n<coefs.size(); n++)
|
||||
dv += coefs[n]*Basis.df(n,r);
|
||||
}
|
||||
else
|
||||
dv=myFunc.df(r);
|
||||
|
||||
return dv;
|
||||
}
|
||||
|
||||
|
||||
inline mRealType evaluateSR_k0()
|
||||
{
|
||||
|
@ -260,6 +278,7 @@ private:
|
|||
// Fk[ki] = evalFk(k); //Call derived fn.
|
||||
//}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -56,6 +56,7 @@ struct LRRPABFeeHandlerTemp: public LRHandlerBase
|
|||
LRRPABFeeHandlerTemp(ParticleSet& ref, mRealType kc_in=-1.0):
|
||||
LRHandlerBase(kc_in),FirstTime(true), Basis(ref.Lattice)
|
||||
{
|
||||
LRHandlerBase::ClassName="LRRPAFeeHandlerTemp";
|
||||
myFunc.reset(ref);
|
||||
}
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@ struct LRRPAHandlerTemp: public LRHandlerBase
|
|||
LRRPAHandlerTemp(ParticleSet& ref, mRealType kc_in=-1.0):
|
||||
LRHandlerBase(kc_in),FirstTime(true), Basis(ref.Lattice)
|
||||
{
|
||||
LRHandlerBase::ClassName="LRRPAHandlerTemp";
|
||||
myFunc.reset(ref);
|
||||
}
|
||||
|
||||
|
@ -135,7 +136,6 @@ struct LRRPAHandlerTemp: public LRHandlerBase
|
|||
return df;
|
||||
}
|
||||
|
||||
|
||||
/** evaluate the contribution from the long-range part for for spline
|
||||
*/
|
||||
inline mRealType evaluateLR(mRealType r)
|
||||
|
|
|
@ -77,8 +77,8 @@ class JeeIOrbitalSoA: public WaveFunctionComponent
|
|||
Array<std::vector<int>,2> elecs_inside;
|
||||
Array<std::vector<valT>,2> elecs_inside_dist;
|
||||
Array<std::vector<posT>,2> elecs_inside_displ;
|
||||
/// the ions around
|
||||
std::vector<int> ions_nearby;
|
||||
/// the ids of ions within the cutoff radius of an electron on which a move is proposed
|
||||
std::vector<int> ions_nearby_old, ions_nearby_new;
|
||||
|
||||
/// work buffer size
|
||||
size_t Nbuffer;
|
||||
|
@ -174,7 +174,8 @@ public:
|
|||
elecs_inside.resize(eGroups,Nion);
|
||||
elecs_inside_dist.resize(eGroups,Nion);
|
||||
elecs_inside_displ.resize(eGroups,Nion);
|
||||
ions_nearby.resize(Nion);
|
||||
ions_nearby_old.resize(Nion);
|
||||
ions_nearby_new.resize(Nion);
|
||||
Ion_cutoff.resize(Nion, 0.0);
|
||||
|
||||
//initialize buffers
|
||||
|
@ -416,7 +417,7 @@ public:
|
|||
|
||||
const DistanceTableData& eI_table=(*P.DistTables[myTableID]);
|
||||
const DistanceTableData& ee_table=(*P.DistTables[0]);
|
||||
cur_Uat=computeU(P, iat, P.GroupID[iat], eI_table.Temp_r.data(), ee_table.Temp_r.data());
|
||||
cur_Uat=computeU(P, iat, P.GroupID[iat], eI_table.Temp_r.data(), ee_table.Temp_r.data(), ions_nearby_new);
|
||||
DiffVal=Uat[iat]-cur_Uat;
|
||||
return std::exp(DiffVal);
|
||||
}
|
||||
|
@ -427,7 +428,7 @@ public:
|
|||
ratios[k]=std::exp(Uat[VP.refPtcl] -
|
||||
computeU(VP.refPS, VP.refPtcl, VP.refPS.GroupID[VP.refPtcl],
|
||||
VP.DistTables[myTableID]->Distances[k],
|
||||
VP.DistTables[0]->Distances[k]));
|
||||
VP.DistTables[0]->Distances[k], ions_nearby_old));
|
||||
}
|
||||
|
||||
void evaluateRatiosAlltoOne(ParticleSet& P, std::vector<ValueType>& ratios)
|
||||
|
@ -438,7 +439,7 @@ public:
|
|||
|
||||
for(int jg=0; jg<eGroups; ++jg)
|
||||
{
|
||||
const valT sumU=computeU(P, -1, jg, eI_table.Temp_r.data(), ee_table.Temp_r.data());
|
||||
const valT sumU=computeU(P, -1, jg, eI_table.Temp_r.data(), ee_table.Temp_r.data(), ions_nearby_new);
|
||||
|
||||
for(int j=P.first(jg); j<P.last(jg); ++j)
|
||||
{
|
||||
|
@ -471,7 +472,7 @@ public:
|
|||
const DistanceTableData& eI_table=(*P.DistTables[myTableID]);
|
||||
const DistanceTableData& ee_table=(*P.DistTables[0]);
|
||||
computeU3(P, iat, eI_table.Temp_r.data(), eI_table.Temp_dr, ee_table.Temp_r.data(), ee_table.Temp_dr,
|
||||
cur_Uat, cur_dUat, cur_d2Uat, newUk, newdUk, newd2Uk);
|
||||
cur_Uat, cur_dUat, cur_d2Uat, newUk, newdUk, newd2Uk, ions_nearby_new);
|
||||
DiffVal=Uat[iat]-cur_Uat;
|
||||
grad_iat+=cur_dUat;
|
||||
return std::exp(DiffVal);
|
||||
|
@ -485,11 +486,11 @@ public:
|
|||
const DistanceTableData& ee_table=(*P.DistTables[0]);
|
||||
// get the old value, grad, lapl
|
||||
computeU3(P, iat, eI_table.Distances[iat], eI_table.Displacements[iat], ee_table.Distances[iat], ee_table.Displacements[iat],
|
||||
Uat[iat], dUat_temp, d2Uat[iat], oldUk, olddUk, oldd2Uk);
|
||||
Uat[iat], dUat_temp, d2Uat[iat], oldUk, olddUk, oldd2Uk, ions_nearby_old);
|
||||
if(UpdateMode == ORB_PBYP_RATIO)
|
||||
{//ratio-only during the move; need to compute derivatives
|
||||
computeU3(P, iat, eI_table.Temp_r.data(), eI_table.Temp_dr, ee_table.Temp_r.data(), ee_table.Temp_dr,
|
||||
cur_Uat, cur_dUat, cur_d2Uat, newUk, newdUk, newd2Uk);
|
||||
cur_Uat, cur_dUat, cur_d2Uat, newUk, newdUk, newd2Uk, ions_nearby_new);
|
||||
}
|
||||
|
||||
#pragma omp simd
|
||||
|
@ -515,29 +516,20 @@ public:
|
|||
|
||||
const int ig = P.GroupID[iat];
|
||||
// update compact list elecs_inside
|
||||
for (int jat=0; jat < Nion; jat++)
|
||||
// if the old position exists in elecs_inside
|
||||
for (int iind=0; iind<ions_nearby_old.size(); iind++)
|
||||
{
|
||||
bool inside = eI_table.Temp_r[jat] < Ion_cutoff[jat];
|
||||
int jat=ions_nearby_old[iind];
|
||||
auto iter = find(elecs_inside(ig,jat).begin(), elecs_inside(ig,jat).end(), iat);
|
||||
auto iter_dist = elecs_inside_dist(ig,jat).begin()+std::distance(elecs_inside(ig,jat).begin(),iter);
|
||||
auto iter_displ = elecs_inside_displ(ig,jat).begin()+std::distance(elecs_inside(ig,jat).begin(),iter);
|
||||
if(inside)
|
||||
{
|
||||
if(iter==elecs_inside(ig,jat).end())
|
||||
{
|
||||
elecs_inside(ig,jat).push_back(iat);
|
||||
elecs_inside_dist(ig,jat).push_back(eI_table.Temp_r[jat]);
|
||||
elecs_inside_displ(ig,jat).push_back(eI_table.Temp_dr[jat]);
|
||||
}
|
||||
else
|
||||
if(eI_table.Temp_r[jat] < Ion_cutoff[jat]) // the new position is still inside
|
||||
{
|
||||
*iter_dist = eI_table.Temp_r[jat];
|
||||
*iter_displ = eI_table.Temp_dr[jat];
|
||||
}
|
||||
*std::find(ions_nearby_new.begin(), ions_nearby_new.end(), jat) = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(iter!=elecs_inside(ig,jat).end())
|
||||
{
|
||||
*iter = elecs_inside(ig,jat).back();
|
||||
elecs_inside(ig,jat).pop_back();
|
||||
|
@ -547,6 +539,17 @@ public:
|
|||
elecs_inside_displ(ig,jat).pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
// if the old position doesn't exist in elecs_inside but the new position do
|
||||
for (int iind=0; iind<ions_nearby_new.size(); iind++)
|
||||
{
|
||||
int jat=ions_nearby_new[iind];
|
||||
if(jat>=0)
|
||||
{
|
||||
elecs_inside(ig,jat).push_back(iat);
|
||||
elecs_inside_dist(ig,jat).push_back(eI_table.Temp_r[jat]);
|
||||
elecs_inside_displ(ig,jat).push_back(eI_table.Temp_dr[jat]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -560,7 +563,7 @@ public:
|
|||
for(int jel=0; jel<Nelec; ++jel)
|
||||
{
|
||||
computeU3(P, jel, eI_table.Distances[jel], eI_table.Displacements[jel], ee_table.Distances[jel], ee_table.Displacements[jel],
|
||||
Uat[jel], dUat_temp, d2Uat[jel], newUk, newdUk, newd2Uk, true);
|
||||
Uat[jel], dUat_temp, d2Uat[jel], newUk, newdUk, newd2Uk, ions_nearby_new, true);
|
||||
dUat(jel) = dUat_temp;
|
||||
// add the contribution from the upper triangle
|
||||
#pragma omp simd
|
||||
|
@ -581,7 +584,8 @@ public:
|
|||
}
|
||||
|
||||
inline valT computeU(const ParticleSet& P, int jel, int jg,
|
||||
const RealType* distjI, const RealType* distjk)
|
||||
const RealType* distjI, const RealType* distjk,
|
||||
std::vector<int>& ions_nearby)
|
||||
{
|
||||
const DistanceTableData& eI_table=(*P.DistTables[myTableID]);
|
||||
|
||||
|
@ -717,7 +721,8 @@ public:
|
|||
const RealType* distjI, const RowContainer& displjI,
|
||||
const RealType* distjk, const RowContainer& displjk,
|
||||
valT& Uj, posT& dUj, valT& d2Uj,
|
||||
Vector<valT>& Uk, gContainer_type& dUk, Vector<valT>& d2Uk, bool triangle=false)
|
||||
Vector<valT>& Uk, gContainer_type& dUk, Vector<valT>& d2Uk,
|
||||
std::vector<int>& ions_nearby, bool triangle=false)
|
||||
{
|
||||
constexpr valT czero(0);
|
||||
|
||||
|
|
|
@ -5,14 +5,15 @@
|
|||
# Run the "short" nightlies
|
||||
#
|
||||
|
||||
export TEST_SITE_NAME=bora.alcf.anl.gov
|
||||
export N_PROCS_BUILD=24
|
||||
export N_PROCS=32
|
||||
export CC=mpicc
|
||||
export CXX=mpicxx
|
||||
export BOOST_ROOT=/sandbox/opt/qmcdev/trunk/external_codes/boost_1_55_0
|
||||
|
||||
QE_BIN=/sandbox/opt/qe-6.2.1/bin
|
||||
QE_BIN=/sandbox/opt/qe-stable/qe-6.2.1/bin
|
||||
QMC_DATA=/sandbox/yeluo/benchmark
|
||||
site_name=bora.alcf.anl.gov
|
||||
|
||||
#Must be an absolute path
|
||||
place=/sandbox/QMCPACK_CI_BUILDS_DO_NOT_REMOVE
|
||||
|
@ -68,7 +69,7 @@ then
|
|||
mkdir -p $place/log/$entry/$mydate
|
||||
fi
|
||||
|
||||
CTEST_FLAGS="-D QE_BIN=$QE_BIN -D QMC_DATA=$QMC_DATA -D CTEST_SITE=$site_name"
|
||||
CTEST_FLAGS="-D QE_BIN=$QE_BIN -D QMC_DATA=$QMC_DATA"
|
||||
|
||||
if [[ $sys == *"Complex"* ]]; then
|
||||
CTEST_FLAGS="$CTEST_FLAGS -D QMC_COMPLEX=1"
|
||||
|
|
|
@ -11,6 +11,10 @@
|
|||
# Run the "short" nightlies, requeue if an executable is built
|
||||
#
|
||||
|
||||
export TEST_SITE_NAME=cetus.alcf.anl.gov
|
||||
export N_PROCS_BUILD=24
|
||||
export N_CONCURRENT_TESTS=1
|
||||
|
||||
#Must be an absolute path
|
||||
place=/projects/PSFMat/QMCPACK_CI_BUILDS_DO_NOT_REMOVE
|
||||
|
||||
|
|
Loading…
Reference in New Issue