Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.

mpi on cmp

karimfath
Beginner
696 Views

hello


i knew that mpi is used for distribued programming . my question is can i use mpi to create a communication between thread in cluster of multiprocessor and multicore machine and if this possible can i use mpi in multicore machine only to create a communication between threads

thanks

0 Kudos
4 Replies
Dmitry_Vyukov
Valued Contributor I
696 Views
Quoting - karimfath

i knew that mpi is used for distribued programming . my question is can i use mpi to create a communication between thread in cluster of multiprocessor and multicore machine and if this possible can i use mpi in multicore machine only to create a communication between threads

Threads inside process in MPI-2 conforming implementation are not addressable. But AFAIK there are MPI implementations which expose every thread as a distinct process (i.e. threads are addressable).

And you can always create several MPI processes on multi-core machine. If you are going to use MPI for communication between threads anyway, then this must work just fine.

0 Kudos
Dmitry_Vyukov
Valued Contributor I
696 Views
Quoting - Dmitriy V'jukov

Threads inside process in MPI-2 conforming implementation are not addressable. But AFAIK there are MPI implementations which expose every thread as a distinct process (i.e. threads are addressable).

And you can always create several MPI processes on multi-core machine. If you are going to use MPI for communication between threads anyway, then this must work just fine.

But for SMP/multicore system you better use specialized tools for SMP/multicore like OpenMP/Cilk/Cilk++/TPL/PPL/Fork Join/TBB.

Or if you want to use exactly message-passing, you can employ specialized message-passing for SMP/multicore, which will have extrememly low-overhead message-passing, possibility of passing "by pointer", possibility of sharing constant data and so on.

0 Kudos
Dion_Abdi
Beginner
696 Views
My question about using specialized tools. Is it possible to make hybrid program using Cilk++ and MPICH2 at once? Have you done this before? Thanks.
0 Kudos
TimP
Honored Contributor III
696 Views
This seems possible in principle. Of course, MPI work at Intel is likely to use Intel MPI, which already includes affinity scheduling for MPI FUNNELED tasks with multiple ranks per node. With no such provision in MPICH2, you would have to provide your own method to set affinity, e.g. to keep the threads of each rank local to a package.
0 Kudos
Reply