|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
* (C) 2001 by Argonne National Laboratory.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT in top-level directory.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
#include "mpioimpl.h"
|
|
Packit Service |
c5cf8c |
#include "adio_extern.h"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#ifdef MPICH
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* Forward ref for the routine to extract and set the error handler
|
|
Packit Service |
c5cf8c |
in a ROMIO File structure. FIXME: These should be imported from a common
|
|
Packit Service |
c5cf8c |
header file that is also used in errhan/file_set_errhandler.c
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
int MPIR_ROMIO_Get_file_errhand(MPI_File, MPI_Errhandler *);
|
|
Packit Service |
c5cf8c |
int MPIR_ROMIO_Set_file_errhand(MPI_File, MPI_Errhandler);
|
|
Packit Service |
c5cf8c |
void MPIR_Get_file_error_routine(MPI_Errhandler, void (**)(MPI_File *, int *, ...), int *);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* These next two routines are used to allow MPICH to access/set the
|
|
Packit Service |
c5cf8c |
error handers in the MPI_File structure until MPICH knows about the
|
|
Packit Service |
c5cf8c |
file structure, and to handle the errhandler structure, which
|
|
Packit Service |
c5cf8c |
includes a reference count. Not currently used. */
|
|
Packit Service |
c5cf8c |
int MPIR_ROMIO_Set_file_errhand(MPI_File file_ptr, MPI_Errhandler e)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
if (file_ptr == MPI_FILE_NULL)
|
|
Packit Service |
c5cf8c |
ADIOI_DFLT_ERR_HANDLER = e;
|
|
Packit Service |
c5cf8c |
/* --BEGIN ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
else if (file_ptr->cookie != ADIOI_FILE_COOKIE) {
|
|
Packit Service |
c5cf8c |
return MPI_ERR_FILE;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
/* --END ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
else
|
|
Packit Service |
c5cf8c |
file_ptr->err_handler = e;
|
|
Packit Service |
c5cf8c |
return 0;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
int MPIR_ROMIO_Get_file_errhand(MPI_File file_ptr, MPI_Errhandler * e)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
if (file_ptr == MPI_FILE_NULL) {
|
|
Packit Service |
c5cf8c |
if (ADIOI_DFLT_ERR_HANDLER == MPI_ERRORS_RETURN)
|
|
Packit Service |
c5cf8c |
*e = 0;
|
|
Packit Service |
c5cf8c |
else {
|
|
Packit Service |
c5cf8c |
*e = ADIOI_DFLT_ERR_HANDLER;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
/* --BEGIN ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
else if (file_ptr->cookie != ADIOI_FILE_COOKIE) {
|
|
Packit Service |
c5cf8c |
return MPI_ERR_FILE;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
/* --END ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
else {
|
|
Packit Service |
c5cf8c |
if (file_ptr->err_handler == MPI_ERRORS_RETURN)
|
|
Packit Service |
c5cf8c |
*e = 0;
|
|
Packit Service |
c5cf8c |
else
|
|
Packit Service |
c5cf8c |
*e = file_ptr->err_handler;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
return 0;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#endif /* MPICH */
|