| 41 | ## MPI ## |
| 42 | Here is an example of a simple job to start an executable orchidee_ol (or gcm.e commented). |
| 43 | The input files and the executable must be in the directory before starting the executable. |
| 44 | {{{ |
| 45 | #!/bin/bash |
| 46 | #SBATCH --job-name=TravailMPI # name of job |
| 47 | #SBATCH --ntasks=80 # total number of MPI processes |
| 48 | #SBATCH --ntasks-per-node=40 # number of MPI processes per node |
| 49 | # /!\ Caution, "multithread" in Slurm vocabulary refers to hyperthreading. |
| 50 | #SBATCH --hint=nomultithread # 1 MPI process per physical core (no hyperthreading) |
| 51 | #SBATCH --time=00:10:00 # maximum execution time requested (HH:MM:SS) |
| 52 | #SBATCH --output=TravailMPI%j.out # name of output file |
| 53 | #SBATCH --error=TravailMPI%j.out # name of error file (here, in common with output) |
| 54 | |
| 55 | # go into the submission directory |
| 56 | cd ${SLURM_SUBMIT_DIR} |
| 57 | |
| 58 | |
| 59 | # echo of launched commands |
| 60 | set -x |
| 61 | |
| 62 | # code execution |
| 63 | srun ./orchidee_ol |
| 64 | #srun ./gcm.e |
| 65 | }}} |
| 66 | |
| 67 | |
| 68 | ## Hybrid MPI-OMP ## |
| 69 | |
| 70 | {{{ |
| 71 | #!/bin/bash |
| 72 | #SBATCH --job-name=Hybrid # name of job |
| 73 | #SBATCH --ntasks=8 # name of the MPI process |
| 74 | #SBATCH --cpus-per-task=10 # number of OpenMP threads |
| 75 | # /!\ Caution, "multithread" in Slurm vocabulary refers to hyperthreading. |
| 76 | #SBATCH --hint=nomultithread # 1 thread per physical core (no hyperthreading) |
| 77 | #SBATCH --time=00:10:00 # maximum execution time requested (HH:MM:SS) |
| 78 | #SBATCH --output=Hybride%j.out # name of output file |
| 79 | #SBATCH --error=Hybride%j.out # name of error file (here, common with the output file) |
| 80 | |
| 81 | # go into the submission directory |
| 82 | cd ${SLURM_SUBMIT_DIR} |
| 83 | |
| 84 | |
| 85 | # echo of launched commands |
| 86 | set -x |
| 87 | |
| 88 | # number of OpenMP threads |
| 89 | export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK |
| 90 | # OpenMP binding |
| 91 | export OMP_PLACES=cores |
| 92 | |
| 93 | # code execution |
| 94 | srun ./lmdz.e |
| 95 | }}} |
| 96 | |
| 97 | ## MPMD ## |