Skip to content

Commit

Permalink
Merge pull request #93 from RMGDFT/develop
Browse files Browse the repository at this point in the history
Develop merge for 6.1 release
  • Loading branch information
elbriggs authored Jun 20, 2024
2 parents b9f4961 + e6aaed2 commit 4dd5862
Show file tree
Hide file tree
Showing 58 changed files with 12,632 additions and 13,705 deletions.
2 changes: 1 addition & 1 deletion CMakeCPackOptions.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(CPACK_GENERATOR "DEB")

set(CPACK_PACKAGE_VERSION_MAJOR "6")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "1")
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
set(CPACK_PACKAGE_NAME "rmg")
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
cmake_minimum_required (VERSION 3.17)

set(RMG_VERSION_MAJOR "6")
set(RMG_VERSION_MINOR "0")
set(RMG_VERSION_MINOR "1")
set(RMG_VERSION_PATCH "0")
set(COMPLETE_VERSION ${RMG_VERSION_MAJOR}.${RMG_VERSION_MINOR}.${RMG_VERSION_PATCH})

Expand Down Expand Up @@ -207,6 +207,11 @@ if(CRAY_HOST)
else()
find_package(MPI REQUIRED)
endif()

if(${MPI_CXX_VERSION_MAJOR} LESS 3)
message(FATAL_ERROR "RMG requires MPI CXX version 3.0 or greater.")
endif()

set(RMGLIBS "${MPI_CXX_LIBRARIES}")
list(APPEND RMGLIBS ${MPI_C_LIBRARIES})
list(APPEND RMGLIBS ${MPI_Fortran_LIBRARIES})
Expand Down
15 changes: 15 additions & 0 deletions Headers/State.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,27 @@ template <typename StateType> class State {

/** Nuclear potential */
double *vnuc;
double *vnuc_f; // Ephemeral object that only exists in GetNewRho
double *vnuc_c; // Ephemeral object that only exists in GetNewRho

/** Nuclear potential energy correction term */
double vnuc_correction;

/** EXC energy correction term */
double vxc_correction;

/** ES energy correction term */
double vh_correction;

/** Hartree potential */
double *vh;
double *vh_f; // Ephemeral object that only exists in GetNewRho
double *vh_c; // Ephemeral object that only exists in GetNewRho

/** Exchange correlation potential */
double *vxc;
double *vxc_f; // Ephemeral object that only exists in GetNewRho
double *vxc_c; // Ephemeral object that only exists in GetNewRho

/** Total potential */
double *vtot;
Expand Down
2 changes: 2 additions & 0 deletions Headers/common_prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

template <typename T> T MyConj(T val);

void WritePoscar(FILE *FH, int md_step);

/* Blas wrappers */
void QMD_daxpy (int n, double alpha, double *x, int incx, double *y, int incy);
void QMD_dscal (int n, double alpha, double *x, int incx);
Expand Down
8 changes: 7 additions & 1 deletion Headers/rmg_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,10 @@ class CONTROL
/* Prolong operator default order */
int prolong_order;
/* Prolong operator mixing parameter */
double cmix = 1.0;
double cmix = 0.0;
/* Flag indicating whether or not to use cmix */
bool use_cmix = true;


// Flag indicating whether or not to use gpu finite differencing for the hamiltonian
bool use_gpu_fd;
Expand Down Expand Up @@ -721,6 +724,9 @@ class CONTROL
// Flag to indicate whether or not to use gpu managed memory
bool gpu_managed_memory;

// Flag to use new energy correction terms
bool use_energy_correction;

#if CUDA_ENABLED || HIP_ENABLED || SYCL_ENABLED


Expand Down
12 changes: 4 additions & 8 deletions Headers/species.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,11 @@ class SPECIES : Atomic
std::vector<double> atomic_wave_energy;

/* Finite difference auto tuning factors. One for each atomic orbital (including m-dependence) */
std::vector<double> fd_factor1;
std::vector<double> fd_fke1;
std::vector<double> fd_slopes;
std::vector<double> fd_xint;
std::vector<double> fd_yint;
std::vector<double> pd_slopes;
std::vector<double> pd_xint;
std::vector<double> pd_yint;
std::vector<double> occ_weight;
std::vector<double> fd_mins;
std::vector<double> pd_mins;
std::vector<std::array<double, 8> > fd_coeffs;
std::vector<std::array<double, 8> > pd_coeffs;

std::vector<std::string> atomic_wave_label;

Expand Down
1 change: 1 addition & 0 deletions Headers/transition.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ void Precond_drho(double *);
template <typename T> void Write_Wfs_forWannier(int kpt_global, Kpoint<T> *kptr, std::vector<bool> exclude_bands, std::string wavefule);
double GetPlanarAnisotropy(double *density);
void GetFdFactor(int kidx);
void SimplePolyFit(const double *x, double *y, const size_t n, const size_t k, double *beta);

#endif
#endif
Expand Down
5 changes: 5 additions & 0 deletions Input/LoadUpfPseudo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,11 @@ void LoadUpfPseudo(SPECIES *sp)

// UPF stores atomic wavefunctions * r so divide through
for(int ix = 0;ix < sp->rg_points;ix++) sp->atomic_wave[iwf][ix] /= sp->r[ix];
for(int ix = 0;ix < sp->rg_points;ix++)
{
// if(sp->r[ix] > 8.0) sp->atomic_wave[iwf][ix] *= exp(-(sp->r[ix] - 8.0)*(sp->r[ix] - 8.0));
}

}
ct.max_orbitals = std::max(ct.max_orbitals, sp->num_atomic_waves_m);
sp->num_orbitals = sp->num_atomic_waves_m;
Expand Down
14 changes: 13 additions & 1 deletion Input/ReadCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,16 @@ void ReadCommon(char *cfile, CONTROL& lc, PE_CONTROL& pelc, std::unordered_map<s
If.RegisterInputKey("afd_cfac", &lc.afd_cfac, 0.0, 10.0, 0.0,
CHECK_AND_FIX, OPTIONAL,
"Manual setting for the adaptive finite differencing parameter. ",
"afd_cfac must lie in the range (0.0,3.0). Resetting to auto. ", CONTROL_OPTIONS);
"afd_cfac must lie in the range (0.0,10.0). Resetting to auto. ", CONTROL_OPTIONS);

