Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

passing gromacs tests #21

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
title = PRODUCTION IN NPT
ld-seed = 1
ld-seed = 1
; Run parameters
integrator = md ; leap-frog integrator
nsteps = 100 ; 1 * 1000 = 1 ps
dt = 0.001 ; 1 fs
; Output control
nstxout = 1 ; save coordinates every 1 fs
nstvout = 1 ; save velocities every 1 fs
nstxout = 1 ; save coordinates every 1 ps
nstvout = 1 ; save velocities every 1 ps
nstfout = 1
nstenergy = 1 ; save energies every 1 fs
nstlog = 10 ; update log file every 1 ps
nstenergy = 1 ; save energies every 1 ps
nstlog = 1 ; update log file every 1 ps
; Center of mass (COM) motion
nstcomm = 10 ; remove COM motion every 10 steps
comm-mode = Linear ; remove only COM translation (liquids in PBC)
Expand All @@ -31,7 +31,7 @@ coulombtype = PME ; Particle Mesh Ewald for long-range electro
pme_order = 4 ; cubic interpolation
fourierspacing = 0.12 ; grid spacing for FFT
; Temperature coupling is on
tcoupl = Nose-Hoover ; good for production, after equilibration
tcoupl = Berendsen ; good for production, after equilibration
; we define separate thermostats for the solute and solvent (need to adapt)
; see default groups defined by Gromacs for your system or define your own (make_ndx)
tc-grps = Protein SOL ; the separate groups for the thermostats
Expand Down
Binary file not shown.
Binary file not shown.
21,151 changes: 21,151 additions & 0 deletions imdclient/data/gromacs/md/struct_imd.gro

Large diffs are not rendered by default.

73 changes: 73 additions & 0 deletions imdclient/data/namd/md/alanin.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This is a test namd configuration file

timestep 0.5
numsteps 10
structure alanin.psf
parameters alanin.params
coordinates alanin.pdb
exclude scaled1-4
1-4scaling 0.4
outputname output[myReplica]
margin 1.0
stepspercycle 3
temperature 0

switching on
switchdist 7.0
cutoff 8.0
pairlistdist 9.0

dcdfile alanin.dcd
dcdfreq 1
# If Box dimensions are defined, the DCD file can contain the box dimensions via the following
#DCDunitcell yes

velDCDfile alanin.vel
velDCDfreq 1

forceDCDfile alanin.force
forceDCDfreq 1

#restartname alanin.restart
#restartfreq 10

#langevin on
#langevinTemp 300.0
#langevincol O

#constraints on

#fma on

seed 12345

# IMD parameters

# standard IMD parameters
# IMDon streaming -- on or off
IMDon yes
# IMDport -- port number to listen on
IMDport 8888
# IMDfreq -- frequency to send data
IMDfreq 1
# IMDwait -- wait for client to connect before starting simulation
IMDwait on

# IMD version -- 2 for VMD and 3 for latest protocol
IMDversion 3
# IMD session info settings
# IMDsendPositions -- sending positions of entire system
IMDsendPositions yes
# IMDsendEnergies -- sending energies and bonded, non-bonded and other contributions
IMDsendEnergies yes
# IMDsendTime -- sending time information (time, dt, step)
IMDsendTime yes
# IMDsendBoxDimensions -- sending box dimensions (lattice vectors a, b, c)
# If box dimensions are not defined, default unit box is sent
IMDsendBoxDimensions yes
# IMDsendVelocities -- sending velocities of entire system
IMDsendVelocities yes
# IMDsendForces -- sending forces on all atoms
IMDsendForces yes
# IMDwrapPositions -- wrapping positions to box; applicable when IMDsendPositions is yes
IMDwrapPositions yes
47 changes: 0 additions & 47 deletions imdclient/data/namd/md/namd_v3.namd

This file was deleted.

14 changes: 14 additions & 0 deletions imdclient/data/namd/md/openmpi-sol.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Load the necessary module
module load openmpi/4.1.5

