Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix executable script wrapper for Slurm jobs #229

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions scripts/palace
Original file line number Diff line number Diff line change
Expand Up @@ -146,28 +146,26 @@ else
fi

# Run parallel simulation
NODE_FILE=mpi_nodes
if [[ -n "$PBS_NODEFILE" ]]; then
# PBS/Torque job
NODE_LIST=$PBS_NODEFILE
SUBMIT_DIR=$PBS_O_WORKDIR
cat $PBS_NODEFILE | sort | uniq > $NODE_FILE
WORK_DIR=$PBS_O_WORKDIR
elif [[ -n "$SLURM_JOB_NODELIST" ]]; then
# Slurm job
NODE_LIST=$SLURM_JOB_NODELIST
SUBMIT_DIR=$SLURM_SUBMIT_DIR
scontrol show hostnames $SLURM_JOB_NODELIST > $NODE_FILE
WORK_DIR=$SLURM_SUBMIT_DIR
else
NODE_LIST=""
WORKDIR=""
WORK_DIR=""
fi
if [[ -z "$NODE_LIST" ]]; then
if [[ -z "$WORK_DIR" ]]; then
# Local execution
echo ">> $MPIRUN $PALACE $CONFIG"
$MPIRUN $PALACE $CONFIG
EXIT_CODE=$?
else
NODE_FILE=mpi_nodes
cat $NODE_LIST | sort | uniq > $NODE_FILE
echo The master node of this job is `hostname`
echo The working directory is `echo $SUBMIT_DIR`
echo The working directory is `echo $WORK_DIR`
echo This job runs on the following nodes: && cat $NODE_FILE
MPIRUN="$MPIRUN --hostfile $NODE_FILE"

Expand Down