Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
mpi_utils.hpp File Reference

Serialization-aware MPI send/recv helpers using plain C MPI + Boost.Serialization. More...

Go to the source code of this file.

Detailed Description

Serialization-aware MPI send/recv helpers using plain C MPI + Boost.Serialization.

Boost.MPI's send/recv automatically invoked Boost.Serialization for complex types. These helpers replicate that behavior using the C MPI API directly, removing the Boost::mpi component dependency while keeping all existing serialize() methods.

Pattern: serialize to Boost binary_oarchive → single MPI_Send(MPI_BYTE). MPI_Probe + MPI_Get_count → MPI_Recv(MPI_BYTE) → deserialize.

The probe-before-receive approach avoids the two-message (size + data) race condition that would arise with MPI_ANY_SOURCE.