diff --git a/docs/src/reference/advanced.md b/docs/src/reference/advanced.md index 77cf76eca..9f4415bd6 100644 --- a/docs/src/reference/advanced.md +++ b/docs/src/reference/advanced.md @@ -37,9 +37,9 @@ MPI.infoval ## Error handler objects ```@docs -MPI.Errhandler -MPI.get_errorhandler -MPI.set_errorhandler! +MPI.ErrorHandler +MPI.get_errhandler +MPI.set_errhandler! ``` ## Miscellaneous diff --git a/src/deprecated.jl b/src/deprecated.jl index a0ea33d6f..c2756cf5d 100644 --- a/src/deprecated.jl +++ b/src/deprecated.jl @@ -235,3 +235,6 @@ import Base: @deprecate dims .= Dims_create(nnodes, dims), false) @deprecate(Cart_coords!(comm::Comm, rank::Integer, coords::MPIBuffertype{Cint}), coords .= Cart_coords(comm, rank), false) + +@deprecate(get_errorhandler(obj), get_errhandler(obj), false) +@deprecate(set_errorhandler!(obj, errhandler), set_errhandler!(obj, errhandler), false) diff --git a/src/environment.jl b/src/environment.jl index da6be98ad..9bcd7c2a1 100644 --- a/src/environment.jl +++ b/src/environment.jl @@ -110,7 +110,7 @@ function Init(;threadlevel=:serialized, finalize_atexit=true, errors_return=true run_init_hooks() if errors_return - set_default_error_handler_return() + set_default_errhandler_return() end _warn_if_wrong_mpi() end diff --git a/src/errhandler.jl b/src/errhandler.jl index 9ad300a1d..56986be80 100644 --- a/src/errhandler.jl +++ b/src/errhandler.jl @@ -1,5 +1,5 @@ """ - MPI.Errhandler + MPI.ErrorHandler An MPI error handler object. Currently only two are supported: @@ -31,56 +31,56 @@ function free(errh::Errhandler) return nothing end -function set_default_error_handler_return() - set_errorhandler!(COMM_SELF, ERRORS_RETURN) - set_errorhandler!(COMM_WORLD, ERRORS_RETURN) +function set_default_errhandler_return() + set_errhandler!(COMM_SELF, ERRORS_RETURN) + set_errhandler!(COMM_WORLD, ERRORS_RETURN) end """ - MPI.get_errorhandler(comm::MPI.Comm) - MPI.get_errorhandler(win::MPI.Win) - MPI.get_errorhandler(file::MPI.File.FileHandle) + MPI.get_errhandler(comm::MPI.Comm) + MPI.get_errhandler(win::MPI.Win) + MPI.get_errhandler(file::MPI.File.FileHandle) Get the current [`Errhandler`](@ref) for the relevant MPI object. # See also -- [`set_errorhandler!`](@ref) +- [`set_errhandler!`](@ref) """ -function get_errorhandler(comm::Comm) +function get_errhandler(comm::Comm) errh = Errhandler() @mpichk ccall((:MPI_Comm_get_errhandler, libmpi), Cint, (MPI_Comm, Ptr{MPI_Errhandler}), comm, errh) return errh end -function get_errorhandler(win::Win) +function get_errhandler(win::Win) errh = Errhandler() @mpichk ccall((:MPI_Win_get_errhandler, libmpi), Cint, (MPI_Win, Ptr{MPI_Errhandler}), win, errh) return errh end -function get_errorhandler(file::File.FileHandle) +function get_errhandler(file::File.FileHandle) errh = Errhandler() @mpichk ccall((:MPI_File_get_errhandler, libmpi), Cint, (MPI_File, Ptr{MPI_Errhandler}), file, errh) return errh end """ - MPI.set_errorhandler!(comm::MPI.Comm, errh::Errhandler) - MPI.set_errorhandler!(win::MPI.Win, errh::Errhandler) - MPI.set_errorhandler!(file::MPI.File.FileHandle, errh::Errhandler) + MPI.set_errhandler!(comm::MPI.Comm, errh::Errhandler) + MPI.set_errhandler!(win::MPI.Win, errh::Errhandler) + MPI.set_errhandler!(file::MPI.File.FileHandle, errh::Errhandler) Set the [`Errhandler`](@ref) for the relevant MPI object. # See also -- [`get_errorhandler`](@ref) +- [`get_errhandler`](@ref) """ -function set_errorhandler!(comm::Comm, errh::Errhandler) +function set_errhandler!(comm::Comm, errh::Errhandler) @mpichk ccall((:MPI_Comm_set_errhandler, libmpi), Cint, (MPI_Comm, MPI_Errhandler), comm, errh) return nothing end -function set_errorhandler!(win::Win, errh::Errhandler) +function set_errhandler!(win::Win, errh::Errhandler) @mpichk ccall((:MPI_Win_set_errhandler, libmpi), Cint, (MPI_Win, MPI_Errhandler), win, errh) return nothing end -function set_errorhandler!(file::File.FileHandle, errh::Errhandler) +function set_errhandler!(file::File.FileHandle, errh::Errhandler) @mpichk ccall((:MPI_File_set_errhandler, libmpi), Cint, (MPI_File, MPI_Errhandler), file, errh) return nothing end diff --git a/test/test_errorhandler.jl b/test/test_errorhandler.jl index 8bb8fe9e7..58563c7d0 100644 --- a/test/test_errorhandler.jl +++ b/test/test_errorhandler.jl @@ -2,9 +2,9 @@ using MPI, Test MPI.Init() @test MPI.ERRORS_ARE_FATAL != MPI.ERRORS_RETURN -@test MPI.get_errorhandler(MPI.COMM_SELF) == MPI.ERRORS_RETURN +@test MPI.get_errhandler(MPI.COMM_SELF) == MPI.ERRORS_RETURN @test_throws MPI.MPIError MPI.Send(rand(10), 2, 0, MPI.COMM_SELF) -MPI.set_errorhandler!(MPI.COMM_SELF, MPI.ERRORS_ARE_FATAL) -@test MPI.get_errorhandler(MPI.COMM_SELF) == MPI.ERRORS_ARE_FATAL +MPI.set_errhandler!(MPI.COMM_SELF, MPI.ERRORS_ARE_FATAL) +@test MPI.get_errhandler(MPI.COMM_SELF) == MPI.ERRORS_ARE_FATAL