made run.sh use physical cores

This commit is contained in:
Robin
2025-08-13 15:07:39 +02:00
parent 2bed210ed8
commit 076b8d090c

View File

@@ -4,17 +4,18 @@
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
#SBATCH --gres=gpu:1
#SBATCH --exclude=linux-05,linux-08,linux-02,linux-03,linux-04,linux-07
##SBATCH --exclude=linux-05,linux-06,linux-07,linux-08
#if [ "$(gmx --version | grep "GROMACS version")" != GROMACS*2025.2* ] ; then
# echo "Version loaded is not 2025.2! Exiting!"
#if [ "$(gmx --version | grep "GROMACS version")" != GROMACS*2023.3* ] ; then
# echo "Version loaded is not 2023.3! Exiting!"
# exit 1
#fi
PHYS_CORES=$(lscpu | awk -F: '/Core\(s\) per socket/ {print $2+0}')
if [ -n "$SLURM_CPUS_PER_TASK" ]; then
NT="-nt $SLURM_CPUS_PER_TASK"
elif [ $(nproc) -lt 9 ] ; then
NT="-nt $(nproc)"
elif [ "$PHYS_CORES" -lt 9 ] ; then
NT="-nt $PHYS_CORES"
else
NT="-nt 8"
fi
@@ -29,7 +30,7 @@ mkdir -p "$WORKDIR/out"
export GMX_MAXCONSTRWARN=-1;
gmx -nobackup grompp \
-f $WORKDIR/mdp_parameters.mdp \
-o $WORKDIR/tpr_run.tpr \
-o $WORKDIR/out/tpr_run.tpr \
-c $WORKDIR/gro_start.gro \
-r $WORKDIR/gro_start.gro \
-p $WORKDIR/topology.top \
@@ -42,7 +43,7 @@ if [ $? != 0 ] ; then
fi
gmx mdrun \
-s $WORKDIR/tpr_run.tpr \
-s $WORKDIR/out/tpr_run.tpr \
-o $WORKDIR/out/trr_traj.trr \
-c $WORKDIR/out/out.gro \
-x $WORKDIR/out/xtc_traj.xtc \