comm_env_compute_comm Function

public 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.

Arguments

None

Return Value type(comm_t)


Calls

proc~~comm_env_compute_comm~~CallsGraph proc~comm_env_compute_comm comm_env_compute_comm comm_world comm_world proc~comm_env_compute_comm->comm_world

Called by

proc~~comm_env_compute_comm~~CalledByGraph proc~comm_env_compute_comm comm_env_compute_comm proc~halo_allreduce_efp_list halo_allreduce_efp_list proc~halo_allreduce_efp_list->proc~comm_env_compute_comm proc~halo_allreduce_max halo_allreduce_max proc~halo_allreduce_max->proc~comm_env_compute_comm proc~halo_allreduce_min halo_allreduce_min proc~halo_allreduce_min->proc~comm_env_compute_comm proc~halo_allreduce_sum halo_allreduce_sum proc~halo_allreduce_sum->proc~comm_env_compute_comm proc~halo_allreduce_sum_i8 halo_allreduce_sum_i8 proc~halo_allreduce_sum_i8->proc~comm_env_compute_comm proc~halo_exchange_2d halo_exchange_2d proc~halo_exchange_2d->proc~comm_env_compute_comm proc~halo_exchange_2d_device halo_exchange_2d_device proc~halo_exchange_2d_device->proc~comm_env_compute_comm proc~halo_exchange_3d_device halo_exchange_3d_device proc~halo_exchange_3d_device->proc~comm_env_compute_comm proc~halo_exchange_begin halo_exchange_begin proc~halo_exchange_begin->proc~comm_env_compute_comm proc~ocean_fold_exchange ocean_fold_exchange proc~ocean_fold_exchange->proc~comm_env_compute_comm proc~ocean_halo_centre_2d_impl ocean_halo_centre_2d_impl proc~ocean_halo_centre_2d_impl->proc~comm_env_compute_comm proc~ocean_halo_centre_3d ocean_halo_centre_3d proc~ocean_halo_centre_3d->proc~comm_env_compute_comm proc~ocean_halo_face_x_2d_impl ocean_halo_face_x_2d_impl proc~ocean_halo_face_x_2d_impl->proc~comm_env_compute_comm proc~ocean_halo_face_x_3d ocean_halo_face_x_3d proc~ocean_halo_face_x_3d->proc~comm_env_compute_comm proc~ocean_halo_face_y_2d_impl ocean_halo_face_y_2d_impl proc~ocean_halo_face_y_2d_impl->proc~comm_env_compute_comm proc~ocean_halo_face_y_3d ocean_halo_face_y_3d proc~ocean_halo_face_y_3d->proc~comm_env_compute_comm interface~ocean_halo_centre ocean_halo_centre interface~ocean_halo_centre->proc~ocean_halo_centre_3d proc~ocean_halo_centre_2d ocean_halo_centre_2d interface~ocean_halo_centre->proc~ocean_halo_centre_2d interface~ocean_halo_face_x ocean_halo_face_x interface~ocean_halo_face_x->proc~ocean_halo_face_x_3d proc~ocean_halo_face_x_2d ocean_halo_face_x_2d interface~ocean_halo_face_x->proc~ocean_halo_face_x_2d interface~ocean_halo_face_y ocean_halo_face_y interface~ocean_halo_face_y->proc~ocean_halo_face_y_3d proc~ocean_halo_face_y_2d ocean_halo_face_y_2d interface~ocean_halo_face_y->proc~ocean_halo_face_y_2d proc~barotropic_substep_nonlinear barotropic_substep_nonlinear proc~barotropic_substep_nonlinear->proc~ocean_fold_exchange proc~barotropic_substep_nonlinear->interface~ocean_halo_face_x proc~ocean_halo_bt_group_2d_wide ocean_halo_bt_group_2d_wide proc~barotropic_substep_nonlinear->proc~ocean_halo_bt_group_2d_wide interface~ocean_fold_north_v_face ocean_fold_north_v_face proc~barotropic_substep_nonlinear->interface~ocean_fold_north_v_face proc~ocean_halo_bt_group_2d ocean_halo_bt_group_2d proc~barotropic_substep_nonlinear->proc~ocean_halo_bt_group_2d proc~chksum_row chksum_row proc~chksum_row->proc~halo_allreduce_sum_i8 proc~configure_ocean_bt_split configure_ocean_bt_split proc~configure_ocean_bt_split->proc~halo_allreduce_min proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~halo_allreduce_sum proc~engine_step_ice engine_step_ice proc~driver_run_ocean->proc~engine_step_ice proc~ocean_console_stats_report ocean_console_stats_report proc~driver_run_ocean->proc~ocean_console_stats_report proc~engine_enter_data engine_enter_data proc~driver_run_ocean->proc~engine_enter_data proc~engine_setup engine_setup proc~driver_run_ocean->proc~engine_setup proc~engine_step engine_step proc~driver_run_ocean->proc~engine_step proc~engine_step_ice->proc~halo_allreduce_sum_i8 proc~ice_transport_step ice_transport_step proc~engine_step_ice->proc~ice_transport_step proc~ocean_halo_exchange_ice_fluxes ocean_halo_exchange_ice_fluxes proc~engine_step_ice->proc~ocean_halo_exchange_ice_fluxes proc~ocean_halo_exchange_ice_state ocean_halo_exchange_ice_state proc~engine_step_ice->proc~ocean_halo_exchange_ice_state proc~ice_ocean_stress_flux ice_ocean_stress_flux proc~engine_step_ice->proc~ice_ocean_stress_flux proc~fold_centre_2d fold_centre_2d proc~fold_centre_2d->proc~ocean_fold_exchange proc~fold_centre_3d fold_centre_3d proc~fold_centre_3d->proc~ocean_fold_exchange proc~fold_corner_2d fold_corner_2d proc~fold_corner_2d->proc~ocean_fold_exchange proc~fold_u_2d fold_u_2d proc~fold_u_2d->proc~ocean_fold_exchange proc~fold_u_3d fold_u_3d proc~fold_u_3d->proc~ocean_fold_exchange proc~fold_v_2d fold_v_2d proc~fold_v_2d->proc~ocean_fold_exchange proc~fold_v_3d fold_v_3d proc~fold_v_3d->proc~ocean_fold_exchange proc~halo_exchange_3d halo_exchange_3d proc~halo_exchange_3d->proc~halo_exchange_2d proc~ice_transport_step->proc~halo_allreduce_max proc~ok_all_ranks ok_all_ranks proc~ice_transport_step->proc~ok_all_ranks proc~ocean_halo_exchange_ice_transport ocean_halo_exchange_ice_transport proc~ice_transport_step->proc~ocean_halo_exchange_ice_transport proc~ocean_cavity_mass_step ocean_cavity_mass_step proc~ocean_cavity_mass_step->proc~halo_allreduce_sum proc~ocean_console_stats_report->proc~halo_allreduce_efp_list proc~ocean_console_stats_report->proc~halo_allreduce_max proc~ocean_console_stats_report->proc~halo_allreduce_sum proc~ocean_fold_wrap_centre_3d_state ocean_fold_wrap_centre_3d_state proc~ocean_fold_wrap_centre_3d_state->proc~ocean_fold_exchange proc~ocean_fold_wrap_centre_flat ocean_fold_wrap_centre_flat proc~ocean_fold_wrap_centre_flat->proc~ocean_fold_exchange proc~ocean_fold_wrap_eta_2d ocean_fold_wrap_eta_2d proc~ocean_fold_wrap_eta_2d->proc~ocean_fold_exchange proc~ocean_fold_wrap_state ocean_fold_wrap_state proc~ocean_fold_wrap_state->proc~ocean_fold_exchange proc~ocean_fold_wrap_stress ocean_fold_wrap_stress proc~ocean_fold_wrap_stress->proc~ocean_fold_exchange proc~ocean_fold_wrap_time_means ocean_fold_wrap_time_means proc~ocean_fold_wrap_time_means->proc~ocean_fold_exchange proc~ocean_fold_wrap_visc_rem ocean_fold_wrap_visc_rem proc~ocean_fold_wrap_visc_rem->proc~ocean_fold_exchange proc~ocean_halo_bt_group_2d_wide->proc~ocean_halo_centre_2d_impl proc~ocean_halo_bt_group_2d_wide->proc~ocean_halo_face_x_2d_impl proc~ocean_halo_bt_group_2d_wide->proc~ocean_halo_face_y_2d_impl proc~ocean_halo_centre_2d->proc~ocean_halo_centre_2d_impl proc~ocean_halo_centre_2d_wide ocean_halo_centre_2d_wide proc~ocean_halo_centre_2d_wide->proc~ocean_halo_centre_2d_impl proc~ocean_halo_face_x_2d->proc~ocean_halo_face_x_2d_impl proc~ocean_halo_face_x_2d_wide ocean_halo_face_x_2d_wide proc~ocean_halo_face_x_2d_wide->proc~ocean_halo_face_x_2d_impl proc~ocean_halo_face_y_2d->proc~ocean_halo_face_y_2d_impl proc~ocean_halo_face_y_2d_wide ocean_halo_face_y_2d_wide proc~ocean_halo_face_y_2d_wide->proc~ocean_halo_face_y_2d_impl proc~ok_all_ranks->proc~halo_allreduce_min proc~refuse_open_zfixed_staircase refuse_open_zfixed_staircase proc~refuse_open_zfixed_staircase->proc~halo_allreduce_sum interface~ocean_fold_north_centre ocean_fold_north_centre interface~ocean_fold_north_centre->proc~fold_centre_2d interface~ocean_fold_north_centre->proc~fold_centre_3d interface~ocean_fold_north_corner ocean_fold_north_corner interface~ocean_fold_north_corner->proc~fold_corner_2d interface~ocean_fold_north_u_face ocean_fold_north_u_face interface~ocean_fold_north_u_face->proc~fold_u_2d interface~ocean_fold_north_u_face->proc~fold_u_3d interface~ocean_fold_north_v_face->proc~fold_v_2d interface~ocean_fold_north_v_face->proc~fold_v_3d proc~barotropic_substep_nonlinear_interior barotropic_substep_nonlinear_interior proc~barotropic_substep_nonlinear_interior->proc~barotropic_substep_nonlinear proc~bt_wide_entry_exchange_impl bt_wide_entry_exchange_impl proc~bt_wide_entry_exchange_impl->proc~ocean_halo_bt_group_2d_wide proc~bt_wide_entry_exchange_impl->proc~ocean_halo_centre_2d_wide proc~bt_wide_entry_exchange_impl->proc~ocean_halo_face_x_2d_wide proc~bt_wide_entry_exchange_impl->proc~ocean_halo_face_y_2d_wide proc~bt_wide_substep bt_wide_substep proc~bt_wide_substep->proc~barotropic_substep_nonlinear proc~configure_ocean_closed_faces configure_ocean_closed_faces proc~configure_ocean_closed_faces->interface~ocean_halo_face_x proc~configure_ocean_closed_faces->interface~ocean_halo_face_y proc~configure_ocean_closed_faces->proc~refuse_open_zfixed_staircase proc~configure_ocean_k_bot configure_ocean_k_bot proc~configure_ocean_k_bot->interface~ocean_halo_face_x proc~configure_ocean_k_bot->interface~ocean_halo_face_y proc~configure_ocean_land_mask configure_ocean_land_mask proc~configure_ocean_land_mask->interface~ocean_halo_centre proc~configure_ocean_land_mask->proc~ocean_fold_wrap_eta_2d proc~continuity_gm_apply continuity_gm_apply proc~continuity_gm_apply->interface~ocean_halo_centre proc~continuity_gm_apply->proc~ocean_fold_wrap_centre_3d_state proc~continuity_gm_apply->interface~ocean_fold_north_v_face proc~continuity_tracer_step_split continuity_tracer_step_split proc~continuity_tracer_step_split->interface~ocean_halo_centre proc~continuity_tracer_step_split->proc~ocean_fold_wrap_centre_3d_state proc~continuity_tracer_step_split->interface~ocean_fold_north_v_face proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~engine_enter_data->interface~ocean_halo_face_x proc~engine_enter_data->proc~ocean_halo_bt_group_2d_wide proc~engine_enter_data->proc~ocean_halo_bt_group_2d proc~ocean_halo_exchange_ml_state ocean_halo_exchange_ml_state proc~engine_enter_data->proc~ocean_halo_exchange_ml_state proc~engine_setup->interface~ocean_halo_centre proc~engine_setup->interface~ocean_halo_face_x proc~engine_setup->proc~configure_ocean_bt_split proc~engine_setup->proc~ocean_fold_wrap_eta_2d proc~engine_setup->proc~ocean_fold_wrap_state proc~engine_setup->interface~ocean_fold_north_corner proc~engine_setup->proc~configure_ocean_closed_faces proc~engine_setup->proc~configure_ocean_k_bot proc~engine_setup->proc~configure_ocean_land_mask proc~engine_setup->proc~ocean_halo_exchange_ice_state proc~engine_setup->proc~ocean_halo_exchange_ml_state proc~configure_ocean_forcing configure_ocean_forcing proc~engine_setup->proc~configure_ocean_forcing proc~ocean_data_forcing_configure ocean_data_forcing_configure proc~engine_setup->proc~ocean_data_forcing_configure proc~ice_evp_dynamics_impl ice_evp_dynamics_impl proc~ice_evp_dynamics_impl->interface~ocean_halo_face_x proc~ice_evp_dynamics_impl->interface~ocean_halo_face_y proc~ice_halo_centre_flat ice_halo_centre_flat proc~ice_halo_centre_flat->interface~ocean_halo_centre proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->interface~ocean_halo_centre proc~run_gm_step run_gm_step proc~ocean_dyn_step_split->proc~run_gm_step proc~run_stage_split run_stage_split proc~ocean_dyn_step_split->proc~run_stage_split proc~ocean_halo_bt_group_2d->proc~ocean_halo_centre_2d proc~ocean_halo_bt_group_2d->proc~ocean_halo_face_x_2d proc~ocean_halo_bt_group_2d->proc~ocean_halo_face_y_2d proc~ocean_halo_exchange_ice_fluxes->interface~ocean_halo_centre proc~ocean_halo_exchange_ice_fluxes->proc~ocean_fold_wrap_centre_flat proc~ocean_halo_exchange_ice_state->proc~ocean_fold_wrap_centre_flat proc~ocean_halo_exchange_ice_state->proc~ice_halo_centre_flat proc~ocean_halo_exchange_ice_transport->proc~ocean_fold_wrap_centre_flat proc~ocean_halo_exchange_ice_transport->proc~ice_halo_centre_flat proc~ocean_halo_exchange_ml_state->interface~ocean_halo_centre proc~ocean_halo_exchange_ml_state->interface~ocean_halo_face_x proc~ocean_halo_exchange_ml_state->interface~ocean_halo_face_y proc~ocean_seam_refresh_surface_stress ocean_seam_refresh_surface_stress proc~ocean_seam_refresh_surface_stress->interface~ocean_halo_face_x proc~ocean_seam_refresh_surface_stress->interface~ocean_halo_face_y proc~ocean_seam_refresh_surface_stress->proc~ocean_fold_wrap_stress proc~rdb_debug_chksum_2d rdb_debug_chksum_2d proc~rdb_debug_chksum_2d->proc~chksum_row proc~rdb_debug_chksum_3d rdb_debug_chksum_3d proc~rdb_debug_chksum_3d->proc~chksum_row proc~rdb_ocean_set_bathymetry rdb_ocean_set_bathymetry proc~rdb_ocean_set_bathymetry->proc~ocean_fold_wrap_eta_2d proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step_ice proc~rdb_ocean_step->proc~engine_step proc~refresh_tracer_ghosts refresh_tracer_ghosts proc~refresh_tracer_ghosts->interface~ocean_halo_centre proc~refresh_tracer_ghosts->proc~ocean_fold_wrap_centre_3d_state proc~run_continuity_chain run_continuity_chain proc~run_continuity_chain->interface~ocean_halo_centre proc~run_continuity_chain->proc~ocean_fold_wrap_state proc~run_continuity_chain->proc~continuity_tracer_step_split proc~run_continuity_chain->proc~ocean_halo_exchange_ml_state proc~run_continuity_chain->proc~refresh_tracer_ghosts proc~run_gm_step->proc~ocean_fold_wrap_state proc~run_gm_step->proc~continuity_gm_apply proc~run_gm_step->proc~ocean_halo_exchange_ml_state proc~run_stage run_stage proc~run_stage->proc~ocean_cavity_mass_step proc~run_stage->proc~continuity_tracer_step_split proc~vmix_apply_in_stage vmix_apply_in_stage proc~run_stage->proc~vmix_apply_in_stage proc~run_stage_split->interface~ocean_halo_centre proc~run_stage_split->interface~ocean_halo_face_x proc~run_stage_split->interface~ocean_halo_face_y proc~run_stage_split->proc~ocean_cavity_mass_step proc~run_stage_split->proc~ocean_fold_wrap_state proc~run_stage_split->proc~ocean_fold_wrap_time_means proc~run_stage_split->proc~barotropic_substep_nonlinear_interior proc~run_stage_split->proc~bt_wide_substep proc~run_stage_split->proc~ocean_halo_bt_group_2d proc~run_stage_split->proc~ocean_halo_exchange_ml_state proc~run_stage_split->proc~refresh_tracer_ghosts proc~run_stage_split->proc~run_continuity_chain proc~bt_wide_entry_exchange bt_wide_t%bt_wide_entry_exchange proc~run_stage_split->proc~bt_wide_entry_exchange proc~visc_rem_precompute visc_rem_precompute proc~run_stage_split->proc~visc_rem_precompute proc~run_stage_split->proc~vmix_apply_in_stage proc~visc_rem_halo_refresh visc_rem_halo_refresh proc~visc_rem_halo_refresh->interface~ocean_halo_face_x proc~visc_rem_halo_refresh->interface~ocean_halo_face_y proc~visc_rem_halo_refresh->proc~ocean_fold_wrap_visc_rem interface~rdb_debug_chksum rdb_debug_chksum interface~rdb_debug_chksum->proc~rdb_debug_chksum_2d interface~rdb_debug_chksum->proc~rdb_debug_chksum_3d proc~bt_wide_entry_exchange->proc~bt_wide_entry_exchange_impl proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_enter_data proc~complete_ocean_create->proc~engine_setup proc~configure_ocean_forcing->proc~ocean_seam_refresh_surface_stress proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~engine_step->proc~ocean_dyn_step_split proc~ocean_data_forcing_apply ocean_data_forcing_apply proc~engine_step->proc~ocean_data_forcing_apply proc~ocean_dyn_step ocean_dyn_step proc~engine_step->proc~ocean_dyn_step proc~ice_evp_dynamics ice_evp_dynamics proc~ice_evp_dynamics->proc~ice_evp_dynamics_impl proc~ice_ocean_stress_flux->proc~ocean_seam_refresh_surface_stress proc~ocean_data_forcing_apply->proc~ocean_seam_refresh_surface_stress proc~ocean_data_forcing_configure->proc~ocean_seam_refresh_surface_stress proc~ocean_dyn_step->proc~run_stage proc~visc_rem_precompute->proc~visc_rem_halo_refresh proc~vmix_apply_in_stage->proc~visc_rem_halo_refresh proc~vmix_apply_in_stage->proc~visc_rem_precompute proc~chksum_bt chksum_bt proc~chksum_bt->interface~rdb_debug_chksum proc~chksum_state chksum_state proc~chksum_state->interface~rdb_debug_chksum proc~ice_evp_step ice_evp_step proc~ice_evp_step->proc~ice_evp_dynamics proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Source Code

   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