mirror of
https://gitlab.com/scemama/eplf
synced 2024-09-12 22:48:32 +02:00
38 lines
756 B
FortranFixed
38 lines
756 B
FortranFixed
|
subroutine abrt (here,message)
|
||
|
implicit none
|
||
|
IRP_IF MPI
|
||
|
include 'mpif.h'
|
||
|
IRP_ENDIF
|
||
|
character*(*) :: here
|
||
|
character*(*) :: message
|
||
|
if (mpi_master) then
|
||
|
print *, ''
|
||
|
print *, '-------------------------'
|
||
|
print *, 'Error in '//trim(here)//':'
|
||
|
print *, '-------------------------'
|
||
|
print *, trim(message)//'.'
|
||
|
print *, '-------------------------'
|
||
|
endif
|
||
|
|
||
|
IRP_IF MPI
|
||
|
integer :: ierr
|
||
|
call mpi_abort(MPI_COMM_WORLD,0,ierr)
|
||
|
ASSERT (ierr == MPI_SUCCESS)
|
||
|
IRP_ELSE
|
||
|
stop 1
|
||
|
IRP_ENDIF
|
||
|
end
|
||
|
|
||
|
subroutine finish ()
|
||
|
implicit none
|
||
|
IRP_IF MPI
|
||
|
include 'mpif.h'
|
||
|
integer :: ierr
|
||
|
call mpi_finalize(ierr)
|
||
|
if (ierr /= MPI_SUCCESS) then
|
||
|
call abrt(irp_here,"Unable to finalize MPI")
|
||
|
endif
|
||
|
IRP_ENDIF
|
||
|
end
|
||
|
|