imdclient 0.1.2__py3-none-any.whl → 0.1.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. imdclient/{IMDREADER.py → IMD.py} +5 -4
  2. imdclient/IMDClient.py +118 -15
  3. imdclient/IMDProtocol.py +1 -0
  4. imdclient/data/gromacs/md/gromacs_v3_nst1.mdp +3 -3
  5. imdclient/data/gromacs/md/gromacs_v3_nst8.mdp +58 -0
  6. imdclient/data/lammps/md/{lammps_v3.in → lammps_v3_nst_1.in} +3 -3
  7. imdclient/data/lammps/md/lammps_v3_nst_8.in +71 -0
  8. imdclient/data/namd/md/{namd_v3.namd → namd_v3_nst_1.namd} +17 -5
  9. imdclient/data/namd/md/namd_v3_nst_8.namd +59 -0
  10. imdclient/tests/base.py +179 -45
  11. imdclient/tests/conftest.py +0 -39
  12. imdclient/tests/datafiles.py +33 -10
  13. imdclient/tests/docker_testing/docker.md +25 -0
  14. imdclient/tests/hpc_testing/gromacs/README.md +112 -0
  15. imdclient/tests/hpc_testing/gromacs/gmx_gpu_test.mdp +58 -0
  16. imdclient/tests/hpc_testing/gromacs/gmx_gpu_test.top +11764 -0
  17. imdclient/tests/hpc_testing/gromacs/struct.gro +21151 -0
  18. imdclient/tests/hpc_testing/gromacs/validate_gmx.sh +90 -0
  19. imdclient/tests/hpc_testing/lammps/README.md +62 -0
  20. imdclient/tests/hpc_testing/lammps/lammps_v3_nst_1.in +71 -0
  21. imdclient/tests/hpc_testing/lammps/topology_after_min.data +8022 -0
  22. imdclient/tests/hpc_testing/lammps/validate_lmp.sh +66 -0
  23. imdclient/tests/hpc_testing/namd/README.md +73 -0
  24. imdclient/tests/hpc_testing/namd/alanin.params +402 -0
  25. imdclient/tests/hpc_testing/namd/alanin.pdb +77 -0
  26. imdclient/tests/hpc_testing/namd/alanin.psf +206 -0
  27. imdclient/tests/hpc_testing/namd/namd_v3_nst_1.namd +59 -0
  28. imdclient/tests/hpc_testing/namd/validate_namd.sh +71 -0
  29. imdclient/tests/server.py +2 -11
  30. imdclient/tests/test_gromacs.py +32 -10
  31. imdclient/tests/test_imdclient.py +69 -0
  32. imdclient/tests/test_imdreader.py +74 -1
  33. imdclient/tests/test_lammps.py +57 -12
  34. imdclient/tests/test_manual.py +223 -65
  35. imdclient/tests/test_namd.py +101 -14
  36. imdclient/tests/test_stream_analysis.py +1 -1
  37. imdclient/tests/utils.py +0 -1
  38. imdclient-0.1.4.dist-info/LICENSE +5 -0
  39. imdclient-0.1.4.dist-info/METADATA +132 -0
  40. imdclient-0.1.4.dist-info/RECORD +57 -0
  41. {imdclient-0.1.2.dist-info → imdclient-0.1.4.dist-info}/WHEEL +1 -1
  42. imdclient/data/gromacs/md/gromacs_v3_nst1.tpr +0 -0
  43. imdclient/data/gromacs/md/gromacs_v3_nst1.trr +0 -0
  44. imdclient/data/lammps/md/lammps_trj.h5md +0 -0
  45. imdclient/data/namd/md/alanin.dcd +0 -0
  46. imdclient-0.1.2.dist-info/LICENSE +0 -674
  47. imdclient-0.1.2.dist-info/METADATA +0 -795
  48. imdclient-0.1.2.dist-info/RECORD +0 -42
  49. {imdclient-0.1.2.dist-info → imdclient-0.1.4.dist-info}/AUTHORS.md +0 -0
  50. {imdclient-0.1.2.dist-info → imdclient-0.1.4.dist-info}/top_level.txt +0 -0
