rank_comm Subroutine

public subroutine rank_comm(comm, rank)

What is rank of current proc in passed communicator

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: comm
integer, intent(out) :: rank

Contents

Source Code


Source Code

  subroutine rank_comm(comm,rank)
    integer, intent(in) :: comm
    integer, intent(out) :: rank
#ifdef MPI
    integer :: ierror
!$OMP MASTER
    call time_message(.false., time_mp_other, ' MPI Overheads')
!$OMP END MASTER
    call mpi_comm_rank(comm,rank,ierror)
!$OMP MASTER
    call time_message(.false., time_mp_other, ' MPI Overheads')
!$OMP END MASTER
#else
    rank=0
#endif
  end subroutine rank_comm