Skip to content

Commit

Permalink
Allow run script to be used not only for CP2K.
Browse files Browse the repository at this point in the history
  • Loading branch information
hfp committed Feb 7, 2025
1 parent 21ebf08 commit 945a288
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions config/cp2k/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,16 @@ fi

if [ "$1" ]; then
if [ -f "$1" ]; then
WORKLOAD=$1
else
>&2 echo "ERROR: $1 not found!"
WORKLOAD=$(cd "$(dirname "$1")" && pwd -P)/$(basename "$1")
shift
elif [ "${EXEVER}" ]; then
>&2 echo "ERROR: workload $1 is not an input file!"
exit 1
fi
shift
else
elif [ "${EXEVER}" ]; then
>&2 echo "Please use: $0 /file/to/workload.inp [ranks-per-node [num-nodes]]"
exit 1
fi
WORKLOAD=$(cd "$(dirname "${WORKLOAD}")" && pwd -P)/$(basename "${WORKLOAD}")

if [ "$(command -v lscpu)" ]; then
NS=$(lscpu | grep -m1 "Socket(s)" | tr -d " " | cut -d: -f2)
Expand Down Expand Up @@ -144,8 +143,10 @@ PREFX=${HPCWL_COMMAND_PREFIX}
# additional command-line arguments
ARGS="$*"

EXEVER=${EXEVER:-exe}
EXE=$(cd "${ROOT}/${EXEVER}/${BUILD}" && pwd -P)/cp2k.${VERSION}
if [ ! "${EXE}" ]; then
EXEVER=${EXEVER:-exe}
EXE=$(cd "${ROOT}/${EXEVER}/${BUILD}" && pwd -P)/cp2k.${VERSION}
fi

if [ "${I_MPI_ROOT}" ]; then
#MPIRUNFLAGS="${MPIRUNFLAGS} -rdma"
Expand Down

0 comments on commit 945a288

Please sign in to comment.