Skip to main content
Under Construction

The English version of this document is under construction and will be available soon.

其他 MPI 範例

submit jobs with srun

MPI versionModule load
intel mpicompiler/intel/2018
mvapichcompiler/gnu/7.3.0 mvapich2/2.2
mpichcompiler/gnu/7.3.0 mpich/3.2.1
openmpicompiler/gnu/7.3.0 openmpi3/3.1.0

step by step example

# compile
module purge
module load compiler/intel/2018
mpicc -o hello /opt/ohpc/pub/examples/mpi/hello.c

file name : srun_job.sh

#!/bin/bash

#SBATCH -A ENT107046 # Project Account
#SBATCH -J test # Job name
#SBATCH -o job.%j.out # Name of stdout output file (%j expands to jobId)
#SBATCH -N 4 # Total number of nodes requested
#SBATCH -n 16 # Total number of mpi tasks requested
#SBATCH -t 00:30:00 # Run time (hh:mm:ss) - 0.5 hours
#SBATCH -p gp2d # partition

module purge
module load compiler/intel/2018

srun ./hello

and submit it

sbatch srun_job.sh