Commit e05ca947 authored by Giuseppe Fiameni's avatar Giuseppe Fiameni
Browse files

Update README.md

parent 0fc5841d
Pipeline #140 canceled with stages
......@@ -59,23 +59,32 @@ In the Slurm context, a task is to be understood as a process. So a multi-proces
Tasks are requested/created with the --ntasks option, while CPUs, for the multithreaded programs, are requested with the --cpus-per-task option. Tasks cannot be split across several compute nodes, so requesting several CPUs with the --cpus-per-task option will ensure all CPUs are allocated on the same compute node. By contrast, requesting the same amount of CPUs with the --ntasks option may lead to several CPUs
More submission script examples
## More submission script examples
Here are some quick sample submission scripts. For more detailed information, make sure to have a look at the Slurm FAQ and to follow our training sessions. There is also an interactive Script Generation Wizard you can use to help you in submission scripts creation.
**Message passing example (MPI)**
```
#!/bin/bash
#
#SBATCH --job-name=test_mpi
#SBATCH --output=res_mpi.txt
#
#SBATCH --ntasks=4
#SBATCH --nodes=4
#SBATCH --ntasks-per-node=36
#SBATCH --time=10:00
#SBATCH --mem-per-cpu=100
module load OpenMPI
srun hello.mpi
#SBATCH --account=train_ceudat19
#SBATCH --partition=gll_usr_prod
# #SBATCH --reservation=s_tra_eudat
module load autoload intelmpi
srun hello_mpi_world
```
Request four cores on the cluster for 10 minutes, using 100 MB of RAM per core. Assuming hello.mpi was compiled with MPI support, srun will create four instances of it, on the nodes allocated by Slurm.
......@@ -83,8 +92,8 @@ Request four cores on the cluster for 10 minutes, using 100 MB of RAM per core.
You can try the above example by downloading the example hello world program from Wikipedia (name it for instance wiki_mpi_example.c), and compiling it with
```
module load openmpi
mpicc wiki_mpi_example.c -o hello.mpi
module load autoload intelmpi
mpicc hello_mpi_world.c -o hello_mpi_world
The res_mpi.txt file should contain something like
0: We have 4 processors
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment