Use fisbatch to Submit an Interactive Job


The fisbatch command is the easiest way to submit and run an interactive job.   Once the job starts, the user is automatically logged into the compute node.  All variables set by SLURM are available on the compute node.

[ccruser@vortex:/ifs/user/ccruser]$ fisbatch --partition=debug --qos=debug --nodes=1 --ntasks-per-node=8 --time=01:00:00 --exclusive
FISBATCH -- waiting for JOBID 554442 to start
........!
FISBATCH -- Connecting to head node (d07n33s01)



The example below submits an interactive job requesting 2 compute nodes.  Notice that the user is automatically logged into the first compute node.  The IB constraint ensures that the interactive job runs on compute nodes that have InfiniBand.


[ccruser@vortex:~]$ fisbatch --partition=debug --qos=debug --nodes=2 --ntasks-per-node=8 --constraint=IB --time=01:00:00
FISBATCH -- waiting for JOBID 4440049 to start on cluster=ub-hpc and partition=debug
!
FISBATCH -- Connecting to head node (cpn-d07-33-02)



Use salloc to Request Resources

[ccruser@vortex:/ifs/user/ccruser]$ salloc --partition=debug --qos=debug --nodes=1 --time=01:00:00 --exclusive
salloc: Granted job allocation 91596



Show SLURM Variables


[ccruser@vortex:/ifs/user/ccruser]$ export | grep SLURM
declare -x SLURM_JOBID="91596"
declare -x SLURM_JOB_CPUS_PER_NODE="16"
declare -x SLURM_JOB_ID="91596"
declare -x SLURM_JOB_NODELIST="k05n26"
declare -x SLURM_JOB_NUM_NODES="1"
declare -x SLURM_NNODES="1"
declare -x SLURM_NODELIST="k05n26"
declare -x SLURM_NODE_ALIASES="(null)"
declare -x SLURM_SUBMIT_DIR="/ifs/user/ccruser"
declare -x SLURM_TASKS_PER_NODE="16"




Run Commands on Allocated Nodes


[ccruser@vortex:/ifs/user/ccruser]$ srun bash -c 'hostname'
k05n26




Exit Shell Created by salloc


[ccruser@vortex:/ifs/user/ccruser]$ exit
exit
salloc: Relinquishing job allocation 91596


Note:  Be sure to exit the shell created by the salloc command.  This shell can persist after the job has timed out and the nodes deallocated.


Example: Interactive Job Using Multiple Nodes


[ccruser@vortex:~]$ salloc --partition=debug --qos=debug --nodes=2 --ntasks-per-node=8 --time=01:00:00
salloc: Granted job allocation 91664


[ccruser@vortex:~]$ export | grep SLURM
declare -x SLURM_JOBID="91664"
declare -x SLURM_JOB_CPUS_PER_NODE="8(x2)"
declare -x SLURM_JOB_ID="91664"
declare -x SLURM_JOB_NODELIST="d09n29s02,d16n02"
declare -x SLURM_JOB_NUM_NODES="2"
declare -x SLURM_NNODES="2"
declare -x SLURM_NODELIST="d09n29s02,d16n02"
declare -x SLURM_NODE_ALIASES="(null)"
declare -x SLURM_NPROCS="16"
declare -x SLURM_NTASKS="16"
declare -x SLURM_NTASKS_PER_NODE="8"
declare -x SLURM_SUBMIT_DIR="/ifs/user/ccruser"
declare -x SLURM_TASKS_PER_NODE="8(x2)"


[ccruser@vortex:~]$ module load intel/13.0
[ccruser@vortex:~]$ module load intel-mpi/4.1.0
[ccruser@vortex:~]$ export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so
[ccruser@vortex:~]$ srun ./helloworld
Hello world from process 8 of 16 on node  d16n02
Hello world from process 9 of 16 on node  d16n02
Hello world from process 10 of 16 on node  d16n02
Hello world from process 11 of 16 on node  d16n02
Hello world from process 12 of 16 on node  d16n02
Hello world from process 13 of 16 on node  d16n02
Hello world from process 14 of 16 on node  d16n02
Hello world from process 15 of 16 on node  d16n02
Hello world from process 1 of 16 on node  d09n29s02
Hello world from process 2 of 16 on node  d09n29s02
Hello world from process 3 of 16 on node  d09n29s02
Hello world from process 4 of 16 on node  d09n29s02
Hello world from process 5 of 16 on node  d09n29s02
Hello world from process 6 of 16 on node  d09n29s02
Hello world from process 7 of 16 on node  d09n29s02
Hello world from process 0 of 16 on node  d09n29s02


[ccruser@vortex:~]$ exit
exit
salloc: Relinquishing job allocation 91664