Open MPI logo

Hardware Locality Users' Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Users mailing list

Subject: Re: [hwloc-users] Process and thread binding
From: Brice Goglin (Brice.Goglin_at_[hidden])
Date: 2011-09-12 08:30:24

Le 12/09/2011 14:17, Gabriele Fatigati a écrit :
> Mm, and why? In a hybrid code ( MPI + OpenMP), my idea is to bind a
> single MPI process in one core, and his threads in other cores.
> Otherwise I have all threads that runs on a single core.

The usual way to do that is to first bind the entire process to all
cores available to all its thread and then bind each thread to a single

For instance, if doing Open MPI + OpenMP with one process per socket
* you pass --bind-to-socket on the mpirun/mpiexec command-line
* when the MPI process starts, the OpenMP runtime calls something like
get_cpubind to find out how many cores were given to it
* it creates the exact same number of OpenMP threads and bind one of
them on each core