This source file includes following definitions.
- MPI_File_open
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 #include "ompi_config.h"
28
29 #include "ompi/mpi/c/bindings.h"
30 #include "ompi/runtime/params.h"
31 #include "ompi/communicator/communicator.h"
32 #include "ompi/errhandler/errhandler.h"
33 #include "ompi/info/info.h"
34 #include "ompi/file/file.h"
35 #include "ompi/mca/io/io.h"
36 #include "ompi/mca/io/base/base.h"
37 #include "ompi/memchecker.h"
38
39
40 extern opal_mutex_t ompi_mpi_file_bootstrap_mutex;
41
42 #if OMPI_BUILD_MPI_PROFILING
43 #if OPAL_HAVE_WEAK_SYMBOLS
44 #pragma weak MPI_File_open = PMPI_File_open
45 #endif
46 #define MPI_File_open PMPI_File_open
47 #endif
48
49 static const char FUNC_NAME[] = "MPI_File_open";
50
51
52 int MPI_File_open(MPI_Comm comm, const char *filename, int amode,
53 MPI_Info info, MPI_File *fh)
54 {
55 int rc;
56
57 MEMCHECKER(
58 memchecker_comm(comm);
59 );
60
61 if (MPI_PARAM_CHECK) {
62 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
63 if (NULL == info || ompi_info_is_freed(info)) {
64 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO,
65 FUNC_NAME);
66 } else if (ompi_comm_invalid(comm)) {
67 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
68 FUNC_NAME);
69 }
70 if (OMPI_COMM_IS_INTER(comm)) {
71 return OMPI_ERRHANDLER_INVOKE (comm, MPI_ERR_COMM,
72 FUNC_NAME);
73 }
74
75 }
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95 opal_mutex_lock(&ompi_mpi_file_bootstrap_mutex);
96
97 rc = mca_base_framework_open(&ompi_io_base_framework, 0);
98 if (OMPI_SUCCESS != rc) {
99 opal_mutex_unlock(&ompi_mpi_file_bootstrap_mutex);
100 return OMPI_ERRHANDLER_INVOKE(MPI_FILE_NULL, rc, FUNC_NAME);
101 }
102 opal_mutex_unlock(&ompi_mpi_file_bootstrap_mutex);
103
104 OPAL_CR_ENTER_LIBRARY();
105
106
107
108 *fh = MPI_FILE_NULL;
109 rc = ompi_file_open(comm, filename, amode, &(info->super), fh);
110
111
112
113
114 OMPI_ERRHANDLER_RETURN(rc, *fh, rc, FUNC_NAME);
115 }