root/ompi/mca/io/romio321/romio/mpi-io/mpich_fileutil.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. MPIR_ROMIO_Set_file_errhand
  2. MPIR_ROMIO_Get_file_errhand

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
   2 /*  
   3  *  (C) 2001 by Argonne National Laboratory.
   4  *      See COPYRIGHT in top-level directory.
   5  */
   6 #include "mpioimpl.h"
   7 #include "adio_extern.h"
   8 
   9 #ifdef MPICH
  10 
  11 /* Forward ref for the routine to extract and set the error handler
  12    in a ROMIO File structure.  FIXME: These should be imported from a common
  13    header file that is also used in errhan/file_set_errhandler.c
  14  */
  15 int MPIR_ROMIO_Get_file_errhand( MPI_File, MPI_Errhandler * );
  16 int MPIR_ROMIO_Set_file_errhand( MPI_File, MPI_Errhandler );
  17 void MPIR_Get_file_error_routine( MPI_Errhandler, 
  18                                   void (**)(MPI_File *, int *, ...), 
  19                                   int * );
  20 
  21 /* These next two routines are used to allow MPICH to access/set the
  22    error handers in the MPI_File structure until MPICH knows about the
  23    file structure, and to handle the errhandler structure, which 
  24    includes a reference count.  Not currently used. */
  25 int MPIR_ROMIO_Set_file_errhand( MPI_File file_ptr, MPI_Errhandler e )
  26 {
  27     if (file_ptr == MPI_FILE_NULL) ADIOI_DFLT_ERR_HANDLER = e;
  28     /* --BEGIN ERROR HANDLING-- */
  29     else if (file_ptr->cookie != ADIOI_FILE_COOKIE) {
  30         return MPI_ERR_FILE;
  31     }
  32     /* --END ERROR HANDLING-- */
  33     else 
  34         file_ptr->err_handler = e;
  35     return 0;
  36 }
  37 int MPIR_ROMIO_Get_file_errhand( MPI_File file_ptr, MPI_Errhandler *e )
  38 {
  39     if (file_ptr == MPI_FILE_NULL) {
  40         if (ADIOI_DFLT_ERR_HANDLER == MPI_ERRORS_RETURN)
  41             *e = 0;
  42         else {
  43             *e = ADIOI_DFLT_ERR_HANDLER;
  44         }
  45     }
  46     /* --BEGIN ERROR HANDLING-- */
  47     else if (file_ptr->cookie != ADIOI_FILE_COOKIE) {
  48         return MPI_ERR_FILE;
  49     }
  50     /* --END ERROR HANDLING-- */
  51     else {
  52         if (file_ptr->err_handler == MPI_ERRORS_RETURN) 
  53             *e = 0;
  54         else
  55             *e = file_ptr->err_handler;
  56     }
  57     return 0;
  58 }
  59 
  60 #endif /* MPICH */

/* [<][>][^][v][top][bottom][index][help] */