diff --git a/README.md b/README.md index 44a7b24c3cf803e96b2c824217b79afb4b3deae8..bac482fe20624ba12a83f8c2df30e232a1e53b77 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# PDC Summer School: General Instructions for the MPI Labs +# PDC Summer School 2021: General Instructions for the MPI Labs ## Where to run @@ -20,8 +20,7 @@ Related to the Kerberos-based authentication environment, please check the [Kerb Software, which is not available by default, needs to be loaded as a [module](https://www.pdc.kth.se/support/documents/run_jobs/job_scheduling.html#accessing-software) at login. Use ``module avail`` to get a list of available modules. The following modules are of interest for this lab exercises: -- **UPDATE** Different versions of the GNU compiler suite (``gcc/*``) -- **UPDATE** Different versions of the Intel compiler suite (``i-compilers/*``) +- Different versions of OpenMPI based on different versions of the GNU compiler suite (``openmpi/*``) For more information see the [software development documentation page](https://www.pdc.kth.se/support/documents/software_development/development.html). @@ -32,44 +31,16 @@ To use the Tegner compute nodes you have to submit [SLURM batch jobs](https://ww ## Compiling MPI programs on Tegner -By default the cray compiler is loaded into your environment. In order to use another compiler you have to swap compiler modules: +The following shell commands show a simple example on how to compile an MPI program using Fortran, C or C++: ``` -module swap PrgEnv-cray PrgEnv-gnu +module load openmpi +mpif90 my_prog.f90 +mpicc my_prog.c +mpicxx my_prog.cc ``` -or -``` -module swap PrgEnv-cray PrgEnv-intel -``` - -On Beskow one should always use the *compiler wrappers* `cc`, `CC` or -`ftn` (for C, C++ and Fortran codes, respectively), -which will automatically link to MPI libraries and linear -algebra libraries like BLAS, LAPACK, etc. - -Examples: - -``` -# Fortran -ftn [flags] source.f90 -# C -cc [flags] source.c -# C++ -CC [flags] source.cpp -``` - -Note: if you are using the Intel Programming Environment, and -if you are compiling C code, you might see error messages containing: - -``` -error: identifier "_Float128" is undefined -``` - -A workaround is to add a compiler flag: -``` -cc -D_Float128=__float128 source.c -``` +With the first line the default version of the OpenMPI module is loaded. ## Running MPI programs @@ -79,8 +50,7 @@ First it is necessary to book a node for interactive use: salloc -A <allocation-name> -N 1 -t 1:0:0 ``` -You might also need to specify a reservation by adding the flag -`--reservation=<name-of-reservation>`. +You might also need to specify a reservation by adding the flag `--reservation=<name-of-reservation>`. Then the srun command is used to launch an MPI application: @@ -90,17 +60,7 @@ srun -n 24 ./example.x In this example we will start 24 MPI tasks (there are 24 cores per node on the Tegner Thin nodes). -If you do not use srun and try to start your program on the login node then you will get an error similar to - -``` -Fatal error in MPI_Init: Other MPI error, error stack: -MPIR_Init_thread(408): Initialization failed -MPID_Init(123).......: channel initialization failed -MPID_Init(461).......: PMI2 init failed: 1 -``` - ## MPI Exercises - MPI Lab 1: [Program Structure and Point-to-Point Communication in MPI](lab1/README.md) -- MPI Lab 2: [Collective and Non-Blocking Communication](lab2/README.md) -- MPI Lab 3: [Advanced Topics](lab3/README.md) \ No newline at end of file +- MPI Lab 2: [MPI I/O and MPI performance](lab2/README.md) \ No newline at end of file