Skip to content

Commit da7c510

Browse files
Enhance mdrun scripts to explicitly set MPT thread parameters
- Updated mdprep.sh and mdrun.sh to define MPT thread settings explicitly, avoiding potential conflicts. - Replaced direct verbosity flag usage with a consolidated MDPREP_FLAGS array for improved maintainability.
1 parent c7f11e7 commit da7c510

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

scripts/mdrun/mdprep.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ EQUILIBRATION_NPT=step4.2_equilibration
99
EQUILIBRATION_NPT_NO_RESTRAINTS=step4.3_equilibration
1010
PRODUCTION=step5_production
1111

12+
# Set the number of (thread) MPT explicitly to avoid conflicting demands
13+
MDPREP_FLAGS=(
14+
-v
15+
-ntmpi 1
16+
-ntomp "${OMP_NUM_THREADS}"
17+
)
18+
1219
if [[ -s "${PRODUCTION}".cpt ]]; then
1320
echo "Checkpoint file for production exists. Skipping pre-processing step."
1421
exit 0
@@ -29,7 +36,7 @@ gmx grompp \
2936
-n index.ndx
3037
gmx mdrun \
3138
-deffnm "${MINIMIZATION}" \
32-
-v
39+
"${MDPREP_FLAGS[@]}"
3340

3441
printf "Potential\n\n" | gmx energy \
3542
-f "${MINIMIZATION}".edr \
@@ -51,7 +58,7 @@ gmx grompp \
5158
-n index.ndx
5259
gmx mdrun \
5360
-deffnm "${EQUILIBRATION_NVT}" \
54-
-v
61+
"${MDPREP_FLAGS[@]}"
5562

5663
printf "Temperature\n\n" | gmx energy \
5764
-f "${EQUILIBRATION_NVT}".edr \
@@ -75,7 +82,7 @@ gmx grompp \
7582
-n index.ndx
7683
gmx mdrun \
7784
-deffnm "${EQUILIBRATION_NPT}" \
78-
-v
85+
"${MDPREP_FLAGS[@]}"
7986

8087
printf "Pressure\n\n" | gmx energy \
8188
-f "${EQUILIBRATION_NPT}".edr \
@@ -117,7 +124,7 @@ gmx grompp \
117124
-n index.ndx
118125
gmx mdrun \
119126
-deffnm "${EQUILIBRATION_NPT_NO_RESTRAINTS}" \
120-
-v
127+
"${MDPREP_FLAGS[@]}"
121128

122129
printf "Pressure\n\n" | gmx energy \
123130
-f "${EQUILIBRATION_NPT_NO_RESTRAINTS}".edr \

scripts/mdrun/mdrun.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ set -euo pipefail
44

55
PRODUCTION=step5_production
66

7-
# -ntmpi 1 -ntomp ${OMP_NUM_THREADS} are set automatically by the scheduler
7+
# Set the number of (thread) MPT explicitly to avoid conflicting demands
88
MDRUN_FLAGS=(
99
-v
10+
-ntmpi 1
11+
-ntomp "${OMP_NUM_THREADS}"
1012
-pin on # pin threads to cores
1113
-pmefft gpu
1214
-bonded gpu

0 commit comments

Comments
 (0)