Community
cancel
Showing results for 
Search instead for 
Did you mean: 
karimfath
Beginner
23 Views

mpi on cmp

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
23 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.

Dmitry_Vyukov
Valued Contributor I
23 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.

Dion_Abdi
Beginner
23 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.
TimP
Black Belt
23 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.