|
Packit Service |
c5cf8c |
! This file created from errors/f77/io/uerrhandf.f with f77tof90
|
|
Packit Service |
c5cf8c |
! -*- Mode: Fortran; -*-
|
|
Packit Service |
c5cf8c |
!
|
|
Packit Service |
c5cf8c |
! (C) 2013 by Argonne National Laboratory.
|
|
Packit Service |
c5cf8c |
! See COPYRIGHT in top-level directory.
|
|
Packit Service |
c5cf8c |
!
|
|
Packit Service |
c5cf8c |
program main
|
|
Packit Service |
c5cf8c |
use mpi
|
|
Packit Service |
c5cf8c |
integer (kind=MPI_ADDRESS_KIND) asize
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
integer (kind=MPI_OFFSET_KIND) offset
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
integer ierr, rank, i
|
|
Packit Service |
c5cf8c |
integer errs
|
|
Packit Service |
c5cf8c |
external comm_errh_fn, win_errh_fn, file_errh_fn
|
|
Packit Service |
c5cf8c |
integer comm_errh, win_errh, file_errh
|
|
Packit Service |
c5cf8c |
integer winbuf(2), winh, wdup, wdsize, sizeofint, id
|
|
Packit Service |
c5cf8c |
integer fh, status(MPI_STATUS_SIZE)
|
|
Packit Service |
c5cf8c |
common /ec/ iseen
|
|
Packit Service |
c5cf8c |
integer iseen(3)
|
|
Packit Service |
c5cf8c |
save /ec/
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
iseen(1) = 0
|
|
Packit Service |
c5cf8c |
iseen(2) = 0
|
|
Packit Service |
c5cf8c |
iseen(3) = 0
|
|
Packit Service |
c5cf8c |
ierr = -1
|
|
Packit Service |
c5cf8c |
errs = 0
|
|
Packit Service |
c5cf8c |
call mtest_init( ierr )
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
call mpi_type_size( MPI_INTEGER, sizeofint, ierr )
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
call mpi_comm_create_errhandler( comm_errh_fn, comm_errh, ierr )
|
|
Packit Service |
c5cf8c |
if (ierr .ne. MPI_SUCCESS) then
|
|
Packit Service |
c5cf8c |
call mtestprinterrormsg( "Comm_create_errhandler:", ierr )
|
|
Packit Service |
c5cf8c |
errs = errs + 1
|
|
Packit Service |
c5cf8c |
endif
|
|
Packit Service |
c5cf8c |
call mpi_win_create_errhandler( win_errh_fn, win_errh, ierr )
|
|
Packit Service |
c5cf8c |
if (ierr .ne. MPI_SUCCESS) then
|
|
Packit Service |
c5cf8c |
call mtestprinterrormsg( "Win_create_errhandler:", ierr )
|
|
Packit Service |
c5cf8c |
errs = errs + 1
|
|
Packit Service |
c5cf8c |
endif
|
|
Packit Service |
c5cf8c |
call mpi_file_create_errhandler( file_errh_fn, file_errh, ierr )
|
|
Packit Service |
c5cf8c |
if (ierr .ne. MPI_SUCCESS) then
|
|
Packit Service |
c5cf8c |
call mtestprinterrormsg( "File_create_errhandler:", ierr )
|
|
Packit Service |
c5cf8c |
errs = errs + 1
|
|
Packit Service |
c5cf8c |
endif
|
|
Packit Service |
c5cf8c |
!
|
|
Packit Service |
c5cf8c |
call mpi_comm_dup( MPI_COMM_WORLD, wdup, ierr )
|
|
Packit Service |
c5cf8c |
call mpi_comm_set_errhandler( wdup, comm_errh, ierr )
|
|
Packit Service |
c5cf8c |
call mpi_comm_size( wdup, wdsize, ierr )
|
|
Packit Service |
c5cf8c |
call mpi_send( id, 1, MPI_INTEGER, wdsize, -37, wdup, ierr )
|
|
Packit Service |
c5cf8c |
if (ierr .eq. MPI_SUCCESS) then
|
|
Packit Service |
c5cf8c |
print *, ' Failed to detect error in use of MPI_SEND'
|
|
Packit Service |
c5cf8c |
errs = errs + 1
|
|
Packit Service |
c5cf8c |
else
|
|
Packit Service |
c5cf8c |
if (iseen(1) .ne. 1) then
|
|
Packit Service |
c5cf8c |
errs = errs + 1
|
|
Packit Service |
c5cf8c |
print *, ' Failed to increment comm error counter'
|
|
Packit Service |
c5cf8c |
endif
|
|
Packit Service |
c5cf8c |
endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
asize = 2*sizeofint
|
|
Packit Service |
c5cf8c |
call mpi_win_create( winbuf, asize, sizeofint, MPI_INFO_NULL &
|
|
Packit Service |
c5cf8c |
& , wdup, winh, ierr )
|
|
Packit Service |
c5cf8c |
if (ierr .ne. MPI_SUCCESS) then
|
|
Packit Service |
c5cf8c |
call mtestprinterrormsg( "Win_create:", ierr )
|
|
Packit Service |
c5cf8c |
errs = errs + 1
|
|
Packit Service |
c5cf8c |
endif
|
|
Packit Service |
c5cf8c |
call mpi_win_set_errhandler( winh, win_errh, ierr )
|
|
Packit Service |
c5cf8c |
asize = 0
|
|
Packit Service |
c5cf8c |
call mpi_put( winbuf, 1, MPI_INT, wdsize, asize, 1, MPI_INT, winh, &
|
|
Packit Service |
c5cf8c |
& ierr )
|
|
Packit Service |
c5cf8c |
if (ierr .eq. MPI_SUCCESS) then
|
|
Packit Service |
c5cf8c |
print *, ' Failed to detect error in use of MPI_PUT'
|
|
Packit Service |
c5cf8c |
errs = errs + 1
|
|
Packit Service |
c5cf8c |
else
|
|
Packit Service |
c5cf8c |
if (iseen(3) .ne. 1) then
|
|
Packit Service |
c5cf8c |
errs = errs + 1
|
|
Packit Service |
c5cf8c |
print *, ' Failed to increment win error counter'
|
|
Packit Service |
c5cf8c |
endif
|
|
Packit Service |
c5cf8c |
endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
call mpi_file_open( MPI_COMM_SELF, 'ftest', MPI_MODE_CREATE + &
|
|
Packit Service |
c5cf8c |
& MPI_MODE_RDWR + MPI_MODE_DELETE_ON_CLOSE, MPI_INFO_NULL, fh, &
|
|
Packit Service |
c5cf8c |
& ierr )
|
|
Packit Service |
c5cf8c |
if (ierr .ne. MPI_SUCCESS) then
|
|
Packit Service |
c5cf8c |
call mtestprinterrormsg( "File_open:", ierr )
|
|
Packit Service |
c5cf8c |
errs = errs + 1
|
|
Packit Service |
c5cf8c |
endif
|
|
Packit Service |
c5cf8c |
call mpi_file_set_errhandler( fh, file_errh, ierr )
|
|
Packit Service |
c5cf8c |
offset = -100
|
|
Packit Service |
c5cf8c |
call mpi_file_read_at( fh, offset, winbuf, 1, MPI_INTEGER, status, &
|
|
Packit Service |
c5cf8c |
& ierr )
|
|
Packit Service |
c5cf8c |
if (ierr .eq. MPI_SUCCESS) then
|
|
Packit Service |
c5cf8c |
print *, ' Failed to detect error in use of MPI_PUT'
|
|
Packit Service |
c5cf8c |
errs = errs + 1
|
|
Packit Service |
c5cf8c |
else
|
|
Packit Service |
c5cf8c |
if (iseen(2) .ne. 1) then
|
|
Packit Service |
c5cf8c |
errs = errs + 1
|
|
Packit Service |
c5cf8c |
print *, ' Failed to increment file error counter'
|
|
Packit Service |
c5cf8c |
endif
|
|
Packit Service |
c5cf8c |
endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
call mpi_comm_free( wdup, ierr )
|
|
Packit Service |
c5cf8c |
call mpi_win_free( winh, ierr )
|
|
Packit Service |
c5cf8c |
call mpi_file_close( fh, ierr )
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
call mpi_errhandler_free( win_errh, ierr )
|
|
Packit Service |
c5cf8c |
call mpi_errhandler_free( comm_errh, ierr )
|
|
Packit Service |
c5cf8c |
call mpi_errhandler_free( file_errh, ierr )
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
call mtest_finalize( errs )
|
|
Packit Service |
c5cf8c |
end
|
|
Packit Service |
c5cf8c |
!
|
|
Packit Service |
c5cf8c |
subroutine comm_errh_fn( comm, ec )
|
|
Packit Service |
c5cf8c |
integer comm, ec
|
|
Packit Service |
c5cf8c |
common /ec/ iseen
|
|
Packit Service |
c5cf8c |
integer iseen(3)
|
|
Packit Service |
c5cf8c |
save /ec/
|
|
Packit Service |
c5cf8c |
!
|
|
Packit Service |
c5cf8c |
iseen(1) = iseen(1) + 1
|
|
Packit Service |
c5cf8c |
!
|
|
Packit Service |
c5cf8c |
end
|
|
Packit Service |
c5cf8c |
!
|
|
Packit Service |
c5cf8c |
subroutine win_errh_fn( win, ec )
|
|
Packit Service |
c5cf8c |
integer win, ec
|
|
Packit Service |
c5cf8c |
common /ec/ iseen
|
|
Packit Service |
c5cf8c |
integer iseen(3)
|
|
Packit Service |
c5cf8c |
save /ec/
|
|
Packit Service |
c5cf8c |
!
|
|
Packit Service |
c5cf8c |
iseen(3) = iseen(3) + 1
|
|
Packit Service |
c5cf8c |
!
|
|
Packit Service |
c5cf8c |
end
|
|
Packit Service |
c5cf8c |
subroutine file_errh_fn( fh, ec )
|
|
Packit Service |
c5cf8c |
integer fh, ec
|
|
Packit Service |
c5cf8c |
common /ec/ iseen
|
|
Packit Service |
c5cf8c |
integer iseen(3)
|
|
Packit Service |
c5cf8c |
save /ec/
|
|
Packit Service |
c5cf8c |
!
|
|
Packit Service |
c5cf8c |
iseen(2) = iseen(2) + 1
|
|
Packit Service |
c5cf8c |
!
|
|
Packit Service |
c5cf8c |
end
|