Given a cluster of several nodes, each of which hosts multiple-core processor, is there any advantage of using MPI between nodes and OpenMP/pthreads within nodes over using pure all-MPI? If I understand correctly, if I run an MPI-program on a single node and indicate the number of processes equal to the number of cores, then I will have an honest parallel MPI-job of several processes running on separate cores. So why bother about hybrid parallelization using threads within nodes and MPI only between nodes? I have no question in case of MPI+CUDA hybrid, as MPI cannot employ GPUs, but it can employ CPU cores, so why use threads?
MPI and Threads. • MPI describes parallelism between processes. (with separate address spaces) • Thread parallelism provides a shared-memory. model within a process.
The process may be multi-threaded, but only the main thread will make MPI calls (all MPI calls are funneled to the main thread).
The obvious advantage of the single- threaded approach is that it minimizes the execution times of individual applications (especially preexisting or legacy applica- tions)—but potentially at the cost of longer design and verification times and lower power efficiency.
Multiprocessing is used to create a more reliable system, whereas multithreading is used to create threads that run parallel to each other. multithreading is quick to create and requires few resources, whereas multiprocessing requires a significant amount of time and specific resources to create.
Using a combination of OpenMP/pthread threads and MPI processes is known as Hybrid Programming. It is tougher to program than pure MPI but with the recent reduction in latencies with OpenMP, it makes a lot of sense to use Hybrid MPI. Some advantages are:
But Hybrid MPI has its disadvantages as well but you asked only about the advantages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With