Return the compute-only communicator Falls back to comm_world() if comm_env_init has not been called (e.g. tests that use raw MPI_Init).
TEST/TOOLING-ONLY: when comm_env_push_compute_comm has an
override active, that override is returned instead — every
caller reads this function fresh at call time (none of
rdb_halo/rdb_ocean_halo cache the result across calls), so
the override is visible to every collective issued while it is
pushed, with no other code change required.
function comm_env_compute_comm() result(comm) !! Return the compute-only communicator !! Falls back to comm_world() if comm_env_init has not been called !! (e.g. tests that use raw MPI_Init). !! !! TEST/TOOLING-ONLY: when `comm_env_push_compute_comm` has an !! override active, that override is returned instead — every !! caller reads this function fresh at call time (none of !! `rdb_halo`/`rdb_ocean_halo` cache the result across calls), so !! the override is visible to every collective issued while it is !! pushed, with no other code change required. type(comm_t) :: comm if (compute_comm_override_depth > 0) then comm = compute_comm_override else if (cached_rank >= 0) then comm = comm_compute else comm = comm_world() end if end function comm_env_compute_comm