# Set CPATH environment variable
export CPATH="/packages/apps/pmix/4.1.3-slurm/include:$CPATH"

# Set LIBRARY_PATH environment variable
export LIBRARY_PATH="/packages/apps/pmix/4.1.3-slurm/lib:$LIBRARY_PATH"

# Optional: Print the variables to verify they are set
echo "CPATH is set to: $CPATH"
echo "LIBRARY_PATH is set to: $LIBRARY_PATH"
20 changes: 13 additions & 7 deletions imdclient/tests/datafiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@

"""

__all__ = ["LAMMPS_IN", "LAMMPS_TOPOL", "GROMACS_TRAJ", "GROMACS_MDP"]
__all__ = [
"LAMMPS_IN",
"LAMMPS_TOPOL",
"GROMACS_TRAJ",
"GROMACS_TOPOL",
"GROMACS_TPR",
]

from importlib import resources
from pathlib import Path
Expand All @@ -19,15 +25,15 @@
LAMMPS_IN = (_data_ref / "lammps" / "md" / "lammps_v3.in").as_posix()
LAMMPS_TRAJ = (_data_ref / "lammps" / "md" / "lammps_trj.h5md").as_posix()
GROMACS_TRAJ = (
_data_ref / "gromacs" / "md" / "gromacs_v3_nst1.trr"
_data_ref / "gromacs" / "md" / "gmx_serial_test.trr"
).as_posix()
GROMACS_TOPOL = (
_data_ref / "gromacs" / "md" / "gromacs_struct.gro"
).as_posix()
GROMACS_TPR = (_data_ref / "gromacs" / "md" / "gromacs_v3_nst1.tpr").as_posix()
GROMACS_TOPOL = (_data_ref / "gromacs" / "md" / "struct.gro").as_posix()
GROMACS_TPR = (_data_ref / "gromacs" / "md" / "gmx_serial_test.tpr").as_posix()
NAMD_TOPOL = (_data_ref / "namd" / "md" / "alanin.pdb").as_posix()
NAMD_CONF = (_data_ref / "namd" / "md" / "namd_v3.namd").as_posix()
NAMD_CONF = (_data_ref / "namd" / "md" / "alanin.namd").as_posix()
NAMD_TRAJ = (_data_ref / "namd" / "md" / "alanin.dcd").as_posix()
NAMD_VEL = (_data_ref / "namd" / "md" / "alanin.vel").as_posix()
NAMD_FORCE = (_data_ref / "namd" / "md" / "alanin.force").as_posix()
NAMD_PARAMS = (_data_ref / "namd" / "md" / "alanin.params").as_posix()
NAMD_PSF = (_data_ref / "namd" / "md" / "alanin.psf").as_posix()

Expand Down
69 changes: 69 additions & 0 deletions imdclient/tests/hpc_testing/gromacs/gromacs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Manual validation of different compiler options for GROMACS using ASU's SOL

## GPU, MPI, threading

Allocate a GPU node on SOL and clone in https://github.com/hcho38/gromacs.git

After cloning, do:
```bash
git checkout imd-v3
module load cmake-3.21.4-gcc-11.2.0
module load gcc-10.3.0-gcc-11.2.0
module load cuda-11.7.0-gcc-11.2.0
module load openmpi/4.1.5

mkdir -p build_gpu
cd build_gpu

cmake .. -DGMX_BUILD_OWN_FFTW=ON -DGMX_GPU=CUDA -DGMX_MPI=ON
make -j 4
make install
source /your/installation/prefix/here/bin/GMXRC
```

After GROMACS has been built, change into the directory containing this file.

To test on one node, run this in the shell (assuming there are 4 cores available):
```bash
/home/ljwoods2/workspace/gromacs/build_mpi/bin/gmx grompp \
-f gmx_gpu_test.mdp \
-c struct.gro \
-p gmx_gpu_test.top \
-imd struct_imd.gro \
-o gmx_gpu_test.tpr \
-maxwarn 1

/home/ljwoods2/workspace/gromacs/build_mpi/bin/gmx mdrun \
-s gmx_gpu_test.tpr \
-o gmx_gpu_test.trr \
-imdwait \
-ntmpi 2 \
-ntomp 2
```
To test on multiple nodes, run this in the shell (assuming there are 4 nodes and 16 cores available, with 1 GPU on each node):

```bash
module load openmpi/4.1.5

/home/ljwoods2/workspace/gromacs/build_mpi/bin/mpirun \
-np 4 \
gmx_mpi mdrun \
-s gmx_gpu_test.tpr \
-o gmx_gpu_test.trr \
-imdwait \
-ntomp 4 \
-gpu_id 0
```

And in a different shell (from the same directory), run the following commands:

```bash
module load mamba
# Environment containing IMDClient
source activate imdclient-test

pytest -s ../../test_manual.py \
--topol_arg struct.gro \
--traj_arg gmx_gpu_test.trr \
--first_frame_arg 0
```
58 changes: 58 additions & 0 deletions imdclient/tests/hpc_testing/gromacs/run.mdp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
title = PRODUCTION IN NPT
ld-seed = 1
; Run parameters
integrator = md ; leap-frog integrator
nsteps = 1000 ; 1 * 1000 = 1 ps
dt = 0.001 ; 1 fs
; Output control
nstxout = 10 ; save coordinates every 10 fs
nstvout = 10 ; save velocities every 10 fs
nstfout = 10
nstenergy = 10 ; save energies every 10 fs
nstlog = 10 ; update log file every 10 fs
; Center of mass (COM) motion
nstcomm = 10 ; remove COM motion every 10 steps
comm-mode = Linear ; remove only COM translation (liquids in PBC)
; Bond parameters
continuation = yes ; first dynamics run
constraint_algorithm = lincs ; holonomic constraints
constraints = all-bonds ; all bonds lengths are constrained
lincs_iter = 1 ; accuracy of LINCS
lincs_order = 4 ; also related to accuracy
; Nonbonded settings
cutoff-scheme = Verlet ; Buffered neighbor searching
ns_type = grid ; search neighboring grid cells
nstlist = 10 ; 10 fs, largely irrelevant with Verlet
rcoulomb = 1.0 ; short-range electrostatic cutoff (in nm)
rvdw = 1.0 ; short-range van der Waals cutoff (in nm)
DispCorr = EnerPres ; account for cut-off vdW scheme
; Electrostatics
coulombtype = PME ; Particle Mesh Ewald for long-range electrostatics
pme_order = 4 ; cubic interpolation
fourierspacing = 0.12 ; grid spacing for FFT
; Temperature coupling is on
tcoupl = Nose-Hoover ; good for production, after equilibration
; we define separate thermostats for the solute and solvent (need to adapt)
; see default groups defined by Gromacs for your system or define your own (make_ndx)
tc-grps = Protein SOL ; the separate groups for the thermostats
tau-t = 1.0 1.0 ; time constants for thermostats (ps)
ref-t = 300 300 ; reference temperature for thermostats (K)
; Pressure coupling is off
pcoupl = Parrinello-Rahman ; good for production, after equilibration
tau-p = 2.0 ; time constant for barostat (ps)
compressibility = 4.5e-5 ; compressibility (1/bar) set to water at ~300K
ref-p = 1.0 ; reference pressure for barostat (bar)
; Periodic boundary conditions
pbc = xyz ; 3-D PBC
; Velocity generation
gen_vel = no
IMD-group = System
IMD-nst = 10
IMD-version = 3
IMD-time = yes
IMD-box = yes
IMD-coords = yes
IMD-unwrap = no
IMD-vels = yes
IMD-forces = yes
IMD-energies = yes
Loading
Loading