Variables de entorno de salida en SLURM#
Dentro de los script de ejecución se pueden invocar ciertas variables con las que podemos conocer cierta información de la ejecución dentro un script.
Documentación para variables de entono de slurm
Las más usadas son las siguiente:
Variable | |
---|---|
SLURM_ARRAY_JOB_ID | Job array's master job ID number. |
SLURM_JOB_ID | The ID of the job allocation. |
SLURM_JOBID | New version for the ID of the job allocation |
SLURM_JOB_DEPENDENCY | Set to value of the --dependency option |
SLURM_JOB_NAME | Name of the job. |
SLURM_JOB_NODELIST | List of nodes allocated to the job |
SLURM_JOB_NUM_NODES | Total number of nodes in the job's resource allocation |
SLURM_JOB_PARTITION | Name of the partition in which the job is running |
SLURM_NODELIST | List of nodes allocated to the job |
SLURM_SUBMIT_DIR | The directory from which sbatch was invoked |
Script para ver las variables de slurm.#
Ejecutando el siguiente script usted puede ver las variables nombradas en el apartado anterior:
#!/bin/bash
#SBATCH -J GNUParallel -o %x-%J.out
#SBATCH --time=00:10:00
#SBATCH --mem-per-cpu=2G
#SBATCH -n 16
#SBATCH -c 4
# SBATCH --ntasks-per-node=8
#SBATCH --constrains=<node arquitecture> # sandy, ilk (icelake)... arquitecture
date
echo "SUBMITTED ON: $SLURM_SUBMIT_HOST IP: $SLURM_LAUNCH_NODE_IPADDR DIR: $SLURM_SUBMIT_DIR NODES ALLOCATED: $SLURM_JOB_NODELIST"
echo "RUNNING ON: $(hostname) $SLURMD_NODENAME"
echo "JOB_ID: $SLURM_JOB_ID ARRAY_JOB_ID: $SLURM_ARRAY_JOB_ID"
echo "STEP: $SLURM_STEP_ID NODEID: $SLURM_NODEID LOCALID: $SLURM_LOCALID PROCID: $SLURM_PROCID"
echo "ARRAY_TASK_COUNT: $SLURM_ARRAY_TASK_COUNT ARRAY_TASK_ID: $SLURM_ARRAY_TASK_ID ARRAY_TASK_MAX: $SLURM_ARRAY_TASK_MAX ARRAY_TASK_MIN: $SLURM_ARRAY_TASK_MIN ARRAY_STEPSIZE: $SLURM_ARRAY_TASK_STEP"
echo "Args: $*"
sleep 10