MPIControlEventServiceErrorHandler

Definition

/* Error handler should return TRUE to signal the event service thread to exit. */
typedef MPI_BOOL (MPI_DECL2 *MPIControlEventServiceErrorHandler)
                 (MPIControlEventServiceErrorParams *params);

Description

MPIControlEventServiceErrorHandler is a pointer to a control event service error handler callback function. Your event service error handler is invoked from the when the control event service thread encounters an error from mpiControlProcessEvents (when mpiControlProcessEvents fails to return MPIMessageOK).  You can configure the service error handler callback function when starting the event service thread with mpiControlEventServiceStart.

params A pointer to a control event service error params structure
Return Values  
TRUE Event service thread encountered an error and you want to signal the event service thread to exit.
FALSE Event service thread encountered an error, but you do NOT want to signal the event service thread to exit.

Sample Code

Simple event service error handler to report error information and force 
the control event service thread to exit when an error occurs.

/* Event Service Error Handler */ MPI_BOOL MPI_DECL2 eventServiceErrorHandler(MPIControlEventServiceErrorParams *params) { MPI_RESULT errorCode = MPIMessageFATAL_ERROR;
if (params != NULL) { errorCode = params->message; fprintf(stderr, "Controller event service thread encountered error %d: %s\n", errorCode, mpiMessage(errorCode, NULL)); fprintf(stderr, " Error count = %d\n", params->errorCount); } return errorCode; }

See Also

mpiControlEventServiceStart | MPIControlEventServiceErrorConfig | MPIControlEventServiceErrorParams | MPIControlEventServiceStatus