Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
1ad1292
Fix EnergyAndForces tests (#277)
jeanlucf22 Sep 26, 2024
8ac6cd6
Move factor 4pi out og linear solvers (#278)
jeanlucf22 Sep 30, 2024
a2ece1a
Move some code into PoissonSolverFactory (#279)
jeanlucf22 Sep 30, 2024
8b577ea
Clean up class Potentials (#280)
jeanlucf22 Oct 3, 2024
7ac691c
Clean up class Ions, add test for it (#281)
jeanlucf22 Oct 12, 2024
c05ba7f
Add test MD_MVP (#290)
jeanlucf22 Nov 25, 2024
bb8051d
Clean up code related to DM restart data (#292)
jeanlucf22 Dec 2, 2024
a227c04
Write dm (#291)
jeanlucf22 Dec 2, 2024
b263532
Remove unused function in Control (#294)
jeanlucf22 Dec 23, 2024
3eb52d6
Change symlink to restart in tests (#295)
jeanlucf22 Jan 3, 2025
c1d46bc
Extract number empty orbitals from restart file (#296)
jeanlucf22 Jan 7, 2025
eb53963
Clean up MD_IonicStepper restart data write (#297)
jeanlucf22 Jan 16, 2025
857673f
Clean up code based on compiler warnings (#299)
jeanlucf22 Jan 17, 2025
f294d3c
Add getForces for evaluateDMandEnergyAndForces (#300)
siuwuncheung Jan 23, 2025
98a79de
Add check for compatibility MVP/Mehrstellen (#301)
jeanlucf22 Jan 24, 2025
8eda83e
Add support for Br atom (#302)
jeanlucf22 Feb 3, 2025
f298d43
Clean up some HDFrestart functions (#303)
jeanlucf22 Feb 11, 2025
c690bc5
Fix and test restart single hdf5 file (#305)
jeanlucf22 Feb 17, 2025
9f1fc20
Save Hartree potential for write in restart file (#306)
jeanlucf22 Feb 17, 2025
8a1cf05
Speed-up recently added tests (#309)
jeanlucf22 Feb 19, 2025
8a26879
Encapsulate some functions in Potentials (#310)
jeanlucf22 Feb 20, 2025
59b79e7
Remove confusing 0 in naming restart files (#308)
jeanlucf22 Feb 20, 2025
16a818a
Add functionalities for extra info in restart file (#312)
jeanlucf22 Feb 20, 2025
77bd87e
MPI abort (#313)
jeanlucf22 Feb 21, 2025
8b84de4
Rho and VH restart (#311)
jeanlucf22 Feb 24, 2025
8003d70
Strenghten testIons (#315)
jeanlucf22 Mar 4, 2025
4efb34c
More clean up in class Potentials (#316)
jeanlucf22 Mar 4, 2025
2f511b7
Misc code fixes (#317)
jeanlucf22 Mar 14, 2025
45a2c80
Use unique restart filenames in test HDF5single (#318)
jeanlucf22 Mar 14, 2025
b6cf162
Swap ions in existing test (#319)
jeanlucf22 Mar 15, 2025
7fbfe13
Code clean up (#320)
jeanlucf22 Mar 17, 2025
14eb43f
Added functionalities to set local forces (#321)
jeanlucf22 Mar 21, 2025
c61b48d
Update mixed precision code (#322)
jeanlucf22 Mar 24, 2025
e37983b
Clean up and fixes Ions (#326)
jeanlucf22 Mar 26, 2025
89630b3
Fixes for build without HDF5P (#324)
jeanlucf22 Mar 26, 2025
e80193b
Fix testRhoVhRestart (#325)
jeanlucf22 Mar 26, 2025
bcad112
Fix a few more issues with class Ions (#328)
jeanlucf22 Mar 26, 2025
a78e260
Introduce new constructor for class Ions (#330)
jeanlucf22 Mar 27, 2025
c4817b8
Add cleanup and MGmolInterface (#331)
siuwuncheung Mar 27, 2025
a5f6f3a
Add function to set local forces (#333)
jeanlucf22 Mar 28, 2025
4e82239
Fix setLocalForces (#335)
siuwuncheung Mar 30, 2025
f715dd9
Fix test WFEnergyAndForces (#336)
jeanlucf22 Apr 4, 2025
89d502e
Add mixing option in MVP (#337)
jeanlucf22 Apr 4, 2025
f198397
Update MVP with mixing (#339)
jeanlucf22 Apr 9, 2025
781d7e5
Update DensityMatrix class (#342)
jeanlucf22 Apr 11, 2025
47cba98
Fixing DM tolerance (#341)
siuwuncheung Apr 14, 2025
6c75cbf
Clean-up implementation
siuwuncheung Jun 30, 2025
ffc087c
Rm oversubscribe from CMakeLists.txt (#346)
jeanlucf22 Jul 11, 2025
0897876
Adapt to new environment on condo @ ORNL (#348)
jeanlucf22 Jul 14, 2025
3cd53dc
Attempt to fix error
siuwuncheung Jul 14, 2025
832ff17
Attempt to fix bugs
siuwuncheung Jul 15, 2025
b33348a
Merge branch 'ROMFPMD' into extrapolate_DM
siuwuncheung Jul 15, 2025
7d89625
Remove unused function
jeanlucf22 Jul 15, 2025
c0dd3b3
Clean up use of coords file when restarting
jeanlucf22 Jul 15, 2025
a8be389
Add test restart with override atomic coordinates
jeanlucf22 Jul 15, 2025
de6eb6b
Add some missing include files
jeanlucf22 Jul 14, 2025
a3c1074
Using one CPU only
siuwuncheung Jul 21, 2025
5c9d31b
Switch to 500 time steps with longer time
siuwuncheung Jul 22, 2025
1b06e02
Print MVP timers
jeanlucf22 Jul 22, 2025
545cadf
Merge branch 'release' into merge_release_20250728
siuwuncheung Jul 29, 2025
2610a33
Merge branch 'merge_release_20250728' into extrapolate_DM
siuwuncheung Jul 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/PinnedH2O/job.ref
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/tcsh
#SBATCH -N 1
#SBATCH -t 1:00:00
#SBATCH -p pdebug
#SBATCH -t 3:00:00
#SBATCH -p pbatch

date

setenv OMP_NUM_THREADS 1
#setenv KMP_DETERMINISTIC_REDUCTION 1

set ncpus = 8
set ncpus = 1
set case = 2

set maindir = /p/lustre2/cheung26/mgmol
Expand Down
6 changes: 3 additions & 3 deletions examples/PinnedH2O/job.rom_3DOF
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/tcsh
#SBATCH -N 1
#SBATCH -t 1:00:00
#SBATCH -p pdebug
#SBATCH -t 2:00:00
#SBATCH -p pbatch

date

setenv OMP_NUM_THREADS 1
#setenv KMP_DETERMINISTIC_REDUCTION 1

set ncpus = 8
set ncpus = 1
set case = 2

set maindir = /p/lustre2/cheung26/mgmol
Expand Down
2 changes: 1 addition & 1 deletion examples/PinnedH2O/mgmol_rom_3DOF_test2.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ output_level=4
[ROM]
stage=online_pinned_H2O_3dof
[ROM.offline]
basis_file=/usr/workspace/nlrom/MGmol/PinnedH2O_3DOF/data_8/PinnedH2O_3DOF_orbitals_basis_2_2
basis_file=/usr/workspace/nlrom/MGmol/PinnedH2O_3DOF/data_1/PinnedH2O_3DOF_orbitals_basis_2_2
[ROM.basis]
compare_md=false
number_of_orbital_basis=34
74 changes: 36 additions & 38 deletions src/Control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ Control::Control()
out_restart_file_type = -1;
spread_radius = -1.;
iprint_residual = -1;
override_restart = -1;
dot_product_type = -1;
spread_penalty_damping_ = -1;
spread_penalty_alpha_ = -1;
Expand Down Expand Up @@ -386,7 +385,7 @@ void Control::sync(void)
short_buffer[47] = out_restart_file_naming_strategy;
short_buffer[48] = enforceVmass0;
short_buffer[49] = dm_inner_steps;
short_buffer[50] = override_restart;
short_buffer[50] = -1;
short_buffer[51] = fgmres_kim;
short_buffer[52] = fgmres_maxits;
short_buffer[53] = ilu_type;
Expand Down Expand Up @@ -599,41 +598,41 @@ void Control::sync(void)
out_restart_file_naming_strategy = short_buffer[47];
enforceVmass0 = short_buffer[48];
dm_inner_steps = short_buffer[49];
override_restart = short_buffer[50];
fgmres_kim = short_buffer[51];
fgmres_maxits = short_buffer[52];
ilu_type = short_buffer[53];
ilu_lof = short_buffer[54];
ilu_maxfil = short_buffer[55];
coloring_algo_ = short_buffer[56];
diel_flag_ = short_buffer[57];
poisson_pc_nu1 = short_buffer[58];
poisson_pc_nu2 = short_buffer[59];
poisson_pc_nlev = short_buffer[60];
system_charge_ = short_buffer[61];
md_print_freq = short_buffer[62];
use_kernel_functions = short_buffer[63];
ngpts_[0] = short_buffer[64];
ngpts_[1] = short_buffer[65];
ngpts_[2] = short_buffer[66];
computeCondGram_ = short_buffer[67];
lrs_extrapolation = short_buffer[68];
parallel_transport = (bool)short_buffer[69];
with_spin_ = (bool)short_buffer[70];
conv_criterion_ = short_buffer[71];
load_balancing_max_iterations = short_buffer[72];
load_balancing_modulo = short_buffer[73];
write_clusters = short_buffer[74];
DM_solver_ = short_buffer[75];
dm_algo_ = short_buffer[80];
dm_approx_order = short_buffer[81];
dm_approx_ndigits = short_buffer[82];
dm_approx_power_maxits = short_buffer[83];
spread_penalty_type_ = short_buffer[84];
dm_use_old_ = short_buffer[85];
max_electronic_steps_tight_ = short_buffer[86];
hartree_reset_ = short_buffer[88];
MD_last_step_ = short_buffer[89];
//... = short_buffer[50];
fgmres_kim = short_buffer[51];
fgmres_maxits = short_buffer[52];
ilu_type = short_buffer[53];
ilu_lof = short_buffer[54];
ilu_maxfil = short_buffer[55];
coloring_algo_ = short_buffer[56];
diel_flag_ = short_buffer[57];
poisson_pc_nu1 = short_buffer[58];
poisson_pc_nu2 = short_buffer[59];
poisson_pc_nlev = short_buffer[60];
system_charge_ = short_buffer[61];
md_print_freq = short_buffer[62];
use_kernel_functions = short_buffer[63];
ngpts_[0] = short_buffer[64];
ngpts_[1] = short_buffer[65];
ngpts_[2] = short_buffer[66];
computeCondGram_ = short_buffer[67];
lrs_extrapolation = short_buffer[68];
parallel_transport = (bool)short_buffer[69];
with_spin_ = (bool)short_buffer[70];
conv_criterion_ = short_buffer[71];
load_balancing_max_iterations = short_buffer[72];
load_balancing_modulo = short_buffer[73];
write_clusters = short_buffer[74];
DM_solver_ = short_buffer[75];
dm_algo_ = short_buffer[80];
dm_approx_order = short_buffer[81];
dm_approx_ndigits = short_buffer[82];
dm_approx_power_maxits = short_buffer[83];
spread_penalty_type_ = short_buffer[84];
dm_use_old_ = short_buffer[85];
max_electronic_steps_tight_ = short_buffer[86];
hartree_reset_ = short_buffer[88];
MD_last_step_ = short_buffer[89];
poisson_lap_type_ = static_cast<PoissonFDtype>(short_buffer[90]);

numst = int_buffer[0];
Expand Down Expand Up @@ -1787,7 +1786,6 @@ void Control::setOptions(const boost::program_options::variables_map& vm)
// options not available in configure file
lr_updates_type = 0;
precond_factor_computed = false;
override_restart = 0;
mix_pot = 1.;
project_out_psd = 0;
multipole_order = 1;
Expand Down
1 change: 0 additions & 1 deletion src/Control.h
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,6 @@ class Control
short out_restart_file_naming_strategy;
short restart_file_type;
short out_restart_file_type;
short override_restart;

short verbose;

Expand Down
6 changes: 0 additions & 6 deletions src/DensityMatrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@

const double factor_kernel4dot = 10.;

#define MGMOL_DENSITYMATRIX_FAIL(X) \
{ \
std::cerr << "DensityMatrix failure:" << std::endl; \
std::cerr << "Error Message: " << X << std::endl; \
}

#define MGMOL_DENSITYMATRIX_FAIL(X) \
{ \
std::cerr << "DensityMatrix failure:" << std::endl; \
Expand Down
4 changes: 4 additions & 0 deletions src/MGmol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "MGmol.h"
#include "MLWFTransform.h"
#include "MPIdata.h"
#include "MVPSolver.h"
#include "MasksSet.h"
#include "Mesh.h"
#include "OrbitalsPreconditioning.h"
Expand Down Expand Up @@ -901,6 +902,9 @@ void MGmol<OrbitalsType>::printTimers()
AndersonMix<OrbitalsType>::update_tm().print(os_);
proj_matrices_->printTimers(os_);
ShortSightedInverse::printTimers(os_);
if (std::is_same<OrbitalsType, ExtendedGridOrbitals>::value)
MVPSolver<ExtendedGridOrbitals,
dist_matrix::DistMatrix<DISTMATDTYPE>>::printTimers(os_);
VariableSizeMatrixInterface::printTimers(os_);
DataDistribution::printTimers(os_);
PackedCommunicationBuffer::printTimers(os_);
Expand Down
1 change: 0 additions & 1 deletion src/MGmol.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ class MGmol : public MGmolInterface

void printEigAndOcc();

int readCoordinates(std::ifstream* tfile, const bool cell_relative);
int readCoordinates(const std::string& filename, const bool cell_relative);
double computeConstraintResidual(OrbitalsType& orbitals,
const OrbitalsType& hphi, OrbitalsType& res, const bool print_residual,
Expand Down
8 changes: 2 additions & 6 deletions src/MVPSolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,8 @@ int MVPSolver<OrbitalsType, MatrixType>::solve(OrbitalsType& orbitals)
template <class OrbitalsType, class MatrixType>
void MVPSolver<OrbitalsType, MatrixType>::printTimers(std::ostream& os)
{
if (onpe0)
{
os << std::setprecision(2) << std::fixed << std::endl;
solve_tm_.print(os);
target_tm_.print(os);
}
solve_tm_.print(os);
target_tm_.print(os);
}

template class MVPSolver<LocGridOrbitals,
Expand Down
3 changes: 1 addition & 2 deletions src/MVPSolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

class Ions;
class Electrostatic;
class ProjectedMatrices2N;
template <class OrbitalsType>
class ProjectedMatrices;

Expand Down Expand Up @@ -67,7 +66,7 @@ class MVPSolver
~MVPSolver();

int solve(OrbitalsType& orbitals);
void printTimers(std::ostream& os);
static void printTimers(std::ostream& os);
};

#endif
10 changes: 5 additions & 5 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int main(int argc, char** argv)
/*
* read runtime parameters
*/
std::string input_filename("");
std::string coords_filename("");
std::string lrs_filename;
std::string constraints_filename("");

Expand All @@ -70,7 +70,7 @@ int main(int argc, char** argv)
// read from PE0 only
if (MPIdata::onpe0)
{
read_config(argc, argv, vm, input_filename, lrs_filename,
read_config(argc, argv, vm, coords_filename, lrs_filename,
constraints_filename, total_spin, with_spin);
}

Expand All @@ -89,18 +89,18 @@ int main(int argc, char** argv)
int ret = ct.checkOptions();
if (ret < 0) return ret;

mmpi.bcastGlobal(input_filename);
mmpi.bcastGlobal(coords_filename);
mmpi.bcastGlobal(lrs_filename);

// Enter main scope
{
MGmolInterface* mgmol;
if (ct.isLocMode())
mgmol = new MGmol<LocGridOrbitals>(global_comm, *MPIdata::sout,
input_filename, lrs_filename, constraints_filename);
coords_filename, lrs_filename, constraints_filename);
else
mgmol = new MGmol<ExtendedGridOrbitals>(global_comm, *MPIdata::sout,
input_filename, lrs_filename, constraints_filename);
coords_filename, lrs_filename, constraints_filename);

mgmol->setup();

Expand Down
16 changes: 14 additions & 2 deletions src/md.cc
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ void MGmol<OrbitalsType>::md(OrbitalsType** orbitals, Ions& ions)

constraints_->printConstraints(os_);

if (ct.restart_info > 0 && !ct.override_restart)
if (ct.restart_info > 0)
{
if (onpe0) os_ << "Use restart file to initialize MD..." << std::endl;
stepper->init(*h5f_file_);
Expand Down Expand Up @@ -406,9 +406,13 @@ void MGmol<OrbitalsType>::md(OrbitalsType** orbitals, Ions& ions)
h5f_file_.reset();
}

bool ROM_MVP = (ct.getROMOptions().rom_stage == ROMStage::ONLINE_PINNED_H2O_3DOF);
#ifdef MGMOL_HAS_LIBROM
bool ROM_MVP = (ct.getROMOptions().rom_stage == ROMStage::ONLINE_PINNED_H2O_3DOF);
DensityMatrix<dist_matrix::DistMatrix<DISTMATDTYPE>>* dm = nullptr;
dist_matrix::DistMatrix<DISTMATDTYPE>* previous_dm = nullptr;
// ROM - initialize orbitals and density matrix
// assume ct.Mehrstellen() nor ct.short_sighted nor use_replicated_matrix
// so that Line 267 of MGmol.cc is activated
if (ROM_MVP)
{
if (onpe0) os_ << "Setup ROM MVP solver..." << std::endl;
Expand All @@ -422,6 +426,11 @@ void MGmol<OrbitalsType>::md(OrbitalsType** orbitals, Ions& ions)
= getProjectedMatrices();
projmatrices->setDMuniform(ct.getNelSpin());
projmatrices->printDM(os_);

std::shared_ptr<ProjectedMatrices<dist_matrix::DistMatrix<DISTMATDTYPE>>> projmatrices_downcast =
std::dynamic_pointer_cast<ProjectedMatrices<dist_matrix::DistMatrix<DISTMATDTYPE>>>(projmatrices);
dm = &(projmatrices_downcast->getDM());
previous_dm = new dist_matrix::DistMatrix<DISTMATDTYPE>(dm->getMatrix());
}
#endif

Expand Down Expand Up @@ -487,6 +496,9 @@ void MGmol<OrbitalsType>::md(OrbitalsType** orbitals, Ions& ions)
if (ROM_MVP)
{
md_updateDMandEnergy_tm.start();
dist_matrix::DistMatrix<DISTMATDTYPE> tmp(dm->getMatrix());
dm->linearExtrapolate(*previous_dm);
*previous_dm = tmp;
updateDMandEnergy(**orbitals, *ROM_ions, eks);
md_updateDMandEnergy_tm.stop();
}
Expand Down
Loading