imdclient/tests/base.py CHANGED
@@ -1,4 +1,5 @@
1
1
  from imdclient.IMDClient import IMDClient
2
+ from imdclient.IMD import IMDReader
2
3
  import pytest
3
4
  from pathlib import Path
4
5
  import os
@@ -9,8 +10,11 @@ from numpy.testing import (
9
10
  assert_allclose,
10
11
  )
11
12
  import numpy as np
12
-
13
+ import docker
13
14
  import logging
15
+ import shutil
16
+ import MDAnalysis as mda
17
+ from .utils import get_free_port
14
18
 
15
19
  logger = logging.getLogger("imdclient.IMDClient")
16
20
 
@@ -61,62 +65,192 @@ def assert_allclose_with_logging(a, b, rtol=1e-07, atol=0, equal_nan=False):
61
65
  class IMDv3IntegrationTest:
62
66
 
63
67
  @pytest.fixture()
64
- def run_sim_and_wait(self, tmp_path, command, match_string):
65
- old_cwd = Path.cwd()
66
- os.chdir(tmp_path)
67
- p = subprocess.Popen(
68
- command,
69
- stdout=subprocess.PIPE,
70
- stderr=subprocess.STDOUT,
71
- shell=True,
72
- text=True,
73
- bufsize=0,
74
- preexec_fn=os.setsid,
68
+ def setup_command(self):
69
+ return None
70
+
71
+ @pytest.fixture()
72
+ def port(self):
73
+ yield get_free_port()
74
+
75
+ @pytest.fixture()
76
+ def docker_client(
77
+ self,
78
+ tmp_path,
79
+ input_files,
80
+ setup_command,
81
+ simulation_command,
82
+ port,
83
+ ):
84
+ # In CI, container process needs access to tmp_path
85
+ tmp_path.chmod(0o777)
86
+ docker_client = docker.from_env()
87
+ img = docker_client.images.pull(
88
+ "ghcr.io/becksteinlab/streaming-md-docker:main-Common-CPU"
89
+ )
90
+ # Copy input files into tmp_path
91
+ for inp in input_files:
92
+ shutil.copy(inp, tmp_path)
93
+
94
+ cmdstring = "cd '/tmp'"
95
+ # Run the setup command, if any
96
+ if setup_command is not None:
97
+ # This should be blocking
98
+ cmdstring += " && " + setup_command
99
+
100
+ cmdstring += " && " + simulation_command
101
+
102
+ # Start the container, mount tmp_path, run simulation
103
+ container = docker_client.containers.run(
104
+ img,
105
+ f"/bin/sh -c '{cmdstring}'",
106
+ detach=True,
107
+ volumes={tmp_path.as_posix(): {"bind": "/tmp", "mode": "rw"}},
108
+ ports={"8888/tcp": port},
109
+ name="sim",
110
+ remove=True,
75
111
  )
76
- t = time.time()
77
112
 
78
- for stdout_line in iter(p.stdout.readline, ""):
79
- logger.debug(f"stdout: {stdout_line}")
80
- if match_string in stdout_line:
113
+ # For now, just wait 30 seconds
114
+ # life is too short to figure out how to redirect all stdout from inside
115
+ # a container
116
+ time.sleep(30)
81
117
 
82
- break
83
- if time.time() - t > 10:
84
- raise TimeoutError("Timeout waiting for match string")
118
+ yield
119
+ try:
120
+ container.stop()
121
+ except docker.errors.NotFound:
122
+ pass
85
123
 
86
- logger.debug("Match string found")
87
- yield p
88
- os.chdir(old_cwd)
89
- os.killpg(os.getpgid(p.pid), signal.SIGTERM)
124
+ @pytest.fixture()
125
+ def imd_u(self, docker_client, topol, tmp_path, port):
126
+ u = mda.Universe((tmp_path / topol), f"imd://localhost:{port}")
127
+ with mda.Writer(
128
+ (tmp_path / "imd.trr").as_posix(), u.trajectory.n_atoms
129
+ ) as w:
130
+ for ts in u.trajectory:
131
+ w.write(u.atoms)
132
+ yield mda.Universe((tmp_path / topol), (tmp_path / "imd.trr"))
133
+
134
+ @pytest.fixture()
135
+ def true_u(self, topol, traj, imd_u, tmp_path):
136
+ u = mda.Universe(
137
+ (tmp_path / topol),
138
+ (tmp_path / traj),
139
+ )
140
+ yield u
141
+
142
+ @pytest.fixture()
143
+ def comp_time(self):
144
+ return True
145
+
146
+ @pytest.fixture()
147
+ def comp_dt(self):
148
+ return True
90
149
 
91
150
  @pytest.fixture()
92
- def client(self, run_sim_and_wait, universe):
93
- client = IMDClient("localhost", 8888, universe.trajectory.n_atoms)
94
- yield client
95
- client.stop()
96
-
97
- def test_compare_imd_to_true_traj(self, universe, client, first_frame):
98
- imdsinfo = client.get_imdsessioninfo()
99
-
100
- for ts in universe.trajectory[first_frame:]:
101
- imdf = client.get_imdframe()
102
- if imdsinfo.time:
103
- assert_allclose(imdf.time, ts.time, atol=1e-03)
104
- assert_allclose(imdf.step, ts.data["step"])
105
- if imdsinfo.box:
151
+ def comp_step(self):
152
+ return True
153
+
154
+ def test_compare_imd_to_true_traj(
155
+ self, imd_u, true_u, first_frame, comp_time, comp_dt, comp_step
156
+ ):
157
+ for i in range(first_frame, len(true_u.trajectory)):
158
+ if comp_time:
159
+ assert_allclose(
160
+ true_u.trajectory[i].time,
161
+ imd_u.trajectory[i - first_frame].time,
162
+ atol=1e-03,
163
+ )
164
+ if comp_dt:
165
+ assert_allclose(
166
+ true_u.trajectory[i].dt,
167
+ imd_u.trajectory[i - first_frame].dt,
168
+ atol=1e-03,
169
+ )
170
+ if comp_step:
171
+ assert_allclose(
172
+ true_u.trajectory[i].data["step"],
173
+ imd_u.trajectory[i - first_frame].data["step"],
174
+ )
175
+ if (
176
+ true_u.trajectory[i].dimensions is not None
177
+ and imd_u.trajectory[i - first_frame].dimensions is not None
178
+ ):
106
179
  assert_allclose_with_logging(
107
- imdf.box,
108
- ts.triclinic_dimensions,
180
+ true_u.trajectory[i].dimensions,
181
+ imd_u.trajectory[i - first_frame].dimensions,
109
182
  atol=1e-03,
110
183
  )
111
- if imdsinfo.positions:
184
+ if (
185
+ true_u.trajectory[i].has_positions
186
+ and imd_u.trajectory[i - first_frame].has_positions
187
+ ):
112
188
  assert_allclose_with_logging(
113
- imdf.positions, ts.positions, atol=1e-03
189
+ true_u.trajectory[i].positions,
190
+ imd_u.trajectory[i - first_frame].positions,
191
+ atol=1e-03,
114
192
  )
115
- if imdsinfo.velocities:
193
+ if (
194
+ true_u.trajectory[i].has_velocities
195
+ and imd_u.trajectory[i - first_frame].has_velocities
196
+ ):
116
197
  assert_allclose_with_logging(
117
- imdf.velocities, ts.velocities, atol=1e-03
198
+ true_u.trajectory[i].velocities,
199
+ imd_u.trajectory[i - first_frame].velocities,
200
+ atol=1e-03,
118
201
  )
119
- if imdsinfo.forces:
202
+ if (
203
+ true_u.trajectory[i].has_forces
204
+ and imd_u.trajectory[i - first_frame].has_forces
205
+ ):
120
206
  assert_allclose_with_logging(
121
- imdf.forces, ts.forces, atol=1e-03
207
+ true_u.trajectory[i].forces,
208
+ imd_u.trajectory[i - first_frame].forces,
209
+ atol=1e-03,
122
210
  )
211
+
212
+ def test_continue_after_disconnect(
213
+ self, docker_client, topol, tmp_path, port
214
+ ):
215
+ u = mda.Universe(
216
+ (tmp_path / topol),
217
+ f"imd://localhost:{port}",
218
+ continue_after_disconnect=True,
219
+ # Make sure LAMMPS topol can be read
220
+ # Does nothing if not LAMMPS
221
+ atom_style="id type x y z",
222
+ )
223
+ # Though we disconnect here, the simulation should continue
224
+ u.trajectory.close()
225
+ # Wait for the simulation to finish running
226
+ time.sleep(45)
227
+
228
+ # Now, attempt to reconnect- should fail,
229
+ # since the simulation should have continued
230
+ with pytest.raises(IOError):
231
+ u = mda.Universe(
232
+ (tmp_path / topol),
233
+ f"imd://localhost:{port}",
234
+ atom_style="id type x y z",
235
+ )
236
+
237
+ def test_wait_after_disconnect(self, docker_client, topol, tmp_path, port):
238
+ u = mda.Universe(
239
+ (tmp_path / topol),
240
+ f"imd://localhost:{port}",
241
+ # Could also use None here- just being explicit
242
+ continue_after_disconnect=False,
243
+ # Make sure LAMMPS topol can be read
244
+ # Does nothing if not LAMMPS
245
+ atom_style="id type x y z",
246
+ )
247
+ u.trajectory.close()
248
+ # Give the simulation engine
249
+ # enough time to finish running (though it shouldn't)
250
+ time.sleep(45)
251
+
252
+ u = mda.Universe(
253
+ (tmp_path / topol),
254
+ f"imd://localhost:{port}",
255
+ atom_style="id type x y z",
256
+ )
@@ -1,42 +1,3 @@
1
1
  """
2
2
  Global pytest fixtures
3
3
  """
4
-
5
-
6
- # Command line arguments for 'test_manual.py'
7
- def pytest_addoption(parser):
8
- parser.addoption(
9
- "--topol_path_arg",
10
- action="store",
11
- default=None,
12
- )
13
- parser.addoption(
14
- "--traj_path_arg",
15
- action="store",
16
- default=None,
17
- )
18
- parser.addoption(
19
- "--first_frame_arg", action="store", type=int, default=None
20
- )
21
-
22
-
23
- def pytest_generate_tests(metafunc):
24
- # This is called for every test. Only get/set command line arguments
25
- # if the argument is specified in the list of test "fixturenames".
26
- topol = metafunc.config.option.topol_path_arg
27
- traj = metafunc.config.option.traj_path_arg
28
- first_frame = metafunc.config.option.first_frame_arg
29
-
30
- if all(
31
- arg in metafunc.fixturenames
32
- for arg in ["topol_path_arg", "traj_path_arg", "first_frame_arg"]
33
- ):
34
- if topol is None or traj is None or first_frame is None:
35
- raise ValueError(
36
- "Must pass all three of '--topol_path_arg <path/to/topology>', "
37
- + "'--traj_path_arg <path/to/trajectory>', "
38
- + "'--first_frame_arg <first traj frame to compare to IMD>"
39
- )
40
- metafunc.parametrize("topol_path_arg", [topol])
41
- metafunc.parametrize("traj_path_arg", [traj])
42
- metafunc.parametrize("first_frame_arg", [first_frame])
@@ -8,7 +8,22 @@ Use as ::
8
8
 
9
9
  """
10
10
 
11
- __all__ = ["LAMMPS_IN", "LAMMPS_TOPOL", "GROMACS_TRAJ", "GROMACS_MDP"]
11
+ __all__ = [
12
+ "LAMMPS_TOPOL",
13
+ "LAMMPS_IN_NST_1",
14
+ "LAMMPS_IN_NST_8",
15
+ "GROMACS_TRAJ",
16
+ "GROMACS_MDP",
17
+ "GROMACS_TOP" "LAMMPS_IN_NST_1",
18
+ "GROMACS_GRO",
19
+ "GROMACS_MDP_NST_1",
20
+ "GROMACS_MDP_NST_8",
21
+ "NAMD_TOPOL",
22
+ "NAMD_CONF_NST_1",
23
+ "NAMD_CONF_NST_8",
24
+ "NAMD_PARAMS",
25
+ "NAMD_PSF",
26
+ ]
12
27
 
13
28
  from importlib import resources
14
29
  from pathlib import Path
@@ -16,18 +31,26 @@ from pathlib import Path
16
31
  _data_ref = resources.files("imdclient.data")
17
32
 
18
33
  LAMMPS_TOPOL = (_data_ref / "lammps" / "md" / "lammps_topol.data").as_posix()
19
- LAMMPS_IN = (_data_ref / "lammps" / "md" / "lammps_v3.in").as_posix()
20
- LAMMPS_TRAJ = (_data_ref / "lammps" / "md" / "lammps_trj.h5md").as_posix()
21
- GROMACS_TRAJ = (
22
- _data_ref / "gromacs" / "md" / "gromacs_v3_nst1.trr"
34
+ LAMMPS_IN_NST_1 = (
35
+ _data_ref / "lammps" / "md" / "lammps_v3_nst_1.in"
23
36
  ).as_posix()
24
- GROMACS_TOPOL = (
25
- _data_ref / "gromacs" / "md" / "gromacs_struct.gro"
37
+ LAMMPS_IN_NST_8 = (
38
+ _data_ref / "lammps" / "md" / "lammps_v3_nst_8.in"
26
39
  ).as_posix()
27
- GROMACS_TPR = (_data_ref / "gromacs" / "md" / "gromacs_v3_nst1.tpr").as_posix()
40
+
41
+
42
+ GROMACS_GRO = (_data_ref / "gromacs" / "md" / "gromacs_struct.gro").as_posix()
43
+ GROMACS_MDP_NST_1 = (
44
+ _data_ref / "gromacs" / "md" / "gromacs_v3_nst1.mdp"
45
+ ).as_posix()
46
+ GROMACS_MDP_NST_8 = (
47
+ _data_ref / "gromacs" / "md" / "gromacs_v3_nst8.mdp"
48
+ ).as_posix()
49
+ GROMACS_TOP = (_data_ref / "gromacs" / "md" / "gromacs_v3.top").as_posix()
50
+
28
51
  NAMD_TOPOL = (_data_ref / "namd" / "md" / "alanin.pdb").as_posix()
29
- NAMD_CONF = (_data_ref / "namd" / "md" / "namd_v3.namd").as_posix()
30
- NAMD_TRAJ = (_data_ref / "namd" / "md" / "alanin.dcd").as_posix()
52
+ NAMD_CONF_NST_1 = (_data_ref / "namd" / "md" / "namd_v3_nst_1.namd").as_posix()
53
+ NAMD_CONF_NST_8 = (_data_ref / "namd" / "md" / "namd_v3_nst_8.namd").as_posix()
31
54
  NAMD_PARAMS = (_data_ref / "namd" / "md" / "alanin.params").as_posix()
32
55
  NAMD_PSF = (_data_ref / "namd" / "md" / "alanin.psf").as_posix()
33
56
 
@@ -0,0 +1,25 @@
1
+ # Running simulation engines compiled for GPU acceleration from a container
2
+
3
+ Ensure [docker](https://www.docker.com/) and the [NVIDIA container toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) are installed.
4
+
5
+
6
+ To run the container:
7
+ ```bash
8
+ docker pull ghcr.io/becksteinlab/streaming-md-docker:main-Common-GPU
9
+
10
+ docker run -v $PWD/imdclient/data:/home/conda:rw -it --runtime=nvidia --gpus=all \
11
+ ghcr.io/becksteinlab/streaming-md-docker:main-Common-GPU
12
+ ```
13
+
14
+ To run each simulation engine with repository simulation configurations:
15
+ ```bash
16
+ cd /home/conda/namd/md
17
+ namd3 +devices 0 namd_v3.namd
18
+
19
+ cd /home/conda/gromacs/md
20
+ gmx grompp -f gromacs_v3_nst1.mdp -c gromacs_struct.gro -p gromacs_v3.top
21
+ gmx mdrun -s topol.tpr -nb gpu
22
+
23
+ cd /home/conda/lammps/md
24
+ lmp -sf gpu < lammps_v3_nst_1.in
25
+ ```
@@ -0,0 +1,112 @@
1
+ # Manual validation of different compiler options for GROMACS using ASU's SOL
2
+
3
+ ### Running tests
4
+
5
+ To validate all IMDv3 output (time, integration step, dt, box, positions, velocities, and forces)
6
+ against TRR output with a simple sample simulation, first ensure you're using a
7
+ python environment which has the testing requirements of IMDClient installed.
8
+
9
+ If not already installed, do:
10
+ ```bash
11
+ conda env create -n imdclient-test -f devtools/conda-envs/test_env.yaml -y
12
+ conda activate imdclient-test
13
+ ```
14
+
15
+ Equivalently, on ASU's Sol, do:
16
+ ```bash
17
+ module load mamba
18
+ # Only needed for MPI builds
19
+ module load openmpi/4.1.5
20
+ conda env create -n imdclient-test -f devtools/conda-envs/test_env.yaml -y
21
+ source activate imdclient-test
22
+ ```
23
+
24
+ Then, to run the tests, do:
25
+ ```bash
26
+ cd imdclient/tests/hpc_testing/gromacs
27
+ chmod +x validate_gmx.sh
28
+
29
+ ./validate_gmx.sh \
30
+ --gmx_binary /path/to/gmx
31
+ ```
32
+
33
+ Or, for MPI builds,
34
+ ```bash
35
+ ./validate_gmx.sh \
36
+ --gmx_binary /path/to/gmx \
37
+ --mpi
38
+ ```
39
+
40
+ To validate against your own simulation files, see `validate_gmx.sh` for
41
+ command line arguments.
42
+
43
+ ### Compiling on ASU's Sol supercomputer
44
+
45
+ Allocate a GPU node on SOL and clone in https://gitlab.com/ljwoods2/gromacs.git
46
+
47
+ After cloning, do:
48
+ ```bash
49
+ git checkout imd-v3
50
+ module load cmake/3.30.2
51
+ module load gcc-12.1.0-gcc-11.2.0
52
+ moudle load cuda-12.6.1-gcc-12.1.0
53
+ module load openmpi/4.1.5
54
+
55
+ mkdir -p build_gpu
56
+ cd build_gpu
57
+
58
+ cmake .. -DGMX_BUILD_OWN_FFTW=ON -DGMX_GPU=CUDA -DGMX_MPI=ON
59
+ make -j 4
60
+ make install
61
+ source /your/installation/prefix/here/bin/GMXRC
62
+ ```
63
+ <!--
64
+ After GROMACS has been built, change into the directory containing this file.
65
+
66
+ To test on one node, run this in the shell (assuming there are 4 cores available):
67
+ ```bash
68
+ /home/ljwoods2/workspace/gromacs/build_mpi/bin/gmx grompp \
69
+ -f gmx_gpu_test.mdp \
70
+ -c struct.gro \
71
+ -p gmx_gpu_test.top \
72
+ -imd struct_imd.gro \
73
+ -o gmx_gpu_test.tpr \
74
+ -maxwarn 1
75
+
76
+ /home/ljwoods2/workspace/gromacs/build_mpi/bin/gmx mdrun \
77
+ -s gmx_gpu_test.tpr \
78
+ -o gmx_gpu_test.trr \
79
+ -imdwait \
80
+ -ntmpi 2 \
81
+ -ntomp 2
82
+ ```
83
+ 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):
84
+
85
+ ```bash
86
+ module load openmpi/4.1.5
87
+
88
+ /home/ljwoods2/workspace/gromacs/build_mpi/bin/mpirun \
89
+ -np 4 \
90
+ gmx_mpi mdrun \
91
+ -s gmx_gpu_test.tpr \
92
+ -o gmx_gpu_test.trr \
93
+ -imdwait \
94
+ -ntomp 4 \
95
+ -gpu_id 0
96
+ ```
97
+
98
+ And in a different shell (from the same directory), run the following commands:
99
+
100
+ ```bash
101
+ module load mamba
102
+ # Environment containing IMDClient
103
+ source activate imdclient-test
104
+
105
+ mkdir tmp_test
106
+
107
+ python imdclient/tests/test_manual.py \
108
+ --topol_arg imdclient/tests/hpc_testing/gromacs/struct.gro \
109
+ --traj_arg imdclient/tests/hpc_testing/gromacs/gmx_gpu_test.trr \
110
+ --first_frame_arg 0 \
111
+ --tmp_path tmp_test
112
+ ``` -->
@@ -0,0 +1,58 @@
1
+ title = PRODUCTION IN NPT
2
+ ld-seed = 1
3
+ ; Run parameters
4
+ integrator = md ; leap-frog integrator
5
+ nsteps = 1000 ; 1 * 1000 = 1 ps
6
+ dt = 0.001 ; 1 fs
7
+ ; Output control
8
+ nstxout = 10 ; save coordinates every 10 fs
9
+ nstvout = 10 ; save velocities every 10 fs
10
+ nstfout = 10
11
+ nstenergy = 10 ; save energies every 10 fs
12
+ nstlog = 10 ; update log file every 10 fs
13
+ ; Center of mass (COM) motion
14
+ nstcomm = 10 ; remove COM motion every 10 steps
15
+ comm-mode = Linear ; remove only COM translation (liquids in PBC)
16
+ ; Bond parameters
17
+ continuation = yes ; first dynamics run
18
+ constraint_algorithm = lincs ; holonomic constraints
19
+ constraints = all-bonds ; all bonds lengths are constrained
20
+ lincs_iter = 1 ; accuracy of LINCS
21
+ lincs_order = 4 ; also related to accuracy
22
+ ; Nonbonded settings
23
+ cutoff-scheme = Verlet ; Buffered neighbor searching
24
+ ns_type = grid ; search neighboring grid cells
25
+ nstlist = 10 ; 10 fs, largely irrelevant with Verlet
26
+ rcoulomb = 1.0 ; short-range electrostatic cutoff (in nm)
27
+ rvdw = 1.0 ; short-range van der Waals cutoff (in nm)
28
+ DispCorr = EnerPres ; account for cut-off vdW scheme
29
+ ; Electrostatics
30
+ coulombtype = PME ; Particle Mesh Ewald for long-range electrostatics
31
+ pme_order = 4 ; cubic interpolation
32
+ fourierspacing = 0.12 ; grid spacing for FFT
33
+ ; Temperature coupling is on
34
+ tcoupl = Nose-Hoover ; good for production, after equilibration
35
+ ; we define separate thermostats for the solute and solvent (need to adapt)
36
+ ; see default groups defined by Gromacs for your system or define your own (make_ndx)
37
+ tc-grps = Protein SOL ; the separate groups for the thermostats
38
+ tau-t = 1.0 1.0 ; time constants for thermostats (ps)
39
+ ref-t = 300 300 ; reference temperature for thermostats (K)
40
+ ; Pressure coupling is off
41
+ pcoupl = Parrinello-Rahman ; good for production, after equilibration
42
+ tau-p = 2.0 ; time constant for barostat (ps)
43
+ compressibility = 4.5e-5 ; compressibility (1/bar) set to water at ~300K
44
+ ref-p = 1.0 ; reference pressure for barostat (bar)
45
+ ; Periodic boundary conditions
46
+ pbc = xyz ; 3-D PBC
47
+ ; Velocity generation
48
+ gen_vel = no
49
+ IMD-group = System
50
+ IMD-nst = 10
51
+ IMD-version = 3
52
+ IMD-time = yes
53
+ IMD-box = yes
54
+ IMD-coords = yes
55
+ IMD-unwrap = no
56
+ IMD-vels = yes
57
+ IMD-forces = yes
58
+ IMD-energies = yes