Skip to content

Commit 9bbe4b8

Browse files
committed
Merge pull request #1 from natefoo/lparsons_galaxy_slots
Prefer $SLURM_CPUS_ON_NODE for $GALAXY_SLOTS to other SLURM variables.
2 parents d24bc3d + 1c21ba8 commit 9bbe4b8

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

lib/galaxy/jobs/runners/util/job_script/CLUSTER_SLOTS_STATEMENT.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
export GALAXY_SLOTS_CONFIGURED="1"
2-
if [ -n "$SLURM_NTASKS" ] || [ -n "$SLURM_CPUS_PER_TASK" ]; then
2+
if [ -n "$SLURM_CPUS_ON_NODE" ]; then
3+
# This should be valid on SLURM except in the case that srun is used to
4+
# submit additional job steps under an existing allocation, which we do not
5+
# currently do.
6+
GALAXY_SLOTS="$SLURM_CPUS_ON_NODE"
7+
elif [ -n "$SLURM_NTASKS" ] || [ -n "$SLURM_CPUS_PER_TASK" ]; then
8+
# $SLURM_CPUS_ON_NODE should be set correctly on SLURM (even on old
9+
# installations), but keep the $SLURM_NTASKS logic as a backup since this
10+
# was the previous method under SLURM.
11+
#
312
# Multiply these values since SLURM_NTASKS is total tasks over all nodes.
413
# GALAXY_SLOTS maps to CPUS on a single node and shouldn't be used for
514
# multi-node requests.

0 commit comments

Comments
 (0)