Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
doku:multimpi [2019/03/12 12:51] – jz | doku:multimpi [2021/04/01 07:03] – markus | ||
---|---|---|---|
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 ===== |
+ | |||
+ | Sample Job when for running multiple mpi jobs on a VSC-4 node. Note: | ||
+ | |||
+ | < | ||
+ | # | ||
+ | #SBATCH -J many | ||
+ | #SBATCH -N 1 | ||
+ | |||
+ | export SLURM_STEP_GRES=none | ||
+ | |||
+ | mytasks=4 | ||
+ | cmd=" | ||
+ | mem_per_task=10G | ||
+ | |||
+ | for i in `seq 1 $mytasks` | ||
+ | do | ||
+ | srun --mem=$mem_per_task --cpus-per-task=2 --ntasks=1 $cmd & | ||
+ | done | ||
+ | wait | ||
+ | |||
+ | </ | ||
+ | |||
+ | ==== VSC-3 ===== | ||
+ | |||
+ | === With srun: === | ||
< | < | ||
#!/bin/bash | #!/bin/bash | ||
Line 25: | Line 50: | ||
</ | </ | ||
- | == With mpirun (Intel MPI): == | + | === With mpirun (Intel MPI): === |
< | < | ||
Line 49: | Line 74: | ||
You can download the C code example here: {{ : | 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 | ||
+ | </ | ||