get_group_leader_rank Subroutine

subroutine get_group_leader_rank(ctx, node_rank, group_leader_rank, group_id)

Uses

  • proc~~get_group_leader_rank~~UsesGraph proc~get_group_leader_rank get_group_leader_rank module~mqc_many_body_expansion mqc_many_body_expansion proc~get_group_leader_rank->module~mqc_many_body_expansion module~mqc_config_adapter mqc_config_adapter module~mqc_many_body_expansion->module~mqc_config_adapter module~mqc_json_output_types mqc_json_output_types module~mqc_many_body_expansion->module~mqc_json_output_types module~mqc_method_config mqc_method_config module~mqc_many_body_expansion->module~mqc_method_config module~mqc_physical_fragment mqc_physical_fragment module~mqc_many_body_expansion->module~mqc_physical_fragment module~mqc_resources mqc_resources module~mqc_many_body_expansion->module~mqc_resources pic_types pic_types module~mqc_many_body_expansion->pic_types module~mqc_config_adapter->module~mqc_method_config module~mqc_config_adapter->module~mqc_physical_fragment module~mqc_config_adapter->pic_types module~mqc_calculation_keywords mqc_calculation_keywords module~mqc_config_adapter->module~mqc_calculation_keywords module~mqc_config_parser mqc_config_parser module~mqc_config_adapter->module~mqc_config_parser module~mqc_elements mqc_elements module~mqc_config_adapter->module~mqc_elements module~mqc_error mqc_error module~mqc_config_adapter->module~mqc_error pic_logger pic_logger module~mqc_config_adapter->pic_logger module~mqc_json_output_types->pic_types module~mqc_thermochemistry mqc_thermochemistry module~mqc_json_output_types->module~mqc_thermochemistry module~mqc_method_config->pic_types module~mqc_method_types mqc_method_types module~mqc_method_config->module~mqc_method_types module~mqc_physical_fragment->pic_types module~mqc_cgto mqc_cgto module~mqc_physical_fragment->module~mqc_cgto module~mqc_physical_fragment->module~mqc_elements module~mqc_physical_fragment->module~mqc_error module~mqc_geometry mqc_geometry module~mqc_physical_fragment->module~mqc_geometry module~mqc_physical_constants mqc_physical_constants module~mqc_physical_fragment->module~mqc_physical_constants module~mqc_xyz_reader mqc_xyz_reader module~mqc_physical_fragment->module~mqc_xyz_reader module~mqc_mpi_comms mqc_mpi_comms module~mqc_resources->module~mqc_mpi_comms module~mqc_calculation_keywords->pic_types module~mqc_calculation_defaults mqc_calculation_defaults module~mqc_calculation_keywords->module~mqc_calculation_defaults module~mqc_cgto->pic_types module~mqc_config_parser->module~mqc_physical_fragment module~mqc_config_parser->pic_types module~mqc_config_parser->module~mqc_error module~mqc_config_parser->module~mqc_geometry module~mqc_config_parser->module~mqc_method_types module~mqc_calc_types mqc_calc_types module~mqc_config_parser->module~mqc_calc_types module~mqc_config_parser->module~mqc_calculation_defaults module~mqc_elements->pic_types pic_ascii pic_ascii module~mqc_elements->pic_ascii module~mqc_geometry->pic_types module~mqc_method_types->pic_types pic_mpi_lib pic_mpi_lib module~mqc_mpi_comms->pic_mpi_lib module~mqc_physical_constants->pic_types module~mqc_thermochemistry->pic_types module~mqc_thermochemistry->module~mqc_elements module~mqc_thermochemistry->module~mqc_physical_constants module~mqc_thermochemistry->pic_logger pic_io pic_io module~mqc_thermochemistry->pic_io pic_lapack_interfaces pic_lapack_interfaces module~mqc_thermochemistry->pic_lapack_interfaces module~mqc_xyz_reader->pic_types module~mqc_xyz_reader->module~mqc_error module~mqc_xyz_reader->module~mqc_geometry module~mqc_calc_types->pic_types module~mqc_calculation_defaults->pic_types

Resolve group leader rank and group id for the given node leader rank.

Arguments

Type IntentOptional Attributes Name
class(many_body_expansion_t), intent(in) :: ctx
integer, intent(in) :: node_rank
integer, intent(out) :: group_leader_rank
integer, intent(out) :: group_id

Called by

proc~~get_group_leader_rank~~CalledByGraph proc~get_group_leader_rank get_group_leader_rank proc~group_global_coordinator_impl group_global_coordinator_impl proc~group_global_coordinator_impl->proc~get_group_leader_rank proc~node_coordinator_impl node_coordinator_impl proc~node_coordinator_impl->proc~get_group_leader_rank proc~node_coordinator_impl->proc~group_global_coordinator_impl proc~node_coordinator node_coordinator proc~node_coordinator->proc~node_coordinator_impl interface~node_coordinator node_coordinator interface~node_coordinator->proc~node_coordinator proc~gmbe_run_distributed gmbe_context_t%gmbe_run_distributed proc~gmbe_run_distributed->interface~node_coordinator proc~mbe_run_distributed mbe_context_t%mbe_run_distributed proc~mbe_run_distributed->interface~node_coordinator

Variables

Type Visibility Attributes Name Initial
integer, private :: i

Source Code

   subroutine get_group_leader_rank(ctx, node_rank, group_leader_rank, group_id)
      !! Resolve group leader rank and group id for the given node leader rank.
      use mqc_many_body_expansion, only: many_body_expansion_t
      class(many_body_expansion_t), intent(in) :: ctx
      integer, intent(in) :: node_rank
      integer, intent(out) :: group_leader_rank
      integer, intent(out) :: group_id

      integer :: i

      group_leader_rank = 0
      group_id = 1
      if (.not. allocated(ctx%node_leader_ranks)) return
      if (.not. allocated(ctx%group_leader_ranks)) return
      if (.not. allocated(ctx%group_ids)) return

      do i = 1, size(ctx%node_leader_ranks)
         if (ctx%node_leader_ranks(i) == node_rank) then
            group_leader_rank = ctx%group_leader_ranks(i)
            group_id = ctx%group_ids(i)
            return
         end if
      end do
   end subroutine get_group_leader_rank