Commit 0fc5841d authored by Giuseppe Fiameni's avatar Giuseppe Fiameni
Browse files

Update README.md

parent da1a20ed
Pipeline #139 canceled with stages
......@@ -46,7 +46,8 @@ Upon completion, the output file contains the result of the commands run in the
This example illustrates a serial job which runs a single CPU on a single node. It does not take advantage of multi-processor nodes or the multiple compute nodes available with a cluster. The next sections explain how to create parallel jobs.
Going parallel
# Going parallel
There are several ways a parallel job, one whose tasks are run simultaneously, can be created:
* by running a multi-process program (SPMD paradigm, e.g. with MPI)
......@@ -61,7 +62,9 @@ Tasks are requested/created with the --ntasks option, while CPUs, for the multit
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)
**Message passing example (MPI)**
```
#!/bin/bash
#
#SBATCH --job-name=test_mpi
......@@ -73,10 +76,13 @@ Message passing example (MPI)
module load OpenMPI
srun hello.mpi
```
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.
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
The res_mpi.txt file should contain something like
......@@ -87,5 +93,5 @@ The res_mpi.txt file should contain something like
0: Hello 2! Processor 2 reporting for duty
0: Hello 3! Processor 3 reporting for duty
Shared me
```
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