Get_master_MPI Function

public function Get_master_MPI(comm) result(master)

Arguments

Type IntentOptional Attributes Name
integer, optional :: comm

Return Value logical


Calls

proc~~get_master_mpi~~CallsGraph proc~get_master_mpi Get_master_MPI mpi_comm_rank mpi_comm_rank proc~get_master_mpi->mpi_comm_rank proc~error_mpi Error_MPI proc~get_master_mpi->proc~error_mpi

Source Code

  function Get_master_MPI(comm) result(master)
    integer,optional :: comm
    integer          :: comm_
    integer          :: rank
    logical          :: master
    comm_=MPI_COMM_WORLD;if(present(comm))comm_=comm
    if(comm_/=Mpi_Comm_Null)then    
       call MPI_Comm_rank(comm_,rank,ierr)
       call Error_MPI(ierr,"Get_Master_MPI")
       master=.false.
       if(rank==0)master=.true.
    else
       master=.false.
    endif
  end function Get_master_MPI