split_nokey Subroutine

private subroutine split_nokey(col, new_comm)

A routine to split the mp_comm communicator into sub-groups based on each procs specific colour "col". The sub communicator's handle is passed back in new_comm

In future we may wish to make split an interface to allow for user specific keys (to reorder processor ranks) and to specify a different communicator to split

Arguments

Type IntentOptional Attributes Name
integer, intent(inout) :: col

Processors colour

integer, intent(out) :: new_comm

The new sub communicator's handle


Contents

Source Code


Source Code

  subroutine split_nokey (col,new_comm)
    implicit none
    integer, intent(inout) :: col !< Processors colour
    integer, intent(out) :: new_comm !< The new sub communicator's handle
#ifdef MPI
    integer :: ierror
!$OMP MASTER
    call time_message(.false., time_mp_other, ' MPI Overheads')
!$OMP END MASTER
    !Split the comm group, note we use a constant key of 0 across all procs
    !meaning that the rank order is the same in the old and new communicators
    call mpi_comm_split(mp_comm,col,0,new_comm,ierror)
!$OMP MASTER
    call time_message(.false., time_mp_other, ' MPI Overheads')
!$OMP END MASTER
#else
    UNUSED_DUMMY(col)
    new_comm=-1
#endif
  end subroutine split_nokey