parallel_obj_Stop Subroutine

private impure subroutine parallel_obj_Stop(this, msg)

Subroutine to gracefully stop the execution with an optional error message.

Type Bound

parallel_obj

Arguments

Type IntentOptional Attributes Name
class(parallel_obj), intent(inout) :: this

Parallel object

character(len=*), intent(in), optional :: msg

Error message


Calls

proc~~parallel_obj_stop~~CallsGraph proc~parallel_obj_stop parallel_obj%parallel_obj_Stop mpi_abort mpi_abort proc~parallel_obj_stop->mpi_abort

Source Code

    impure subroutine parallel_obj_Stop(this,msg)
      !> Subroutine to gracefully stop the execution with an optional error
      ! message.
      implicit none
      class(parallel_obj), intent(inout) :: this                               !! Parallel object
      character(len=*),    intent(in),    &
                                optional :: msg                                !! Error message
      ! Work variable
      integer :: ierr

      ! Specify who sends the abort signal and what it means
      if (present(msg)) then
         write(stderr,'(a,i0,2a)') 'LEAP: termination signal received on rank: ',this%rank%mine,'. Reason: ',trim(msg)
      else
         write(stderr,'(a,i0)'   ) 'LEAP: termination signal received on rank: ',this%rank%mine
      end if

      ! Call general abort
      call MPI_ABORT(this%comm%w,0,ierr)

      return
    end subroutine parallel_obj_Stop