Parallelism

From Planets
Revision as of 09:21, 11 May 2022 by Romain.vande (talk | contribs) (How to run in parallel)

Jump to: navigation, search

What is parallelism?

Parallel computing is a type of computation in which many calculations or processes are carried out simultaneously. Large problems can often be divided into smaller ones, which can then be solved at the same time.

In short : Parallelism can help you save time.

Indeed, as the problem is cut into smaller part that are solved simultaneously, the waiting time for the user is reduced. However this usually comes with a counterpart, it can increase the total computation time.

How parallelism is implemented in the model

How to compile in parallel

To compile the model in parallel use the same command as in sequential (CITE HOW TO COMPILE) and add the following option :

 -parallel

Then there is three choices for parallelism MPI, OMP and mix MPI_OMP:

 -parallel mpi
 -parallel omp
 -parallel mpi_omp

So the command line to run in mix MPI_OMP will be for example :

./makelmdz_fcm -s XX -t XX -d LONxLATxALT -b IRxVI -p physicSuffix -arch archFile -parallel mpi_omp gcm

How to run in parallel

  • Run interactively
    • MPI only :

mpirun -np N gcm.e > gcm.out 2>&1 -np N specifies the number of procs to run on. IMPORTANT: one MUST use the mpirun command corresponding to the mpif90 compiler specified in the arch file. Output files (restart.nc, diagfi.nc ,etc.) are just as when running in serial. But stan- dard output messages are written by each process. If using chained simulations (run mcd/run0 scripts), then the command line to run the gcm in run0 must be adapted for local settings. NB: LMDZ.COMMON dynamics set to run in double precision, so keep NC_DOUBLE declaration (and real to double precision promotion) in the arch files.

  • Run with a job scheduler