How to start a jobarray on the Lichtenberg cluster

Since the walltime of the default partition is limited to 24 hours on the Lichtenberg cluster, jobarrays are needed to run simulations for longer periods.

In a sample jobscript the necessary options are briefly explained to start a jobarray for a parallel OpenFOAM solver.

For further optional SLURM settings, see:
SLURM usage HRZ Darmstadt
SLURM official documentation

Step-by-step guide

  1. Edit the parameters in the sample script according to your requirements.

    samplescript.sh

    #!/bin/sh
    
    #################################################################
    ## Example for a parallel job array, specified by -a option
    ## e.g. -a 1-5%1 starts an array of 5 batch jobs of which
    ## only 1 is allowed to run at the same time.
    ## Further options:
    ## -j Job_Name
    ## -C feature for cores, e.g. avx, avx2, nvd etc.
    ## -p Name_Queue, e.g. short (30min max.), deflt (24h max.)
    ## -o Name_Output file
    ## -e Name_Error file
    ## -n Number of tasks (parallelization)
    ## --mem-per-cpu=xy Memory per cpu in MB (mandatory option!)
    ##   (note: if you specify not enough memory the job will be killed)
    ## -t Walltime, e.g 24h for deflt queue
    ##
    ## Note: Number of tasks does not need to be specified for
    ## mpirun again, i.e. "mpirun -np 12" is not necessary
    #################################################################
    
    #SBATCH -a 1-1%1
    #SBATCH -J MYJOB1
    #SBATCH -C avx2
    #SBATCH -p deflt
    #SBATCH -o out.%A_%a
    #SBATCH -e err.%A_%a
    #SBATCH -n 12
    #SBATCH --mem-per-cpu=155
    #SBATCH -t 24:00:00
    
    ml gcc/4.9.4
    ml openmpi/4.0.1
    
    source ~/foam/foam-extend-4.0/etc/bashrc
    
    sleep 1
    
    export PSOLVER="icoFoam -parallel"
    
    mpirun $PSOLVER
    
    ###################################################
    
  2. Execute the script.

    ?> sbatch samplescript.sh
    

See also