If.RegisterInputKey("adaptive_cmix", &lc.cmix, 0.0, 10.0, 0.0,
CHECK_AND_FIX, OPTIONAL,
"Manual setting for the adaptive interpolation parameter. ",
"adaptive_cmix must lie in the range (0.0,10.0). Resetting to auto. ", CONTROL_OPTIONS);

If.RegisterInputKey("use_cmix", &lc.use_cmix, true,
"Use adaptive interpolation "
"can improve energies/forces for some but not all systems. ", MISC_OPTIONS|EXPERIMENTAL_OPTION);

If.RegisterInputKey("semilocal_projectors", &lc.semilocal_projectors, 6, 40, 10,
CHECK_AND_FIX, OPTIONAL,
Expand Down Expand Up @@ -1228,6 +1237,9 @@ void ReadCommon(char *cfile, CONTROL& lc, PE_CONTROL& pelc, std::unordered_map<s
"Some AMD and Nvidia GPUs support managed gou memory which is "
"useful when GPU memory limits are exceeded. ", CONTROL_OPTIONS|EXPERT_OPTION);

If.RegisterInputKey("use_energy_correction", &lc.use_energy_correction, false,
"Experimental energy correction term ", CONTROL_OPTIONS|EXPERIMENTAL_OPTION);

If.RegisterInputKey("use_numa", &lc.use_numa, true,
"Numa stands for Non Uniform Memory Access and means that the main "
"memory of a computer is organized into seperate distinct banks. "
Expand Down
9 changes: 9 additions & 0 deletions Input/ReadDynamics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,15 @@ void ReadDynamics(char *cfile, CONTROL& lc, std::unordered_map<std::string, Inpu

}

for (auto& sp : Species)
{
sp.num_atoms = 0;
}
for(auto& Atom : Atoms)
{
Atom.Type->num_atoms +=1;
}

}


Expand Down
2 changes: 2 additions & 0 deletions Misc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
add_library (Misc
PolyFit.cpp
WritePoscar.cpp
OutputBandPlot.cpp
kind.f90
kpoint_grid.f90
Expand Down
Loading

0 comments on commit 4dd5862

Please sign in to comment.