Site Tools


mpi-nonblocking-collectives

Table of Contents

MPI Non-blocking collectives

Non-blocking collectives return immediately with a request handle instead of blocking. Variants like MPI_Ibcast, MPI_Ireduce, MPI_Iallreduce, and MPI_Iscatter let computing overlap with communication.

double local = compute_first_part();
double global;
MPI_Request req;
MPI_Iallreduce(&local, &global, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD, &req);
do_independent_work();
MPI_Wait(&req, MPI_STATUS_IGNORE);
use(global);

Not every implementation overlaps the collective with the intervening computation; some simply defer the work to MPI_Wait. On implementations that do use hardware-assisted collectives (common in high-end interconnects like InfiniBand), the overlap can hide significant latency in reduction-heavy algorithms.

mpi-nonblocking-collectives.md · Last modified: by 127.0.0.1