Loading...
Searching...
No Matches
MpiContext.h File Reference

Tiny value type describing the MPI dispatch context for a probe loop. More...

#include <stdexcept>

Go to the source code of this file.

Classes

struct  gpr::linalg::MpiContext

Namespaces

namespace  gpr
 Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
namespace  gpr::linalg
 Dense and structured linear algebra behind the GP: Cholesky and eigen solvers, linear operators, backend selection.

Typedefs

using gpr::linalg::MpiCommType = int

Variables

constexpr MpiCommType gpr::linalg::kMpiCommNull = 0

Detailed Description

Tiny value type describing the MPI dispatch context for a probe loop.

A value of gpr::linalg::MpiContext carries the rank, the process count, and the communicator that gpr::linalg::ProbeExecutor uses to partition probes round-robin (RankLocal operator path) or to broadcast collective participation (Distributed operator path).

Two helpers construct the standard contexts:

  • gpr::linalg::MpiContext::local() returns {rank=0, nprocs=1, comm=MPI_COMM_NULL} for the single-process path. Always available.
  • gpr::linalg::MpiContext::world() returns the live MPI_COMM_WORLD context with rank and nprocs queried via MPI_Comm_rank / MPI_Comm_size. Only declared when GPR_LINALG_SCALAPACK is defined (no MPI symbol is in scope otherwise).

MpiContext is a pure value: no caches, no statics, no ownership of the communicator. It is the caller's responsibility to ensure MPI is initialised (e.g. via gpr::linalg::DistributedState::initialize) before calling world().

Definition in file MpiContext.h.