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

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_File_get_errhandler

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
   2 /* 
   3  *
   4  *   Copyright (C) 1997 University of Chicago. 
   5  *   See COPYRIGHT notice in top-level directory.
   6  */
   7 
   8 #include "mpioimpl.h"
   9 #include "adio_extern.h"
  10 
  11 #ifdef HAVE_WEAK_SYMBOLS
  12 
  13 #if defined(HAVE_PRAGMA_WEAK)
  14 #pragma weak MPI_File_get_errhandler = PMPI_File_get_errhandler
  15 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
  16 #pragma _HP_SECONDARY_DEF PMPI_File_get_errhandler MPI_File_get_errhandler
  17 #elif defined(HAVE_PRAGMA_CRI_DUP)
  18 #pragma _CRI duplicate MPI_File_get_errhandler as PMPI_File_get_errhandler
  19 /* end of weak pragmas */
  20 #elif defined(HAVE_WEAK_ATTRIBUTE)
  21 int MPI_File_get_errhandler(MPI_File file, MPI_Errhandler *errhandler) __attribute__((weak,alias("PMPI_File_get_errhandler")));
  22 #endif
  23 
  24 /* Include mapping from MPI->PMPI */
  25 #define MPIO_BUILD_PROFILING
  26 #include "mpioprof.h"
  27 #endif
  28 
  29 /*@
  30     MPI_File_get_errhandler - Returns the error handler for a file
  31 
  32 Input Parameters:
  33 . fh - file handle (handle)
  34 
  35 Output Parameters:
  36 . errhandler - error handler (handle)
  37 
  38 .N fortran
  39 @*/
  40 int MPI_File_get_errhandler(MPI_File mpi_fh, MPI_Errhandler *errhandler)
  41 {
  42     int error_code = MPI_SUCCESS;
  43     ADIO_File fh;
  44     static char myname[] = "MPI_FILE_GET_ERRHANDLER";
  45     MPID_THREADPRIV_DECL;
  46 
  47     ROMIO_THREAD_CS_ENTER();
  48 
  49     if (mpi_fh == MPI_FILE_NULL) {
  50         *errhandler = ADIOI_DFLT_ERR_HANDLER;
  51     }
  52     else {
  53         fh = MPIO_File_resolve(mpi_fh);
  54         /* --BEGIN ERROR HANDLING-- */
  55         if ((fh <= (MPI_File) 0) || ((fh)->cookie != ADIOI_FILE_COOKIE))
  56         {
  57             error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
  58                                               myname, __LINE__, MPI_ERR_ARG,
  59                                               "**iobadfh", 0);
  60             error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);
  61             goto fn_exit;
  62         }
  63         /* --END ERROR HANDLING-- */
  64 
  65         *errhandler = fh->err_handler;
  66     }
  67 
  68 fn_exit:
  69     ROMIO_THREAD_CS_EXIT();
  70     return MPI_SUCCESS;
  71 }

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