Within our HPC environment at TGen we use SLURM to coordinate and schedule computation tasks

# Example default header

# Open and interactive session

srun -N 1 --ntasks-per-node=8 --pty bash

# Submit multiple jobs to slurm but define dependency job(s) that must complete before another finishes

# Submit primary job
PRIMARY_JOBID=$(sbatch --parsable primary_script.slurm)
# Submit secondary job (it will sit and wait for the primary job to finish)
sbatch --dependency=afterok:${PRIMARY_JOBID} secondary_script.slurm