Skip to content

Commit 704c952

Browse files
siuwuncheungjeanlucf22dreamer2368
authored
ROM MVP solver in MD for Pinned H2O (#314)
* Fix EnergyAndForces tests (#277) * have them work in debug mode too * Move factor 4pi out og linear solvers (#278) * Move some code into PoissonSolverFactory (#279) * Clean up class Potentials (#280) * Clean up class Ions, add test for it (#281) * Add test MD_MVP (#290) * Clean up code related to DM restart data (#292) * Write dm (#291) * Update use of DM in restart * Remove unused function in Control (#294) * Change symlink to restart in tests (#295) * enable tests when old link present * Extract number empty orbitals from restart file (#296) * Clean up MD_IonicStepper restart data write (#297) * Clean up code based on compiler warnings (#299) * Add getForces for evaluateDMandEnergyAndForces (#300) * Add check for compatibility MVP/Mehrstellen (#301) * Add support for Br atom (#302) * Clean up some HDFrestart functions (#303) * Fix and test restart single hdf5 file (#305) * Save Hartree potential for write in restart file (#306) * Add commit number temporarily * Fix merge * Speed-up recently added tests (#309) * simply use a smaller domain/mesh * Encapsulate some functions in Potentials (#310) * some functions were called at random places and confusing * Remove confusing 0 in naming restart files (#308) * use added integer only in case of fail/retry * Move geometric transforms to tools in library * Add functionalities for extra info in restart file (#312) * Add ROM MVP solver to MD * Changes to scripts * MPI abort (#313) * Fix error code used by MPI_Abort * Partial updates * Rho and VH restart (#311) * enable restart with consistent rho and VHartree --------- Co-authored-by: Seung Whan Chung <seung.chung@austin.utexas.edu> * Attempt to fix bugs * Fix config file * Debug * Debug * Debug * Debug * Strenghten testIons (#315) * More clean up in class Potentials (#316) * remove some unused functions * make use of class MGmol_MPI * change some function names for clarity * fix some minor bug in iterative indexes * Fix ROM stage * Debug * Add initialization to evaluateDMandEnergyandForces if it is ROM MVP * Misc code fixes (#317) * exposed by porting on new environment * Use unique restart filenames in test HDF5single (#318) * Swap ions in existing test (#319) * strengthen testing by swapping ions in testRestartEnergyAndForces * Code clean up (#320) * use more const * use initNuc() instead of moveVnuc() * remove incorrect assert * use MGmol_MPI in more cases * setup g_kbpsi_ inside initNuc() * rename initNuc() into setupPotentials() * Pass by reference * Make global version of setForces * Added functionalities to set local forces (#321) * Update mixed precision code (#322) * enable cmake build with mixed precision * enable use of BLIS * isolate blas3 loop rewrite in separate files * fix misc issues with mixed precision code * Use new setLocalForce * Write PinnedH2O into original ordering. This is better for MD * names should be obtained before rotate * Fixing ion names * Clean up and fixes Ions (#326) * reset static index counter ion Ion when needed * simplify some loops * make Ions copy constructor private * Fixes for build without HDF5P (#324) * Fix testRhoVhRestart (#325) * Fix a few more issues with class Ions (#328) * Debugging * Introduce new constructor for class Ions (#330) * modify various functions to use argument of type Ions instead of MGmol::ions_ * Add cleanup and MGmolInterface (#331) * Using new constructor for ROM ions * Add function to set local forces (#333) * based on matching coordinates to local ions * Use new setLocalForces with positions instead of names * Cleanup * only pe0 prints bondlengths and bondangle * Fix setLocalForces * Updates * Minor changes * Auxiliary scripts * Auxiliary script * Auxiliary scripts * fix job scripts * Renaming and adding new test * Rename * Minor change in auxiliary script * config files * update tests * Minor changes in names --------- Co-authored-by: Jean-Luc Fattebert <fattebertj@ornl.gov> Co-authored-by: Seung Whan Chung <seung.chung@austin.utexas.edu>
1 parent 2f1c16f commit 704c952

33 files changed

+725
-305
lines changed

examples/PinnedH2O/coords_test2.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
O1 1 0.00 0.00 0.00 0
2+
H1 2 -0.45 1.57 -1.07 1
3+
H2 2 -0.45 -1.48 -0.97 1

examples/PinnedH2O/get_result.sh

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
1-
filename="offline_PinnedH2O.out" # FOM
2-
#filename="rom39_PinnedH2O.out" # compare MD
3-
#filename="39_force_PinnedH2O.out" # compare force
1+
#filename="offline_PinnedH2O" # FOM
2+
#filename="rom39_PinnedH2O" # ROM compare MD
3+
#filename="39_force_PinnedH2O" # ROM compare force
4+
5+
#filename="PinnedH2O_test2_ref" # FOM
6+
filename="PinnedH2O_rom_3DOF_test2_2_2_34" # ROM PinnedH2O 3DOF MD
7+
8+
# Extracting kinetic energy, total energy, temperature from MGmgol output log
9+
awk '/Kinetic/ {print $3}' $filename.out > ke_$filename.txt
10+
awk '/Kinetic/ {print $5}' $filename.out >temp_$filename.txt
11+
awk '/Total/ {print $3}' $filename.out > te_$filename.txt
412

513
# Extracting H1, H2, F1, F2 from MGmgol output log
614
# if FOM, these files contain the FOM results
715
# if compare MD, these files contain the results with projected orbitals
8-
awk '/H1 / {print $3, $4, $5}' $filename > H1_$filename
9-
awk '/H2 / {print $3, $4, $5}' $filename > H2_$filename
10-
awk '/F1 / {print $6, $7, $8}' $filename > F1_$filename
11-
awk '/F2 / {print $6, $7, $8}' $filename > F2_$filename
16+
awk '/O1 / {print $4, $5, $6}' $filename.out > O1_$filename.txt
17+
awk '/H1 / {print $3, $4, $5}' $filename.out > H1_$filename.txt
18+
awk '/H2 / {print $3, $4, $5}' $filename.out > H2_$filename.txt
19+
awk '/O1 / {print $7, $8, $9}' $filename.out > f_O1_$filename.txt
20+
awk '/H1 / {print $6, $7, $8}' $filename.out > f_H1_$filename.txt
21+
awk '/H2 / {print $6, $7, $8}' $filename.out > f_H2_$filename.txt
1222

1323
# if compare force, files with "_fom" contain the FOM results
1424
# files with "_rom" contain the results with projected orbitals
1525
if [[ "$filename" == *"force_"* ]]; then
16-
sed -n '1~2p' H1_$filename > H1_rom$filename
17-
sed -n '1~2p' H2_$filename > H2_rom$filename
18-
sed -n '1~2p' F1_$filename > F1_rom$filename
19-
sed -n '1~2p' F2_$filename > F2_rom$filename
26+
sed -n '1~2p' H1_$filename.out > H1_rom$filename.txt
27+
sed -n '1~2p' H2_$filename.out > H2_rom$filename.txt
28+
sed -n '1~2p' f_H1_$filename.out > f_H1_rom$filename.txt
29+
sed -n '1~2p' f_H2_$filename.out > f_H2_rom$filename.txt
2030

21-
sed -n '2~2p' H1_$filename > H1_fom$filename
22-
sed -n '2~2p' H2_$filename > H2_fom$filename
23-
sed -n '2~2p' F1_$filename > F1_fom$filename
24-
sed -n '2~2p' F2_$filename > F2_fom$filename
31+
sed -n '2~2p' H1_$filename.out > H1_fom$filename.txt
32+
sed -n '2~2p' H2_$filename.out > H2_fom$filename.txt
33+
sed -n '2~2p' f_H1_$filename.out > f_H1_fom$filename.txt
34+
sed -n '2~2p' f_H2_$filename.out > f_H2_fom$filename.txt
2535
fi
2636

27-
rm -rf snapshot0_*
37+
rm -rf snapshot_*

examples/PinnedH2O/job.basis_1_50

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/bin/tcsh
2-
#SBATCH -N 2
2+
#SBATCH -N 1
33
#SBATCH -t 0:10:00
4-
#SBATCH -p pbatch
4+
#SBATCH -p pdebug
55

66
date
77

88
setenv OMP_NUM_THREADS 1
99
#setenv KMP_DETERMINISTIC_REDUCTION 1
1010

11-
set ncpus = 64
11+
set ncpus = 8
1212

13-
set maindir = /p/lustre2/cheung26/mgmol-20241012
13+
set maindir = /p/lustre2/cheung26/mgmol-20250219
1414

1515
setenv LD_LIBRARY_PATH ${maindir}/build_quartz/libROM/build/lib:$LD_LIBRARY_PATH
1616

examples/PinnedH2O/job.offline

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
11
#!/bin/tcsh
2-
#SBATCH -N 2
2+
#SBATCH -N 1
33
#SBATCH -t 1:00:00
4-
#SBATCH -p pbatch
4+
#SBATCH -p pdebug
55

66
date
77

88
setenv OMP_NUM_THREADS 1
99
#setenv KMP_DETERMINISTIC_REDUCTION 1
1010

11-
set ncpus = 64
11+
set ncpus = 8
1212

13-
set maindir = /p/lustre2/cheung26/mgmol-20241012
13+
set maindir = /p/lustre2/cheung26/mgmol-20250219
1414

1515
setenv LD_LIBRARY_PATH ${maindir}/build_quartz/libROM/build/lib:$LD_LIBRARY_PATH
1616

1717
set exe = mgmol-opt
1818

1919
cp $maindir/install_quartz/bin/$exe .
2020

21-
set datadir = $maindir/examples/PinnedH2O
22-
2321
set cfg_offline = mgmol_offline.cfg
24-
cp $datadir/$cfg_offline .
25-
26-
cp $datadir/coords.in .
2722

2823
ln -s -f $maindir/potentials/pseudo.O_ONCV_PBE_SG15 .
2924
ln -s -f $maindir/potentials/pseudo.H_ONCV_PBE_SG15 .

examples/PinnedH2O/job.ref

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/tcsh
2+
#SBATCH -N 1
3+
#SBATCH -t 1:00:00
4+
#SBATCH -p pdebug
5+
6+
date
7+
8+
setenv OMP_NUM_THREADS 1
9+
#setenv KMP_DETERMINISTIC_REDUCTION 1
10+
11+
set ncpus = 8
12+
set case = 2
13+
14+
set maindir = /p/lustre2/cheung26/mgmol-20250219
15+
16+
setenv LD_LIBRARY_PATH ${maindir}/build_quartz/libROM/build/lib:$LD_LIBRARY_PATH
17+
18+
set exe = mgmol-opt
19+
20+
cp $maindir/install_quartz/bin/$exe .
21+
22+
set datadir = $maindir/examples/PinnedH2O
23+
24+
set cfg = mgmol_ref_test${case}.cfg
25+
cp $datadir/$cfg .
26+
27+
cp $datadir/coords.in .
28+
29+
ln -s -f $maindir/potentials/pseudo.O_ONCV_PBE_SG15 .
30+
ln -s -f $maindir/potentials/pseudo.H_ONCV_PBE_SG15 .
31+
32+
source $maindir/scripts/modules.quartz
33+
34+
srun -n $ncpus $exe -c $cfg -i coords_test${case}.in > PinnedH2O_test${case}_ref.out
35+
36+
date
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
#!/bin/tcsh
2-
#SBATCH -N 2
2+
#SBATCH -N 1
33
#SBATCH -t 1:00:00
4-
#SBATCH -p pbatch
4+
#SBATCH -p pdebug
55

66
date
77

88
setenv OMP_NUM_THREADS 1
99
#setenv KMP_DETERMINISTIC_REDUCTION 1
1010

11-
set ncpus = 64
11+
set ncpus = 8
1212

13-
set maindir = /p/lustre2/cheung26/mgmol-20241012
13+
set maindir = /p/lustre2/cheung26/mgmol-20250219
1414

1515
setenv LD_LIBRARY_PATH ${maindir}/build_quartz/libROM/build/lib:$LD_LIBRARY_PATH
1616

1717
set exe = mgmol-opt
1818

1919
cp $maindir/install_quartz/bin/$exe .
2020

21-
set datadir = $maindir/examples/PinnedH2O
22-
2321
set increment_md_steps = 1
2422
set num_md_steps = 50
2523
set basis_file = PinnedH2O_orbitals_basis_${increment_md_steps}_${num_md_steps}
2624

2725
set cfg_rom = mgmol_rom_${increment_md_steps}_${num_md_steps}.cfg
28-
cp $datadir/$cfg_rom .
29-
30-
cp $datadir/coords.in .
3126

3227
ln -s -f $maindir/potentials/pseudo.O_ONCV_PBE_SG15 .
3328
ln -s -f $maindir/potentials/pseudo.H_ONCV_PBE_SG15 .

examples/PinnedH2O/job.rom_3DOF

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/tcsh
2+
#SBATCH -N 1
3+
#SBATCH -t 1:00:00
4+
#SBATCH -p pdebug
5+
6+
date
7+
8+
setenv OMP_NUM_THREADS 1
9+
#setenv KMP_DETERMINISTIC_REDUCTION 1
10+
11+
set ncpus = 8
12+
set case = 2
13+
14+
set maindir = /p/lustre2/cheung26/mgmol-20250219
15+
16+
setenv LD_LIBRARY_PATH ${maindir}/build_quartz/libROM/build/lib:$LD_LIBRARY_PATH
17+
18+
set exe = mgmol-opt
19+
20+
cp $maindir/install_quartz/bin/$exe .
21+
22+
set bondlength_num_increments = 2
23+
set bondangle_num_increments = 2
24+
set num_basis = 34
25+
26+
set cfg_rom = mgmol_rom_3DOF_test${case}.cfg
27+
28+
ln -s -f $maindir/potentials/pseudo.O_ONCV_PBE_SG15 .
29+
ln -s -f $maindir/potentials/pseudo.H_ONCV_PBE_SG15 .
30+
31+
source $maindir/scripts/modules.quartz
32+
33+
srun -n $ncpus $exe -c $cfg_rom -i coords_test${case}.in > PinnedH2O_rom_3DOF_test${case}_${bondlength_num_increments}_${bondangle_num_increments}_${num_basis}.out
34+
35+
date
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ pseudopotential=pseudo.H_ONCV_PBE_SG15
1818
[Run]
1919
type=MD
2020
[MD]
21-
num_steps=50
21+
num_steps=500
2222
dt=40.
2323
thermostat=ON
2424
[Thermostat]
2525
type=Berendsen
26-
temperature=1000.
26+
temperature=300.
2727
relax_time=800.
2828
[Quench]
2929
max_steps=100
@@ -32,4 +32,4 @@ atol=1.e-8
3232
initial_type=Random
3333
initial_width=2.
3434
[Restart]
35-
output_level=0
35+
output_level=4
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
verbosity=1
2+
xcFunctional=PBE
3+
FDtype=4th
4+
[Mesh]
5+
nx=64
6+
ny=64
7+
nz=64
8+
[Domain]
9+
ox=-6.
10+
oy=-6.
11+
oz=-6.
12+
lx=12.
13+
ly=12.
14+
lz=12.
15+
[Potentials]
16+
pseudopotential=pseudo.O_ONCV_PBE_SG15
17+
pseudopotential=pseudo.H_ONCV_PBE_SG15
18+
[Run]
19+
type=MD
20+
[MD]
21+
num_steps=500
22+
dt=40.
23+
thermostat=OFF
24+
[Quench]
25+
max_steps=100
26+
atol=1.e-8
27+
[Orbitals]
28+
initial_type=Random
29+
initial_width=2.
30+
[Restart]
31+
output_level=4

0 commit comments

Comments
 (0)