Hybrid MPI-OpenMP

A myriad of applications are using the combination of OpenMP constructs and MPI library in order to improve their performance. You might start MPI with this great Website 🙂

Once you have a MPI program, you may include some code in order to make it hybrid:

  • Add the OpenMP header: #include <omp.h>
  • Declare request and provided variables in order to check the level of threads support.
  • Initialize the MPI environment properly, instead of int MPI_Init(&argc, &argv), use MPI_Init_thread(&argc, &argv, MPI_THREAD_FUNNELED, &provided); In this case, I choose the type Funneled but you may choose the style Master-only, Serialized, or Multiple. You can see further information about this here.
  • Define the parallel block with the directives pragma parallel omp including the default, firstprivate, private and/or shared variables as your program was set.

  • In your Makefile, set the FLAG= openmp or qopenmp (depends on your compiler).
  • Load the modules and run it as it is, a MPI program.

The performance was test as it is shown in the table having the best option with 36 processes and 1 thread using the Funneled type. Later, the style MPI_THREAD_SINGLE with 36 process and 1 thread was set, achieving 0.0532 achieving a speed of 0.9797 with this type.

*** Compared the Single style to the Funneled, this latter one was faster. ***

Advertisements

About Julita Inca

Ingeniero de Sistemas UNAC, Magíster en Ciencias de la Computación PUCP, OPW GNOME 2011, Miembro de la GNOME Foundation desde el 2012, Embajadora Fedora Perú desde el 2012, ganadora del scholarship of the Linux Foundation 2012, experiencia como Admin Linux en GMD y Especialista IT en IBM, con certificaciones RHCE, RHCSA, AIX 6.1, AIX 7 Administrator e ITILv3. Experiencia académica en universidades como PUCP, USIL y UNI. HPC researcher, Leader of LinuXatUNI Community, a simple mortal like you!
This entry was posted in Education, τεχνολογια :: Technology and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s