Introduction

This document contains some examples and exercises using the Message Passing Interface and the OpenMP programming model as the main parallelization approaches. Its main objective is to provide guidance in learning how both programming models can be used together and to serve as teaching materials in courses and tutorials. You can find the related software package here

You can also get the slides and the software package directly from Nord III computer in:

/apps/PM/training/acm-ess-2019

Each block of exercises contains a configure script that will setup your environment. Before starting the corresponding exercise’s block, please run the source command using, as a paramenter, the configure.sh file specifically provided for this block:

$ source configure.sh

All the sections contains an automatic building mechanism to ease the program compilation. All of them based in the Make utility, although some of them will provide an extra configuration step based in the CMAKE utility. Please, follow the exercise related instructions to build the program.

Objectives

Finally, each directory contains a README.md file describing the instructions you must follow in order to complete the exercise. Sections 01-paraver, 02-matmul, 03-tampi, and 04-dlb do not require any submission. The main goal of these exercises is to consolidate or complete the lessons learned during the seminar. Section 05-ifsker requires the creation of a report document which will include your experiences, observations and results while working with this code.

Final report document must be submitted to htbp-submit (at) bsc (dot) es, before September 15th.

Nord3’s Job Scheduler

All exercises provide some job scripts to submit jobs in the execution queues of this cluster. Those job scripts have some job parameters which are read by the LSF queue system. Although they already have default parameter values, feel free to change them. The most interesting parameters are:

#BSUB -n 4

This parameter indicates the number of tasks for the job. In MPI executions corresponds to the number of MPI processes and for sequential executions the number of cores. Moreover, the following parameter indicates the number of processes assigned to a node:

#BSUB -R "span[ptile=2]"

The number of cores per process will be automatically computed based on the previous values. Please remember that each node of the Nord3 cluster leverages 16 cores in total. Thus, try to avoid the oversubscription of cores when configuring the job scripts. For instance, in the above example, we will get 2 nodes, in which we will launch 4 MPI processes and each process will hold 8 cores.

Once you have the job script (e.g., run-once.sh) ready, you can submit it into the job scheduler by doing:

$ bsub < run-once.sh

You can take a look at the general information of all your jobs (job ID, submission date, state of the job, etc.) by executing the following command:

$ bjobs

Your jobs will go through the pending state (PEND), the running state (RUN), and finally, they will disappear from the list of jobs once completed. You should check for the possible errors and the output of the execution in the corresponding output files.

Furthermore, you can abort the execution of any of your jobs by executing the following command:

$ bkill $JOBID

More information about the Nord3 cluster and its job scheduler can be found here.