This source file includes following definitions.
- MPI_File_write_all_begin
- MPIOI_File_write_all_begin
1
2
3
4
5
6
7
8 #include "mpioimpl.h"
9
10 #ifdef HAVE_WEAK_SYMBOLS
11
12 #if defined(HAVE_PRAGMA_WEAK)
13 #pragma weak MPI_File_write_all_begin = PMPI_File_write_all_begin
14 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
15 #pragma _HP_SECONDARY_DEF PMPI_File_write_all_begin MPI_File_write_all_begin
16 #elif defined(HAVE_PRAGMA_CRI_DUP)
17 #pragma _CRI duplicate MPI_File_write_all_begin as PMPI_File_write_all_begin
18
19 #elif defined(HAVE_WEAK_ATTRIBUTE)
20 int MPI_File_write_all_begin(MPI_File fh, const void *buf, int count, MPI_Datatype datatype)
21 __attribute__((weak,alias("PMPI_File_write_all_begin")));
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
41 int MPI_File_write_all_begin(MPI_File fh, ROMIO_CONST void *buf, int count,
42 MPI_Datatype datatype)
43 {
44 int error_code;
45 static char myname[] = "MPI_FILE_WRITE_ALL_BEGIN";
46
47 error_code = MPIOI_File_write_all_begin(fh, (MPI_Offset) 0,
48 ADIO_INDIVIDUAL, buf, count,
49 datatype, myname);
50
51 return error_code;
52 }
53
54
55 #ifdef MPIO_BUILD_PROFILING
56 int MPIOI_File_write_all_begin(MPI_File fh,
57 MPI_Offset offset,
58 int file_ptr_type,
59 const void *buf,
60 int count,
61 MPI_Datatype datatype,
62 char *myname)
63 {
64 int error_code;
65 MPI_Count datatype_size;
66 ADIO_File adio_fh;
67 void *e32buf=NULL;
68 const void *xbuf=NULL;
69
70 ROMIO_THREAD_CS_ENTER();
71
72 adio_fh = MPIO_File_resolve(fh);
73
74
75 MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
76 MPIO_CHECK_COUNT(adio_fh, count, myname, error_code);
77 MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code);
78 MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code);
79
80 if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0)
81 {
82 error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
83 myname, __LINE__, MPI_ERR_ARG,
84 "**iobadoffset", 0);
85 error_code = MPIO_Err_return_file(adio_fh, error_code);
86 goto fn_exit;
87 }
88
89 if (adio_fh->split_coll_count)
90 {
91 error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
92 myname, __LINE__, MPI_ERR_IO,
93 "**iosplitcoll", 0);
94 error_code = MPIO_Err_return_file(adio_fh, error_code);
95 goto fn_exit;
96 }
97
98
99 adio_fh->split_coll_count = 1;
100
101 MPI_Type_size_x(datatype, &datatype_size);
102
103 MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code);
104 MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code);
105
106
107
108 xbuf = buf;
109 if (adio_fh->is_external32) {
110 error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf);
111 if (error_code != MPI_SUCCESS)
112 goto fn_exit;
113
114 xbuf = e32buf;
115 }
116
117 adio_fh->split_datatype = datatype;
118 ADIO_WriteStridedColl(adio_fh, xbuf, count, datatype, file_ptr_type,
119 offset, &adio_fh->split_status, &error_code);
120
121
122 if (error_code != MPI_SUCCESS)
123 error_code = MPIO_Err_return_file(adio_fh, error_code);
124
125
126 fn_exit:
127 if ( e32buf != NULL) ADIOI_Free(e32buf);
128 ROMIO_THREAD_CS_EXIT();
129
130 return error_code;
131 }
132 #endif