free_comm_type Subroutine

private subroutine free_comm_type(comm)

A routine to free the communicator represented by comm

Arguments

Type IntentOptional Attributes Name
type(comm_type), intent(inout) :: comm

Communicator object


Contents

Source Code


Source Code

  subroutine free_comm_type (comm)
    implicit none
    type(comm_type), intent(inout) :: comm !< Communicator object
#ifdef MPI
    integer :: ierror
!$OMP MASTER
    call time_message(.false., time_mp_other, ' MPI Overheads')
!$OMP END MASTER
    call mpi_comm_free(comm%id,ierror)
    comm%id = mp_comm_null
!$OMP MASTER
    call time_message(.false., time_mp_other, ' MPI Overheads')
!$OMP END MASTER
#endif
    !Reset other variables
    comm%iproc = -1
    comm%nproc = -1
    comm%proc0 = .false.
  end subroutine free_comm_type