forked from open-mpi/ompi
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sessions: add missing errhandler funcs
somehow managed to not get into the original sessions pr. also do some cleanup of the use mpi_f08 profiling functions. Related to open-mpi#10388 Signed-off-by: Howard Pritchard <[email protected]>
- Loading branch information
Showing
37 changed files
with
961 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
.. _mpi_session_call_errhandler: | ||
|
||
MPI_Session_call_errhandler | ||
======================== | ||
|
||
.. include_body | ||
:ref:`MPI_Session_call_errhandler` - Passes the supplied error code to the error | ||
handler assigned to a session | ||
|
||
Syntax | ||
------ | ||
|
||
C Syntax | ||
^^^^^^^^ | ||
|
||
.. code:: c | ||
#include <mpi.h> | ||
int MPI_Session_call_errhandler(MPI_Session session, int errorcode) | ||
Fortran Syntax | ||
^^^^^^^^^^^^^^ | ||
|
||
.. code:: Fortran | ||
USE MPI | ||
! or the older form: INCLUDE 'mpif.h' | ||
MPI_SESSION_CALL_ERRHANDLER(SESSION, ERRORCODE, IERROR) | ||
INTEGER SESSION, ERRORCODE, IERROR | ||
Fortran 2008 Syntax | ||
^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. code:: Fortran | ||
USE mpi_f08 | ||
MPI_Session_call_errhandler(session, errorcode, ierror) | ||
TYPE(MPI_Session), INTENT(IN) :: session | ||
INTEGER, INTENT(IN) :: errorcode | ||
INTEGER, OPTIONAL, INTENT(OUT) :: ierror | ||
Input Parameter | ||
--------------- | ||
|
||
- session : session with error handler (handle). | ||
- errorcode : error code (integer). | ||
|
||
Output Parameters | ||
----------------- | ||
|
||
- IERROR : Fortran only: Error status (integer). | ||
|
||
Description | ||
----------- | ||
|
||
This function invokes the error handler assigned to the session | ||
session with the supplied error code errorcode. If the error handler was | ||
successfully called, the process is not aborted, and the error handler | ||
returns, this function returns MPI_SUCCESS. | ||
|
||
Notes | ||
----- | ||
|
||
Users should note that the default error handler is | ||
MPI_ERRORS_ARE_FATAL. Thus, calling this function will abort the | ||
processes in session if the default error handler has not been changed. | ||
|
||
Errors | ||
------ | ||
|
||
Almost all MPI routines return an error value; C routines as the value | ||
of the function and Fortran routines in the last argument. See the MPI | ||
man page for a full list of MPI error codes. | ||
|
||
|
||
.. seealso:: :ref:`MPI_Session_create_errhandler` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
.. _mpi_session_set_errhandler: | ||
|
||
|
||
MPI_Session_set_errhandler | ||
======================= | ||
|
||
.. include_body | ||
:ref:`MPI_Session_set_errhandler` - Attaches a new error handler to a | ||
session. | ||
|
||
|
||
SYNTAX | ||
------ | ||
|
||
|
||
C Syntax | ||
^^^^^^^^ | ||
|
||
.. code-block:: c | ||
#include <mpi.h> | ||
int MPI_Session_set_errhandler(MPI_Session session, | ||
MPI_Errhandler errhandler) | ||
Fortran Syntax | ||
^^^^^^^^^^^^^^ | ||
|
||
.. code-block:: fortran | ||
USE MPI | ||
! or the older form: INCLUDE 'mpif.h' | ||
MPI_SESSION_SET_ERRHANDLER(SESSION, ERRHANDLER, IERROR) | ||
INTEGER SESSION, ERRHANDLER, IERROR | ||
Fortran 2008 Syntax | ||
^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. code-block:: fortran | ||
USE mpi_f08 | ||
MPI_Session_set_errhandler(session, errhandler, ierror) | ||
TYPE(MPI_Session), INTENT(IN) :: session | ||
TYPE(MPI_Errhandler), INTENT(IN) :: errhandler | ||
INTEGER, OPTIONAL, INTENT(OUT) :: ierror | ||
INPUT/OUTPUT PARAMETER | ||
---------------------- | ||
* ``session``: Session (handle). | ||
|
||
OUTPUT PARAMETERS | ||
----------------- | ||
* ``errhandler``: New error handler for session (handle). | ||
* ``IERROR``: Fortran only: Error status (integer). | ||
|
||
DESCRIPTION | ||
----------- | ||
|
||
:ref:`MPI_Session_set_errhandler` attaches a new error handler to a session. | ||
The error handler must be either a predefined error handler or an error | ||
handler created by a call to :ref:`MPI_Session_create_errhandler`. | ||
|
||
|
||
ERRORS | ||
------ | ||
|
||
Almost all MPI routines return an error value; C routines as the value | ||
of the function and Fortran routines in the last argument. | ||
|
||
Before the error value is returned, the current MPI error handler is | ||
called. By default, this error handler aborts the MPI job, except for | ||
I/O function errors. The error handler may be changed with | ||
:ref:`MPI_Session_set_errhandler`; the predefined error handler MPI_ERRORS_RETURN | ||
may be used to cause error values to be returned. Note that MPI does not | ||
guarantee that an MPI program can continue past an error. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana | ||
* University Research and Technology | ||
* Corporation. All rights reserved. | ||
* Copyright (c) 2004-2020 The University of Tennessee and The University | ||
* of Tennessee Research Foundation. All rights | ||
* reserved. | ||
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart, | ||
* University of Stuttgart. All rights reserved. | ||
* Copyright (c) 2004-2005 The Regents of the University of California. | ||
* All rights reserved. | ||
* Copyright (c) 2015 Research Organization for Information Science | ||
* and Technology (RIST). All rights reserved. | ||
* Copyright (c) 2022 Triad National Security, LLC. All rights | ||
* reserved. | ||
* $COPYRIGHT$ | ||
* | ||
* Additional copyrights may follow | ||
* | ||
* $HEADER$ | ||
*/ | ||
#include "ompi_config.h" | ||
#include <stdio.h> | ||
|
||
#include "ompi/mpi/c/bindings.h" | ||
#include "ompi/runtime/params.h" | ||
#include "ompi/sessionunicator/sessionunicator.h" | ||
#include "ompi/errhandler/errhandler.h" | ||
#include "ompi/memchecker.h" | ||
|
||
#if OMPI_BUILD_MPI_PROFILING | ||
#if OPAL_HAVE_WEAK_SYMBOLS | ||
#pragma weak MPI_Session_call_errhandler = PMPI_Session_call_errhandler | ||
#endif | ||
#define MPI_Session_call_errhandler PMPI_Session_call_errhandler | ||
#endif | ||
|
||
|
||
static const char FUNC_NAME[] = "MPI_Session_call_errhandler"; | ||
|
||
|
||
int MPI_Session_call_errhandler(MPI_Session session, int errorcode) | ||
{ | ||
/* Error checking */ | ||
|
||
if (MPI_PARAM_CHECK) { | ||
OMPI_ERR_INIT_FINALIZE(FUNC_NAME); | ||
if (NULL == session) { | ||
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME); | ||
} | ||
} | ||
|
||
/* Invoke the errhandler */ | ||
|
||
OMPI_ERRHANDLER_INVOKE(session, errorcode, FUNC_NAME); | ||
|
||
return MPI_SUCCESS; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ | ||
/* | ||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana | ||
* University Research and Technology | ||
* Corporation. All rights reserved. | ||
* Copyright (c) 2004-2020 The University of Tennessee and The University | ||
* of Tennessee Research Foundation. All rights | ||
* reserved. | ||
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart, | ||
* University of Stuttgart. All rights reserved. | ||
* Copyright (c) 2004-2005 The Regents of the University of California. | ||
* All rights reserved. | ||
* Copyright (c) 2007-2009 Cisco Systems, Inc. All rights reserved. | ||
* Copyright (c) 2015-2017 Research Organization for Information Science | ||
* and Technology (RIST). All rights reserved. | ||
* Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights | ||
* reserved. | ||
* Copyright (c) 2022 Triad National Security, LLC. All rights | ||
* reserved. | ||
* $COPYRIGHT$ | ||
* | ||
* Additional copyrights may follow | ||
* | ||
* $HEADER$ | ||
*/ | ||
#include "ompi_config.h" | ||
#include <stdio.h> | ||
|
||
#include "ompi/mpi/c/bindings.h" | ||
#include "ompi/runtime/params.h" | ||
#include "ompi/errhandler/errhandler.h" | ||
#include "ompi/instance/instance.h" | ||
|
||
#if OMPI_BUILD_MPI_PROFILING | ||
#if OPAL_HAVE_WEAK_SYMBOLS | ||
#pragma weak MPI_Session_get_errhandler = PMPI_Session_get_errhandler | ||
#endif | ||
#define MPI_Session_get_errhandler PMPI_Session_get_errhandler | ||
#endif | ||
|
||
|
||
static const char FUNC_NAME[] = "MPI_Session_get_errhandler"; | ||
|
||
|
||
int MPI_Session_get_errhandler(MPI_Session session, MPI_Errhandler *errhandler) | ||
{ | ||
int ret = MPI_SUCCESS; | ||
|
||
/* Error checking */ | ||
|
||
if (MPI_PARAM_CHECK) { | ||
OMPI_ERR_INIT_FINALIZE(FUNC_NAME); | ||
if (NULL == session) { | ||
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME); | ||
} | ||
} | ||
|
||
#if 0 | ||
OPAL_THREAD_LOCK(&(comm->c_lock)); | ||
#endif | ||
/* Retain the errhandler, corresponding to object refcount decrease | ||
in errhandler_free.c. */ | ||
OBJ_RETAIN(session->error_handler); | ||
*errhandler = session->error_handler; | ||
#if 0 | ||
OPAL_THREAD_UNLOCK(&(comm->c_lock)); | ||
#endif | ||
|
||
/* make sure the infrastructure is initialized */ | ||
ret = ompi_mpi_instance_retain (); | ||
|
||
/* All done */ | ||
|
||
return ret; | ||
} |
Oops, something went wrong.