Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
doku:multimpi [2019/03/12 12:52] – jz | doku:multimpi [2023/03/14 12:53] (current) – [VSC-3] goldenberg | ||
---|---|---|---|
Line 3: | Line 3: | ||
Sample job script to run two MPI tasks within one job script concurrently: | Sample job script to run two MPI tasks within one job script concurrently: | ||
- | == With srun: == | + | ==== VSC-4 ===== |
- | < | + | |
- | # | + | |
- | # | + | |
- | #SBATCH -N 1 | + | |
- | #SBATCH --ntasks-per-core=1 | + | |
- | #SBATCH --ntasks-per-node=2 | + | |
- | export SLURM_STEP_GRES=none | + | Sample Job when for running multiple mpi jobs on a VSC-4 node. |
- | module load intel/18 intel-mpi/ | + | Note: The " |
- | for i in 0 8 | + | < |
- | do | + | mem_per_task * mytasks < mem_per_node |
- | j=$(($i+1)) | + | |
- | srun -n 2 --cpu_bind=map_cpu: | + | |
- | done | + | |
- | wait | + | |
- | + | ||
- | exit 0 | + | |
</ | </ | ||
- | == With mpirun (Intel MPI): == | + | The approx 2Gb reduction in available memory is due to operating system stored in memory. For a standard node with 96 Gb of Memory this would be eg.: |
+ | |||
+ | < | ||
+ | 23 Gb * 4 = 92 Gb < 94 Gb | ||
+ | </ | ||
< | < | ||
#!/bin/bash | #!/bin/bash | ||
- | #SBATCH -J test | + | #SBATCH -J many |
#SBATCH -N 1 | #SBATCH -N 1 | ||
- | #SBATCH --ntasks-per-core=1 | ||
- | #SBATCH --ntasks-per-node=2 | ||
export SLURM_STEP_GRES=none | export SLURM_STEP_GRES=none | ||
- | module load intel/18 intel-mpi/2018 | + | mytasks=4 |
+ | cmd=" | ||
+ | mem_per_task=10G | ||
- | for i in 0 8 | + | for i in `seq 1 $mytasks` |
do | do | ||
- | j=$(($i+1)) | + | srun --mem=$mem_per_task |
- | mpirun | + | |
done | done | ||
wait | wait | ||
- | exit 0 | ||
- | </ | ||
- | |||
- | You can download the C code example here: {{ : | ||
- | Compile it e.g. with: | ||
- | |||
- | < | ||
- | # module load intel/18 intel-mpi/ | ||
- | # mpiicc -lhwloc hello_world.c -o hello_world_intelmpi2018 | ||
</ | </ | ||