This source file includes following definitions.
- MPI_File_get_errhandler
1
2
3
4
5
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
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
25 #define MPIO_BUILD_PROFILING
26 #include "mpioprof.h"
27 #endif
28
29
30
31
32
33
34
35
36
37
38
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
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
64
65 *errhandler = fh->err_handler;
66 }
67
68 fn_exit:
69 ROMIO_THREAD_CS_EXIT();
70 return MPI_SUCCESS;
71 }