split_key Subroutine

private subroutine split_key(col, key, new_comm)

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

Arguments

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

Processors colour

integer, intent(in) :: key

Processors key, used to determine rank

integer, intent(out) :: new_comm

The new sub communicator's handle


Contents

Source Code


Source Code

  subroutine split_key (col,key,new_comm)
    implicit none
    integer, intent(in) :: col !< Processors colour
    integer, intent(in) :: key !< Processors key, used to determine rank
    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
    call mpi_comm_split(mp_comm,col,key,new_comm,ierror)
!$OMP MASTER
    call time_message(.false., time_mp_other, ' MPI Overheads')
!$OMP END MASTER
# else
    UNUSED_DUMMY(col); UNUSED_DUMMY(key)
    new_comm = -1
# endif
  end subroutine split_key