#!/bin/bash # Copyright # Copyright (C) 2022 by Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT #SBATCH --wait-all-nodes=1 #SBATCH --ntasks-per-node=64 #SBATCH --cpus-per-task=1 #SBATCH --ntasks-per-core=1 #SBATCH --export=ALL #SBATCH --exclusive #SBATCH -o XXPREFIXXX/log/gromacs.out #--------------------------- customized Job env ----------------------------- #SBATCH --nodes=2 #SBATCH --partition=c6i PREFIX=XXPREFIXXX export GROMACS_VERSION=2022.4 export JOB_DIR=${PREFIX}/spooler/gromacs export JOB_INPUT="test_aws.tpr" #---------------------------------------------------------------------------- #ENV VARIABLES# #------------------------------- Run-time env ------------------------------- # compiler & MPI selection # compiler table: # --------------- # 0 VENDOR's compiler, Intel=icc, AMD=armclang, ARM=armgcc # 1 GNU/GCC compiler # 2 GNU/CLANG compiler # 3 INTEL/ICC compiler # 4 INTEL/ICX compiler # 5 AMD/CLANG compiler # 6 ARM/GCC compiler # 7 ARM/CLANG compiler # # # MPI table: # ---------- # 0 openmpi # 1 mpich # 2 intelmpi # 3 mvapich # # usage: env.sh # C M # env.sh 0 0 ## select vendor's native compilers with openmpi # env.sh 0 1 ## select vendor's native compilers with mpich # env.sh 0 2 ## select vendor's native compilers with intelmpi # env.sh 0 3 ## select vendor's native compilers with mvapich # env.sh 1 0 ## select GNU/GCC compilers with openmpi # env.sh ... source ${PREFIX}/scripts/env.sh 1 0 #---------------------------------------------------------------------------- LOGDIR=${PREFIX}/log GROMACS_LOG=${LOGDIR}/mpirun_${SARCH}_${HPC_COMPILER}_${HPC_MPI}_gromacs-${GROMACS_VERSION}.log mkdir -p ${LOGDIR} NTOMP=2 NSTEPS=20000 ulimit -s unlimited #export MKL_NUM_THREADS=1 #export OMP_NUM_THREADS=1 HPC_MPI_DEBUG=1 # load MPI settings source ${PREFIX}/scripts/mpi_settings.sh echo "Running GROMACS on $(date)" cd ${JOB_DIR} START_DATE=$(date) echo "zzz *** ${START_DATE} *** - JobStart - $(basename ${JOB_DIR}) - ${HPC_COMPILER} - ${HPC_MPI}" >> ${GROMACS_LOG} 2>&1 mpirun ${MPI_SHOW_BIND_OPTS} gmx_mpi mdrun -nsteps ${NSTEPS} -ntomp ${NTOMP} -s ${JOB_INPUT} >> ${GROMACS_LOG} 2>&1 END_DATE=$(date) echo "zzz *** ${END_DATE} *** - JobEnd - $(basename ${JOB_DIR}) - ${HPC_COMPILER} - ${HPC_MPI}" >> ${GROMACS_LOG} 2>&1 JOB_FINISH_TIME=$(($(date -d "${END_DATE}" +%s)-$(date -d "${START_DATE}" +%s))) echo "zzz *** $(date) *** - Job ${JOB_DIR} took ${JOB_FINISH_TIME} seconds($(echo "scale=5;${JOB_FINISH_TIME}/3600" | bc) hours)." >> ${GROMACS_LOG} 2>&1