Commit 00ce1e52 authored by Giuseppe Fiameni's avatar Giuseppe Fiameni
Browse files

Update README.md

parent 433603c6
Pipeline #144 canceled with stages
......@@ -8,9 +8,9 @@ The typical way of creating a job is to write a submission script. A submission
**Important**
The SBATCH directives must appear at the top of the submission file, before any other line except for the very first line which should be the shebang (e.g. #!/bin/bash).
The SBATCH directives must appear at the top of the submission file, before any other line except for the very first line which should be the shebang (e.g. `#!/bin/bash`).
The script itself is a job step. Other job steps are created with the **srun** command.
The script itself is a job step. Other job steps are created with the `srun` command.
For instance, the following script, hypothetically named submit.sh,
......@@ -18,7 +18,7 @@ For instance, the following script, hypothetically named submit.sh,
#!/bin/bash
#
#SBATCH --job-name=test
#SBATCH --output=res.txt
#SBATCH --output=res.out
#
#SBATCH --ntasks=1
#SBATCH --time=10:00
......@@ -28,7 +28,7 @@ srun hostname
srun sleep 60
```
would request one CPU for 10 minutes, along with 100 MB of RAM, in the default queue. When started, the job would run a first job step srun hostname, which will launch the UNIX command hostname on the node on which the requested CPU was allocated. Then, a second job step will start the sleep command. Note that the --job-name parameter allows giving a meaningful name to the job and the --output parameter defines the file to which the output of the job must be sent.
would request one CPU for 10 minutes, along with 100 MB of RAM, in the default queue. When started, the job would run a first job step srun hostname, which will launch the UNIX command hostname on the node on which the requested CPU was allocated. Then, a second job step will start the sleep command. Note that the `--job-name` parameter allows giving a meaningful name to the job and the `--output` parameter defines the file to which the output of the job must be sent.
Once the submission script is written properly, you need to submit it to slurm through the sbatch command, which, upon success, responds with the jobid attributed to the job. (The dollar sign below is the shell prompt)
......@@ -57,7 +57,7 @@ There are several ways a parallel job, one whose tasks are run simultaneously, c
In the Slurm context, a task is to be understood as a process. So a multi-process program is made of several tasks. By contrast, a multithreaded program is composed of only one task, which uses several CPUs.
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
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
......@@ -94,13 +94,14 @@ You can try the above example by using the example hello world program (`hello_m
```
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
0: Hello 1! Processor 1 reporting for duty
```
0: Hello 2! Processor 2 reporting for duty
The res_mpi.out file should contain something like:
0: Hello 3! Processor 3 reporting for duty
```
We have 4 processors
Processor 1 reporting for duty
Processor 2 reporting for duty
Processor 3 reporting for duty
```
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