#!/bin/bash # a sample job submission script to submit a hybrid MPI/OpenMP job to Midway2 # set the job name to hello-hybrid #SBATCH --job-name=hello-hybrid # send output to hello-hybrid.out #SBATCH --output=hello-hybrid.out # this job requests 4 MPI processes #SBATCH --ntasks=4 # and request 8 cpus per task for OpenMP threads. On Midway2, you could ask # for up to 28 cpus per task. #SBATCH --cpus-per-task=8 # this job will run on Midway2 #SBATCH --partition=broadwl # this job will run on nodes connected with the EDR interconnec. comment/delete the # following line if the type of interconnect is not important to you #SBATH --constraint=edr # load the openmpi default module module load openmpi # set OMP_NUM_THREADS to the number of --cpus-per-task we asked for export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK # Run the process with mpirun. Notice -n is not required. mpirun will # automatically figure out how many processes to run from the slurm options mpirun ./hello-hybrid