comm_discard_leader Function

private function comm_discard_leader(this) result(new_comm)

Type Bound

comm_t

Arguments

Type IntentOptional Attributes Name
class(comm_t), intent(in) :: this

Return Value type(comm_t)


Calls

proc~~comm_discard_leader~~CallsGraph proc~comm_discard_leader comm_t%comm_discard_leader interface~comm_null comm_null proc~comm_discard_leader->interface~comm_null proc~comm_split_by_color comm_t%comm_split_by_color proc~comm_discard_leader->proc~comm_split_by_color proc~create_null_comm create_null_comm interface~comm_null->proc~create_null_comm proc~comm_split_by_color->interface~comm_null mpi_comm_split mpi_comm_split proc~comm_split_by_color->mpi_comm_split proc~create_comm_from_mpi create_comm_from_mpi proc~comm_split_by_color->proc~create_comm_from_mpi mpi_comm_rank mpi_comm_rank proc~create_comm_from_mpi->mpi_comm_rank mpi_comm_size mpi_comm_size proc~create_comm_from_mpi->mpi_comm_size

Variables

Type Visibility Attributes Name Initial
integer, private :: color

Source Code

   function comm_discard_leader(this) result(new_comm)
      class(comm_t), intent(in) :: this
      type(comm_t) :: new_comm
      integer :: color

      if (.not. this%is_valid) then
         new_comm = comm_null()
         return
      end if

      if (this%rank() == 0) then
         color = MPI_UNDEFINED
      else
         color = 0
      end if
      new_comm = this%split_by(color)
   end function comm_discard_leader