MSO4SC / cloudify-hpc-plugin

Plugin to allow Cloudify to deploy and orchestrate HPC resources
Apache License 2.0
8 stars 8 forks source link

SCALE (slurm array) variables erroneously created at the end of slurm script #23

Closed VedatDurmaz closed 6 years ago

VedatDurmaz commented 6 years ago

upon generating the slurm script (here doc) during bootstrapping of an mpi job, the SCALE variables are created at the end of of that slurm script:

mpirun -np 24 singularity exec zibaffinity-latest.simg /bin/bash za_mpi_em.sh $inp1 $SCALE_INDEX 
...
SCALE_INDEX=$SLURM_ARRAY_TASK_ID
SCALE_COUNT=$SLURM_ARRAY_TASK_COUNT
SCALE_MAX=61

thus, $SCALE_INDEX is empty when used as input for the the mpirun command.

emepetres commented 6 years ago

It is difficult to add the dynamic variables in the correct place every time, because slurm sbatch directives are tricky. I've decided to append the variables after the line "# DYNAMIC VARIABLES", letting the developers to place this line where they want them to be loaded.

The docs are modified as follows: The variables $SCALE_INDEX, $SCALE_COUNT and $SCALE_MAX will be available in the batch script if the line # DYNAMIC VARIABLES exist (they will be dynamicaly loaded after this line). They hold, for each job instance, the index, the total number of instances, and the maximun in parallel respectively.