What is rank of current proc in passed communicator
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | comm | |||
integer, | intent(out) | :: | rank |
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
UNUSED_DUMMY(comm)
rank = 0
#endif
end subroutine rank_comm