diff --git a/README.md b/README.md index 0a230d77d66c7f8bf851a96bbb390239fa089f7d..133ba9cb6e381003e107b6553e4043e12b1d60e3 100644 --- a/README.md +++ b/README.md @@ -32,15 +32,21 @@ First it is necessary to book a node for interactive use: salloc -A <allocation-name> -N 1 -t 1:0:0 ``` -Then the aprun command is used to launch an OpenMP application: +An environment variable specifying the number of threads should also be set: ``` -aprun -n 1 -d <number of threads> -cc none ./example.x +export OMP_NUM_THREADS=<number-of-threads> +``` + +Then the srun command is used to launch an OpenMP application: + +``` +srun -n 1 ./example.x ``` In this example we will start one task with 32 threads (there are 32 cores per node on the Beskow nodes). -It is important to use the `aprun` command since otherwise the job will run on the Beskow login node. +It is important to use the `srun` command since otherwise the job will run on the Beskow login node. # OpenMP Exercises diff --git a/advanced_lab/README.md b/advanced_lab/README.md index f007c53e3e0d16f4902a53d2f759afd784565e8f..303086cd660272fde7ca0b279a5506e0d15f06fa 100644 --- a/advanced_lab/README.md +++ b/advanced_lab/README.md @@ -50,7 +50,7 @@ difficult task is to make a good use of all the available cores. Choose to work with either the given serial C/Fortran 90 code or, if you think you have time, write your own implementation (but don’t waste time and energy). -Compile the code by typing make and execute the program ``shwater2d`` with ``aprun`` as +Compile the code by typing make and execute the program ``shwater2d`` with ``srun`` as described in the [general instructions](https://www.pdc.kth.se/support/documents/courses/summerschool.html). @@ -145,6 +145,6 @@ reflective boundary conditions, thus at the boundary ``` #!/bin/csh foreach n (`seq 1 1 16`) - env OMP_NUM_THREADS=$n aprun -n 1 -d $n ./a.out + env OMP_NUM_THREADS=$n srun -n 1 ./a.out end ``` diff --git a/advanced_lab/run.csh b/advanced_lab/run.csh index 4d2700d9c4d56be7f0051d69ae27fcba2a064715..e249203d11bfbb795c2ace70dd6ecec00d0176a1 100644 --- a/advanced_lab/run.csh +++ b/advanced_lab/run.csh @@ -1,4 +1,4 @@ #!/bin/csh foreach n (`seq 1 1 16`) - env OMP_NUM_THREADS=$n aprun -n 1 -d $n ./shwater2d + env OMP_NUM_THREADS=$n srun -n 1 ./shwater2d end diff --git a/intro_lab/README.md b/intro_lab/README.md index 6c56b814c11b4317ed1ae557c7dff7e86bc754cd..be5b483a9661e73ec4707afdf63590360212d528 100644 --- a/intro_lab/README.md +++ b/intro_lab/README.md @@ -51,7 +51,7 @@ export OMP_NUM_THREADS=<number-of-threads> To run an OpenMP code on a computing node of Beskow: ``` -aprun -n 1 -d <number-of-threads> -cc none ./name_exec +srun -n 1 ./name_exec ``` ## Exercise 1 - OpenMP Hello World: get familiar with OpenMp Environment @@ -68,7 +68,7 @@ Your code using 4 threads should behave similarly to: Input: ``` -aprun -n 1 -d 4 -cc none ./hello +srun -n 1 ./hello ``` Output: diff --git a/old_intro_lab/README.md b/old_intro_lab/README.md index 00cc8361639a939d8c230ef74e0db2a999bc4533..f461701d77fd647a90a93a60f909678f0175f163 100644 --- a/old_intro_lab/README.md +++ b/old_intro_lab/README.md @@ -35,7 +35,8 @@ $ make part1ex1 Run the resulting program: ```bash -aprun -n 1 -d number of threads ./part1ex1 +export OMP_NUM_THREADS=<number of threads> +srun -n 1 ./part1ex1 ``` Remember that on the Cray you need to set the environment variable OMP_NUM_THREADS to the number of threads as described in the general instructions.