Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
MpiWrapper.hpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
10#pragma once
11
19#include "shamcomm/mpi.hpp"
20
21// #define MPI_LOGGER_ENABLED
22
23#ifdef MPI_LOGGER_ENABLED
24 // https://stackoverflow.com/questions/6245735/pretty-print-stdtuple
25 #include <iostream>
26 #include <string>
27 #include <tuple>
28 #include <utility>
29 #include <vector>
30
31template<class TupType, size_t... I>
32inline void __print_tuple(const TupType &_tup, std::index_sequence<I...>) {
33 std::cout << "(";
34 (..., (std::cout << (I == 0 ? "" : ", ") << std::get<I>(_tup)));
35 std::cout << ")\n";
36}
37
38template<class... T>
39inline void __print_tuple(const std::tuple<T...> &_tup) {
40 __print_tuple(_tup, std::make_index_sequence<sizeof...(T)>());
41}
42 #define CALL_LOG_RETURN(a, b) \
43 std::cout << "%MPI_TRACE:" << #a; \
44 __print_tuple(std::make_tuple b); \
45 return a b
46
47#else
48 #define CALL_LOG_RETURN(a, b) return a b
49#endif
50
51namespace mpi {
52
53 inline int abort(MPI_Comm comm, int errorcode) {
54 CALL_LOG_RETURN(MPI_Abort, (comm, errorcode));
55 }
56 inline int accumulate(
57 const void *origin_addr,
58 int origin_count,
59 MPI_Datatype origin_datatype,
60 int target_rank,
61 MPI_Aint target_disp,
62 int target_count,
63 MPI_Datatype target_datatype,
64 MPI_Op op,
65 MPI_Win win) {
66 CALL_LOG_RETURN(
67 MPI_Accumulate,
68 (origin_addr,
69 origin_count,
70 origin_datatype,
71 target_rank,
72 target_disp,
73 target_count,
74 target_datatype,
75 op,
76 win));
77 }
78 inline int add_error_class(int *errorclass) {
79 CALL_LOG_RETURN(MPI_Add_error_class, (errorclass));
80 }
81 inline int add_error_code(int errorclass, int *errorcode) {
82 CALL_LOG_RETURN(MPI_Add_error_code, (errorclass, errorcode));
83 }
84 inline int add_error_string(int errorcode, const char *string) {
85 CALL_LOG_RETURN(MPI_Add_error_string, (errorcode, string));
86 }
87 inline int alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr) {
88 CALL_LOG_RETURN(MPI_Alloc_mem, (size, info, baseptr));
89 }
90 inline int iallreduce(
91 const void *sendbuf,
92 void *recvbuf,
93 int count,
94 MPI_Datatype datatype,
95 MPI_Op op,
96 MPI_Comm comm,
97 MPI_Request *request) {
98 CALL_LOG_RETURN(MPI_Iallreduce, (sendbuf, recvbuf, count, datatype, op, comm, request));
99 }
100 inline int alltoall(
101 const void *sendbuf,
102 int sendcount,
103 MPI_Datatype sendtype,
104 void *recvbuf,
105 int recvcount,
106 MPI_Datatype recvtype,
107 MPI_Comm comm) {
108 CALL_LOG_RETURN(
109 MPI_Alltoall, (sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm));
110 }
111 inline int ialltoall(
112 const void *sendbuf,
113 int sendcount,
114 MPI_Datatype sendtype,
115 void *recvbuf,
116 int recvcount,
117 MPI_Datatype recvtype,
118 MPI_Comm comm,
119 MPI_Request *request) {
120 CALL_LOG_RETURN(
121 MPI_Ialltoall,
122 (sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request));
123 }
124 inline int alltoallv(
125 const void *sendbuf,
126 const int sendcounts[],
127 const int sdispls[],
128 MPI_Datatype sendtype,
129 void *recvbuf,
130 const int recvcounts[],
131 const int rdispls[],
132 MPI_Datatype recvtype,
133 MPI_Comm comm) {
134 CALL_LOG_RETURN(
135 MPI_Alltoallv,
136 (sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm));
137 }
138 inline int ialltoallv(
139 const void *sendbuf,
140 const int sendcounts[],
141 const int sdispls[],
142 MPI_Datatype sendtype,
143 void *recvbuf,
144 const int recvcounts[],
145 const int rdispls[],
146 MPI_Datatype recvtype,
147 MPI_Comm comm,
148 MPI_Request *request) {
149 CALL_LOG_RETURN(
150 MPI_Ialltoallv,
151 (sendbuf,
152 sendcounts,
153 sdispls,
154 sendtype,
155 recvbuf,
156 recvcounts,
157 rdispls,
158 recvtype,
159 comm,
160 request));
161 }
162 inline int alltoallw(
163 const void *sendbuf,
164 const int sendcounts[],
165 const int sdispls[],
166 const MPI_Datatype sendtypes[],
167 void *recvbuf,
168 const int recvcounts[],
169 const int rdispls[],
170 const MPI_Datatype recvtypes[],
171 MPI_Comm comm) {
172 CALL_LOG_RETURN(
173 MPI_Alltoallw,
174 (sendbuf,
175 sendcounts,
176 sdispls,
177 sendtypes,
178 recvbuf,
179 recvcounts,
180 rdispls,
181 recvtypes,
182 comm));
183 }
184 inline int ialltoallw(
185 const void *sendbuf,
186 const int sendcounts[],
187 const int sdispls[],
188 const MPI_Datatype sendtypes[],
189 void *recvbuf,
190 const int recvcounts[],
191 const int rdispls[],
192 const MPI_Datatype recvtypes[],
193 MPI_Comm comm,
194 MPI_Request *request) {
195 CALL_LOG_RETURN(
196 MPI_Ialltoallw,
197 (sendbuf,
198 sendcounts,
199 sdispls,
200 sendtypes,
201 recvbuf,
202 recvcounts,
203 rdispls,
204 recvtypes,
205 comm,
206 request));
207 }
208 inline int barrier(MPI_Comm comm) { CALL_LOG_RETURN(MPI_Barrier, (comm)); }
209 inline int ibarrier(MPI_Comm comm, MPI_Request *request) {
210 CALL_LOG_RETURN(MPI_Ibarrier, (comm, request));
211 }
212 inline int bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm) {
213 CALL_LOG_RETURN(MPI_Bcast, (buffer, count, datatype, root, comm));
214 }
215 inline int bsend(
216 const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
217 CALL_LOG_RETURN(MPI_Bsend, (buf, count, datatype, dest, tag, comm));
218 }
219 inline int ibcast(
220 void *buffer,
221 int count,
222 MPI_Datatype datatype,
223 int root,
224 MPI_Comm comm,
225 MPI_Request *request) {
226 CALL_LOG_RETURN(MPI_Ibcast, (buffer, count, datatype, root, comm, request));
227 }
228 inline int bsend_init(
229 const void *buf,
230 int count,
231 MPI_Datatype datatype,
232 int dest,
233 int tag,
234 MPI_Comm comm,
235 MPI_Request *request) {
236 CALL_LOG_RETURN(MPI_Bsend_init, (buf, count, datatype, dest, tag, comm, request));
237 }
238 inline int buffer_attach(void *buffer, int size) {
239 CALL_LOG_RETURN(MPI_Buffer_attach, (buffer, size));
240 }
241 inline int buffer_detach(void *buffer, int *size) {
242 CALL_LOG_RETURN(MPI_Buffer_detach, (buffer, size));
243 }
244 inline int cancel(MPI_Request *request) { CALL_LOG_RETURN(MPI_Cancel, (request)); }
245 inline int cart_coords(MPI_Comm comm, int rank, int maxdims, int coords[]) {
246 CALL_LOG_RETURN(MPI_Cart_coords, (comm, rank, maxdims, coords));
247 }
248 inline int cart_create(
249 MPI_Comm old_comm,
250 int ndims,
251 const int dims[],
252 const int periods[],
253 int reorder,
254 MPI_Comm *comm_cart) {
255 CALL_LOG_RETURN(MPI_Cart_create, (old_comm, ndims, dims, periods, reorder, comm_cart));
256 }
257 inline int cart_get(MPI_Comm comm, int maxdims, int dims[], int periods[], int coords[]) {
258 CALL_LOG_RETURN(MPI_Cart_get, (comm, maxdims, dims, periods, coords));
259 }
260 inline int cart_map(
261 MPI_Comm comm, int ndims, const int dims[], const int periods[], int *newrank) {
262 CALL_LOG_RETURN(MPI_Cart_map, (comm, ndims, dims, periods, newrank));
263 }
264 inline int cart_rank(MPI_Comm comm, const int coords[], int *rank) {
265 CALL_LOG_RETURN(MPI_Cart_rank, (comm, coords, rank));
266 }
267 inline int cart_shift(
268 MPI_Comm comm, int direction, int disp, int *rank_source, int *rank_dest) {
269 CALL_LOG_RETURN(MPI_Cart_shift, (comm, direction, disp, rank_source, rank_dest));
270 }
271 inline int cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *new_comm) {
272 CALL_LOG_RETURN(MPI_Cart_sub, (comm, remain_dims, new_comm));
273 }
274 inline int cartdim_get(MPI_Comm comm, int *ndims) {
275 CALL_LOG_RETURN(MPI_Cartdim_get, (comm, ndims));
276 }
277 inline int close_port(const char *port_name) { CALL_LOG_RETURN(MPI_Close_port, (port_name)); }
278 inline int comm_accept(
279 const char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm) {
280 CALL_LOG_RETURN(MPI_Comm_accept, (port_name, info, root, comm, newcomm));
281 }
282 inline MPI_Fint comm_c2f(MPI_Comm comm) { CALL_LOG_RETURN(MPI_Comm_c2f, (comm)); }
283 inline int comm_call_errhandler(MPI_Comm comm, int errorcode) {
284 CALL_LOG_RETURN(MPI_Comm_call_errhandler, (comm, errorcode));
285 }
286 inline int comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result) {
287 CALL_LOG_RETURN(MPI_Comm_compare, (comm1, comm2, result));
288 }
289 inline int comm_connect(
290 const char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm) {
291 CALL_LOG_RETURN(MPI_Comm_connect, (port_name, info, root, comm, newcomm));
292 }
293 inline int comm_create_errhandler(
294 MPI_Comm_errhandler_function *function, MPI_Errhandler *errhandler) {
295 CALL_LOG_RETURN(MPI_Comm_create_errhandler, (function, errhandler));
296 }
297 inline int comm_create_keyval(
298 MPI_Comm_copy_attr_function *comm_copy_attr_fn,
299 MPI_Comm_delete_attr_function *comm_delete_attr_fn,
300 int *comm_keyval,
301 void *extra_state) {
302 CALL_LOG_RETURN(
303 MPI_Comm_create_keyval,
304 (comm_copy_attr_fn, comm_delete_attr_fn, comm_keyval, extra_state));
305 }
306 inline int comm_create_group(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm *newcomm) {
307 CALL_LOG_RETURN(MPI_Comm_create_group, (comm, group, tag, newcomm));
308 }
309 inline int comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm) {
310 CALL_LOG_RETURN(MPI_Comm_create, (comm, group, newcomm));
311 }
312 inline int comm_delete_attr(MPI_Comm comm, int comm_keyval) {
313 CALL_LOG_RETURN(MPI_Comm_delete_attr, (comm, comm_keyval));
314 }
315 inline int comm_disconnect(MPI_Comm *comm) { CALL_LOG_RETURN(MPI_Comm_disconnect, (comm)); }
316 inline int comm_dup(MPI_Comm comm, MPI_Comm *newcomm) {
317 CALL_LOG_RETURN(MPI_Comm_dup, (comm, newcomm));
318 }
319 inline int comm_idup(MPI_Comm comm, MPI_Comm *newcomm, MPI_Request *request) {
320 CALL_LOG_RETURN(MPI_Comm_idup, (comm, newcomm, request));
321 }
322 inline int comm_dup_with_info(MPI_Comm comm, MPI_Info info, MPI_Comm *newcomm) {
323 CALL_LOG_RETURN(MPI_Comm_dup_with_info, (comm, info, newcomm));
324 }
325 inline MPI_Comm comm_f2c(MPI_Fint comm) { CALL_LOG_RETURN(MPI_Comm_f2c, (comm)); }
326 inline int comm_free_keyval(int *comm_keyval) {
327 CALL_LOG_RETURN(MPI_Comm_free_keyval, (comm_keyval));
328 }
329 inline int comm_free(MPI_Comm *comm) { CALL_LOG_RETURN(MPI_Comm_free, (comm)); }
330 inline int comm_get_attr(MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag) {
331 CALL_LOG_RETURN(MPI_Comm_get_attr, (comm, comm_keyval, attribute_val, flag));
332 }
333 inline int dist_graph_create(
334 MPI_Comm comm_old,
335 int n,
336 const int nodes[],
337 const int degrees[],
338 const int targets[],
339 const int weights[],
340 MPI_Info info,
341 int reorder,
342 MPI_Comm *newcomm) {
343 CALL_LOG_RETURN(
344 MPI_Dist_graph_create,
345 (comm_old, n, nodes, degrees, targets, weights, info, reorder, newcomm));
346 }
347 inline int dist_graph_create_adjacent(
348 MPI_Comm comm_old,
349 int indegree,
350 const int sources[],
351 const int sourceweights[],
352 int outdegree,
353 const int destinations[],
354 const int destweights[],
355 MPI_Info info,
356 int reorder,
357 MPI_Comm *comm_dist_graph) {
358 CALL_LOG_RETURN(
359 MPI_Dist_graph_create_adjacent,
360 (comm_old,
361 indegree,
362 sources,
363 sourceweights,
364 outdegree,
365 destinations,
366 destweights,
367 info,
368 reorder,
369 comm_dist_graph));
370 }
371 inline int dist_graph_neighbors(
372 MPI_Comm comm,
373 int maxindegree,
374 int sources[],
375 int sourceweights[],
376 int maxoutdegree,
377 int destinations[],
378 int destweights[]) {
379 CALL_LOG_RETURN(
380 MPI_Dist_graph_neighbors,
381 (comm, maxindegree, sources, sourceweights, maxoutdegree, destinations, destweights));
382 }
383 inline int dist_graph_neighbors_count(
384 MPI_Comm comm, int *inneighbors, int *outneighbors, int *weighted) {
385 CALL_LOG_RETURN(
386 MPI_Dist_graph_neighbors_count, (comm, inneighbors, outneighbors, weighted));
387 }
388 inline int comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *erhandler) {
389 CALL_LOG_RETURN(MPI_Comm_get_errhandler, (comm, erhandler));
390 }
391 inline int comm_get_info(MPI_Comm comm, MPI_Info *info_used) {
392 CALL_LOG_RETURN(MPI_Comm_get_info, (comm, info_used));
393 }
394 inline int comm_get_name(MPI_Comm comm, char *comm_name, int *resultlen) {
395 CALL_LOG_RETURN(MPI_Comm_get_name, (comm, comm_name, resultlen));
396 }
397 inline int comm_get_parent(MPI_Comm *parent) { CALL_LOG_RETURN(MPI_Comm_get_parent, (parent)); }
398 inline int comm_group(MPI_Comm comm, MPI_Group *group) {
399 CALL_LOG_RETURN(MPI_Comm_group, (comm, group));
400 }
401 inline int comm_join(int fd, MPI_Comm *intercomm) {
402 CALL_LOG_RETURN(MPI_Comm_join, (fd, intercomm));
403 }
404 inline int comm_rank(MPI_Comm comm, int *rank) { CALL_LOG_RETURN(MPI_Comm_rank, (comm, rank)); }
405 inline int comm_remote_group(MPI_Comm comm, MPI_Group *group) {
406 CALL_LOG_RETURN(MPI_Comm_remote_group, (comm, group));
407 }
408 inline int comm_remote_size(MPI_Comm comm, int *size) {
409 CALL_LOG_RETURN(MPI_Comm_remote_size, (comm, size));
410 }
411 inline int comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val) {
412 CALL_LOG_RETURN(MPI_Comm_set_attr, (comm, comm_keyval, attribute_val));
413 }
414 inline int comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler) {
415 CALL_LOG_RETURN(MPI_Comm_set_errhandler, (comm, errhandler));
416 }
417 inline int comm_set_info(MPI_Comm comm, MPI_Info info) {
418 CALL_LOG_RETURN(MPI_Comm_set_info, (comm, info));
419 }
420 inline int comm_set_name(MPI_Comm comm, const char *comm_name) {
421 CALL_LOG_RETURN(MPI_Comm_set_name, (comm, comm_name));
422 }
423 inline int comm_size(MPI_Comm comm, int *size) { CALL_LOG_RETURN(MPI_Comm_size, (comm, size)); }
424 inline int comm_spawn(
425 const char *command,
426 char *argv[],
427 int maxprocs,
428 MPI_Info info,
429 int root,
430 MPI_Comm comm,
431 MPI_Comm *intercomm,
432 int array_of_errcodes[]) {
433 CALL_LOG_RETURN(
434 MPI_Comm_spawn,
435 (command, argv, maxprocs, info, root, comm, intercomm, array_of_errcodes));
436 }
437 inline int comm_spawn_multiple(
438 int count,
439 char *array_of_commands[],
440 char **array_of_argv[],
441 const int array_of_maxprocs[],
442 const MPI_Info array_of_info[],
443 int root,
444 MPI_Comm comm,
445 MPI_Comm *intercomm,
446 int array_of_errcodes[]) {
447 CALL_LOG_RETURN(
448 MPI_Comm_spawn_multiple,
449 (count,
450 array_of_commands,
451 array_of_argv,
452 array_of_maxprocs,
453 array_of_info,
454 root,
455 comm,
456 intercomm,
457 array_of_errcodes));
458 }
459 inline int comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm) {
460 CALL_LOG_RETURN(MPI_Comm_split, (comm, color, key, newcomm));
461 }
462 inline int comm_split_type(
463 MPI_Comm comm, int split_type, int key, MPI_Info info, MPI_Comm *newcomm) {
464 CALL_LOG_RETURN(MPI_Comm_split_type, (comm, split_type, key, info, newcomm));
465 }
466 inline int comm_test_inter(MPI_Comm comm, int *flag) {
467 CALL_LOG_RETURN(MPI_Comm_test_inter, (comm, flag));
468 }
469 inline int compare_and_swap(
470 const void *origin_addr,
471 const void *compare_addr,
472 void *result_addr,
473 MPI_Datatype datatype,
474 int target_rank,
475 MPI_Aint target_disp,
476 MPI_Win win) {
477 CALL_LOG_RETURN(
478 MPI_Compare_and_swap,
479 (origin_addr, compare_addr, result_addr, datatype, target_rank, target_disp, win));
480 }
481 inline int dims_create(int nnodes, int ndims, int dims[]) {
482 CALL_LOG_RETURN(MPI_Dims_create, (nnodes, ndims, dims));
483 }
484 inline MPI_Fint errhandler_c2f(MPI_Errhandler errhandler) {
485 CALL_LOG_RETURN(MPI_Errhandler_c2f, (errhandler));
486 }
487 inline MPI_Errhandler errhandler_f2c(MPI_Fint errhandler) {
488 CALL_LOG_RETURN(MPI_Errhandler_f2c, (errhandler));
489 }
490 inline int errhandler_free(MPI_Errhandler *errhandler) {
491 CALL_LOG_RETURN(MPI_Errhandler_free, (errhandler));
492 }
493 inline int error_class(int errorcode, int *errorclass) {
494 CALL_LOG_RETURN(MPI_Error_class, (errorcode, errorclass));
495 }
496 inline int error_string(int errorcode, char *string, int *resultlen) {
497 CALL_LOG_RETURN(MPI_Error_string, (errorcode, string, resultlen));
498 }
499 inline int exscan(
500 const void *sendbuf,
501 void *recvbuf,
502 int count,
503 MPI_Datatype datatype,
504 MPI_Op op,
505 MPI_Comm comm) {
506 CALL_LOG_RETURN(MPI_Exscan, (sendbuf, recvbuf, count, datatype, op, comm));
507 }
508 inline int fetch_and_op(
509 const void *origin_addr,
510 void *result_addr,
511 MPI_Datatype datatype,
512 int target_rank,
513 MPI_Aint target_disp,
514 MPI_Op op,
515 MPI_Win win) {
516 CALL_LOG_RETURN(
517 MPI_Fetch_and_op,
518 (origin_addr, result_addr, datatype, target_rank, target_disp, op, win));
519 }
520 inline int iexscan(
521 const void *sendbuf,
522 void *recvbuf,
523 int count,
524 MPI_Datatype datatype,
525 MPI_Op op,
526 MPI_Comm comm,
527 MPI_Request *request) {
528 CALL_LOG_RETURN(MPI_Iexscan, (sendbuf, recvbuf, count, datatype, op, comm, request));
529 }
530 inline MPI_Fint file_c2f(MPI_File file) { CALL_LOG_RETURN(MPI_File_c2f, (file)); }
531 inline MPI_File file_f2c(MPI_Fint file) { CALL_LOG_RETURN(MPI_File_f2c, (file)); }
532 inline int file_call_errhandler(MPI_File fh, int errorcode) {
533 CALL_LOG_RETURN(MPI_File_call_errhandler, (fh, errorcode));
534 }
535 inline int file_create_errhandler(
536 MPI_File_errhandler_function *function, MPI_Errhandler *errhandler) {
537 CALL_LOG_RETURN(MPI_File_create_errhandler, (function, errhandler));
538 }
539 inline int file_set_errhandler(MPI_File file, MPI_Errhandler errhandler) {
540 CALL_LOG_RETURN(MPI_File_set_errhandler, (file, errhandler));
541 }
542 inline int file_get_errhandler(MPI_File file, MPI_Errhandler *errhandler) {
543 CALL_LOG_RETURN(MPI_File_get_errhandler, (file, errhandler));
544 }
545 inline int file_delete(const char *filename, MPI_Info info) {
546 CALL_LOG_RETURN(MPI_File_delete, (filename, info));
547 }
548 inline int file_set_size(MPI_File fh, MPI_Offset size) {
549 CALL_LOG_RETURN(MPI_File_set_size, (fh, size));
550 }
551 inline int file_preallocate(MPI_File fh, MPI_Offset size) {
552 CALL_LOG_RETURN(MPI_File_preallocate, (fh, size));
553 }
554 inline int file_get_size(MPI_File fh, MPI_Offset *size) {
555 CALL_LOG_RETURN(MPI_File_get_size, (fh, size));
556 }
557 inline int file_get_group(MPI_File fh, MPI_Group *group) {
558 CALL_LOG_RETURN(MPI_File_get_group, (fh, group));
559 }
560 inline int file_get_amode(MPI_File fh, int *amode) {
561 CALL_LOG_RETURN(MPI_File_get_amode, (fh, amode));
562 }
563 inline int file_set_info(MPI_File fh, MPI_Info info) {
564 CALL_LOG_RETURN(MPI_File_set_info, (fh, info));
565 }
566 inline int file_get_info(MPI_File fh, MPI_Info *info_used) {
567 CALL_LOG_RETURN(MPI_File_get_info, (fh, info_used));
568 }
569 inline int file_get_view(
570 MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, MPI_Datatype *filetype, char *datarep) {
571 CALL_LOG_RETURN(MPI_File_get_view, (fh, disp, etype, filetype, datarep));
572 }
573 inline int file_read_at_all(
574 MPI_File fh,
575 MPI_Offset offset,
576 void *buf,
577 int count,
578 MPI_Datatype datatype,
579 MPI_Status *status) {
580 CALL_LOG_RETURN(MPI_File_read_at_all, (fh, offset, buf, count, datatype, status));
581 }
582 inline int file_write_at_all(
583 MPI_File fh,
584 MPI_Offset offset,
585 const void *buf,
586 int count,
587 MPI_Datatype datatype,
588 MPI_Status *status) {
589 CALL_LOG_RETURN(MPI_File_write_at_all, (fh, offset, buf, count, datatype, status));
590 }
591 inline int file_iread_at(
592 MPI_File fh,
593 MPI_Offset offset,
594 void *buf,
595 int count,
596 MPI_Datatype datatype,
597 MPI_Request *request) {
598 CALL_LOG_RETURN(MPI_File_iread_at, (fh, offset, buf, count, datatype, request));
599 }
600 inline int file_iwrite_at(
601 MPI_File fh,
602 MPI_Offset offset,
603 const void *buf,
604 int count,
605 MPI_Datatype datatype,
606 MPI_Request *request) {
607 CALL_LOG_RETURN(MPI_File_iwrite_at, (fh, offset, buf, count, datatype, request));
608 }
609 inline int file_iread_at_all(
610 MPI_File fh,
611 MPI_Offset offset,
612 void *buf,
613 int count,
614 MPI_Datatype datatype,
615 MPI_Request *request) {
616 CALL_LOG_RETURN(MPI_File_iread_at_all, (fh, offset, buf, count, datatype, request));
617 }
618 inline int file_iwrite_at_all(
619 MPI_File fh,
620 MPI_Offset offset,
621 const void *buf,
622 int count,
623 MPI_Datatype datatype,
624 MPI_Request *request) {
625 CALL_LOG_RETURN(MPI_File_iwrite_at_all, (fh, offset, buf, count, datatype, request));
626 }
627 inline int file_read_all(
628 MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) {
629 CALL_LOG_RETURN(MPI_File_read_all, (fh, buf, count, datatype, status));
630 }
631 inline int file_iread(
632 MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request) {
633 CALL_LOG_RETURN(MPI_File_iread, (fh, buf, count, datatype, request));
634 }
635 inline int file_iwrite(
636 MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request) {
637 CALL_LOG_RETURN(MPI_File_iwrite, (fh, buf, count, datatype, request));
638 }
639 inline int file_iread_all(
640 MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request) {
641 CALL_LOG_RETURN(MPI_File_iread_all, (fh, buf, count, datatype, request));
642 }
643 inline int file_iwrite_all(
644 MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request) {
645 CALL_LOG_RETURN(MPI_File_iwrite_all, (fh, buf, count, datatype, request));
646 }
647 inline int file_seek(MPI_File fh, MPI_Offset offset, int whence) {
648 CALL_LOG_RETURN(MPI_File_seek, (fh, offset, whence));
649 }
650 inline int file_get_position(MPI_File fh, MPI_Offset *offset) {
651 CALL_LOG_RETURN(MPI_File_get_position, (fh, offset));
652 }
653 inline int file_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp) {
654 CALL_LOG_RETURN(MPI_File_get_byte_offset, (fh, offset, disp));
655 }
656 inline int file_read_shared(
657 MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) {
658 CALL_LOG_RETURN(MPI_File_read_shared, (fh, buf, count, datatype, status));
659 }
660 inline int file_write_shared(
661 MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status) {
662 CALL_LOG_RETURN(MPI_File_write_shared, (fh, buf, count, datatype, status));
663 }
664 inline int file_iread_shared(
665 MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request) {
666 CALL_LOG_RETURN(MPI_File_iread_shared, (fh, buf, count, datatype, request));
667 }
668 inline int file_iwrite_shared(
669 MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request) {
670 CALL_LOG_RETURN(MPI_File_iwrite_shared, (fh, buf, count, datatype, request));
671 }
672 inline int file_read_ordered(
673 MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) {
674 CALL_LOG_RETURN(MPI_File_read_ordered, (fh, buf, count, datatype, status));
675 }
676 inline int file_write_ordered(
677 MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status) {
678 CALL_LOG_RETURN(MPI_File_write_ordered, (fh, buf, count, datatype, status));
679 }
680 inline int file_seek_shared(MPI_File fh, MPI_Offset offset, int whence) {
681 CALL_LOG_RETURN(MPI_File_seek_shared, (fh, offset, whence));
682 }
683 inline int file_get_position_shared(MPI_File fh, MPI_Offset *offset) {
684 CALL_LOG_RETURN(MPI_File_get_position_shared, (fh, offset));
685 }
686 inline int file_read_at_all_begin(
687 MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype) {
688 CALL_LOG_RETURN(MPI_File_read_at_all_begin, (fh, offset, buf, count, datatype));
689 }
690 inline int file_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status) {
691 CALL_LOG_RETURN(MPI_File_read_at_all_end, (fh, buf, status));
692 }
693 inline int file_write_at_all_begin(
694 MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype) {
695 CALL_LOG_RETURN(MPI_File_write_at_all_begin, (fh, offset, buf, count, datatype));
696 }
697 inline int file_write_at_all_end(MPI_File fh, const void *buf, MPI_Status *status) {
698 CALL_LOG_RETURN(MPI_File_write_at_all_end, (fh, buf, status));
699 }
700 inline int file_read_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) {
701 CALL_LOG_RETURN(MPI_File_read_all_begin, (fh, buf, count, datatype));
702 }
703 inline int file_read_all_end(MPI_File fh, void *buf, MPI_Status *status) {
704 CALL_LOG_RETURN(MPI_File_read_all_end, (fh, buf, status));
705 }
706 inline int file_write_all_begin(
707 MPI_File fh, const void *buf, int count, MPI_Datatype datatype) {
708 CALL_LOG_RETURN(MPI_File_write_all_begin, (fh, buf, count, datatype));
709 }
710 inline int file_write_all_end(MPI_File fh, const void *buf, MPI_Status *status) {
711 CALL_LOG_RETURN(MPI_File_write_all_end, (fh, buf, status));
712 }
713 inline int file_read_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) {
714 CALL_LOG_RETURN(MPI_File_read_ordered_begin, (fh, buf, count, datatype));
715 }
716 inline int file_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status) {
717 CALL_LOG_RETURN(MPI_File_read_ordered_end, (fh, buf, status));
718 }
719 inline int file_write_ordered_begin(
720 MPI_File fh, const void *buf, int count, MPI_Datatype datatype) {
721 CALL_LOG_RETURN(MPI_File_write_ordered_begin, (fh, buf, count, datatype));
722 }
723 inline int file_write_ordered_end(MPI_File fh, const void *buf, MPI_Status *status) {
724 CALL_LOG_RETURN(MPI_File_write_ordered_end, (fh, buf, status));
725 }
726 inline int file_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent) {
727 CALL_LOG_RETURN(MPI_File_get_type_extent, (fh, datatype, extent));
728 }
729 inline int file_set_atomicity(MPI_File fh, int flag) {
730 CALL_LOG_RETURN(MPI_File_set_atomicity, (fh, flag));
731 }
732 inline int file_get_atomicity(MPI_File fh, int *flag) {
733 CALL_LOG_RETURN(MPI_File_get_atomicity, (fh, flag));
734 }
735 inline int file_sync(MPI_File fh) { CALL_LOG_RETURN(MPI_File_sync, (fh)); }
736 inline int finalize(void) { CALL_LOG_RETURN(MPI_Finalize, ()); }
737 inline int finalized(int *flag) { CALL_LOG_RETURN(MPI_Finalized, (flag)); }
738 inline int free_mem(void *base) { CALL_LOG_RETURN(MPI_Free_mem, (base)); }
739 inline int igather(
740 const void *sendbuf,
741 int sendcount,
742 MPI_Datatype sendtype,
743 void *recvbuf,
744 int recvcount,
745 MPI_Datatype recvtype,
746 int root,
747 MPI_Comm comm,
748 MPI_Request *request) {
749 CALL_LOG_RETURN(
750 MPI_Igather,
751 (sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request));
752 }
753 inline int igatherv(
754 const void *sendbuf,
755 int sendcount,
756 MPI_Datatype sendtype,
757 void *recvbuf,
758 const int recvcounts[],
759 const int displs[],
760 MPI_Datatype recvtype,
761 int root,
762 MPI_Comm comm,
763 MPI_Request *request) {
764 CALL_LOG_RETURN(
765 MPI_Igatherv,
766 (sendbuf,
767 sendcount,
768 sendtype,
769 recvbuf,
770 recvcounts,
771 displs,
772 recvtype,
773 root,
774 comm,
775 request));
776 }
777 inline int get_address(const void *location, MPI_Aint *address) {
778 CALL_LOG_RETURN(MPI_Get_address, (location, address));
779 }
780 inline int get_elements(const MPI_Status *status, MPI_Datatype datatype, int *count) {
781 CALL_LOG_RETURN(MPI_Get_elements, (status, datatype, count));
782 }
783 inline int get_elements_x(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count) {
784 CALL_LOG_RETURN(MPI_Get_elements_x, (status, datatype, count));
785 }
786 inline int get(
787 void *origin_addr,
788 int origin_count,
789 MPI_Datatype origin_datatype,
790 int target_rank,
791 MPI_Aint target_disp,
792 int target_count,
793 MPI_Datatype target_datatype,
794 MPI_Win win) {
795 CALL_LOG_RETURN(
796 MPI_Get,
797 (origin_addr,
798 origin_count,
799 origin_datatype,
800 target_rank,
801 target_disp,
802 target_count,
803 target_datatype,
804 win));
805 }
806 inline int get_accumulate(
807 const void *origin_addr,
808 int origin_count,
809 MPI_Datatype origin_datatype,
810 void *result_addr,
811 int result_count,
812 MPI_Datatype result_datatype,
813 int target_rank,
814 MPI_Aint target_disp,
815 int target_count,
816 MPI_Datatype target_datatype,
817 MPI_Op op,
818 MPI_Win win) {
819 CALL_LOG_RETURN(
820 MPI_Get_accumulate,
821 (origin_addr,
822 origin_count,
823 origin_datatype,
824 result_addr,
825 result_count,
826 result_datatype,
827 target_rank,
828 target_disp,
829 target_count,
830 target_datatype,
831 op,
832 win));
833 }
834 inline int get_library_version(char *version, int *resultlen) {
835 CALL_LOG_RETURN(MPI_Get_library_version, (version, resultlen));
836 }
837 inline int get_processor_name(char *name, int *resultlen) {
838 CALL_LOG_RETURN(MPI_Get_processor_name, (name, resultlen));
839 }
840 inline int get_version(int *version, int *subversion) {
841 CALL_LOG_RETURN(MPI_Get_version, (version, subversion));
842 }
843 inline int graph_create(
844 MPI_Comm comm_old,
845 int nnodes,
846 const int index[],
847 const int edges[],
848 int reorder,
849 MPI_Comm *comm_graph) {
850 CALL_LOG_RETURN(MPI_Graph_create, (comm_old, nnodes, index, edges, reorder, comm_graph));
851 }
852 inline int graph_get(MPI_Comm comm, int maxindex, int maxedges, int index[], int edges[]) {
853 CALL_LOG_RETURN(MPI_Graph_get, (comm, maxindex, maxedges, index, edges));
854 }
855 inline int graph_map(
856 MPI_Comm comm, int nnodes, const int index[], const int edges[], int *newrank) {
857 CALL_LOG_RETURN(MPI_Graph_map, (comm, nnodes, index, edges, newrank));
858 }
859 inline int graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors) {
860 CALL_LOG_RETURN(MPI_Graph_neighbors_count, (comm, rank, nneighbors));
861 }
862 inline int graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, int neighbors[]) {
863 CALL_LOG_RETURN(MPI_Graph_neighbors, (comm, rank, maxneighbors, neighbors));
864 }
865 inline int graphdims_get(MPI_Comm comm, int *nnodes, int *nedges) {
866 CALL_LOG_RETURN(MPI_Graphdims_get, (comm, nnodes, nedges));
867 }
868 inline int grequest_complete(MPI_Request request) {
869 CALL_LOG_RETURN(MPI_Grequest_complete, (request));
870 }
871 inline int grequest_start(
872 MPI_Grequest_query_function *query_fn,
873 MPI_Grequest_free_function *free_fn,
874 MPI_Grequest_cancel_function *cancel_fn,
875 void *extra_state,
876 MPI_Request *request) {
877 CALL_LOG_RETURN(MPI_Grequest_start, (query_fn, free_fn, cancel_fn, extra_state, request));
878 }
879 inline MPI_Fint group_c2f(MPI_Group group) { CALL_LOG_RETURN(MPI_Group_c2f, (group)); }
880 inline int group_compare(MPI_Group group1, MPI_Group group2, int *result) {
881 CALL_LOG_RETURN(MPI_Group_compare, (group1, group2, result));
882 }
883 inline int group_difference(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup) {
884 CALL_LOG_RETURN(MPI_Group_difference, (group1, group2, newgroup));
885 }
886 inline int group_excl(MPI_Group group, int n, const int ranks[], MPI_Group *newgroup) {
887 CALL_LOG_RETURN(MPI_Group_excl, (group, n, ranks, newgroup));
888 }
889 inline MPI_Group group_f2c(MPI_Fint group) { CALL_LOG_RETURN(MPI_Group_f2c, (group)); }
890 inline int group_free(MPI_Group *group) { CALL_LOG_RETURN(MPI_Group_free, (group)); }
891 inline int group_incl(MPI_Group group, int n, const int ranks[], MPI_Group *newgroup) {
892 CALL_LOG_RETURN(MPI_Group_incl, (group, n, ranks, newgroup));
893 }
894 inline int group_intersection(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup) {
895 CALL_LOG_RETURN(MPI_Group_intersection, (group1, group2, newgroup));
896 }
897 inline int group_range_excl(MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup) {
898 CALL_LOG_RETURN(MPI_Group_range_excl, (group, n, ranges, newgroup));
899 }
900 inline int group_range_incl(MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup) {
901 CALL_LOG_RETURN(MPI_Group_range_incl, (group, n, ranges, newgroup));
902 }
903 inline int group_rank(MPI_Group group, int *rank) {
904 CALL_LOG_RETURN(MPI_Group_rank, (group, rank));
905 }
906 inline int group_size(MPI_Group group, int *size) {
907 CALL_LOG_RETURN(MPI_Group_size, (group, size));
908 }
909 inline int group_translate_ranks(
910 MPI_Group group1, int n, const int ranks1[], MPI_Group group2, int ranks2[]) {
911 CALL_LOG_RETURN(MPI_Group_translate_ranks, (group1, n, ranks1, group2, ranks2));
912 }
913 inline int group_union(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup) {
914 CALL_LOG_RETURN(MPI_Group_union, (group1, group2, newgroup));
915 }
916 inline int ibsend(
917 const void *buf,
918 int count,
919 MPI_Datatype datatype,
920 int dest,
921 int tag,
922 MPI_Comm comm,
923 MPI_Request *request) {
924 CALL_LOG_RETURN(MPI_Ibsend, (buf, count, datatype, dest, tag, comm, request));
925 }
926 inline int improbe(
927 int source, int tag, MPI_Comm comm, int *flag, MPI_Message *message, MPI_Status *status) {
928 CALL_LOG_RETURN(MPI_Improbe, (source, tag, comm, flag, message, status));
929 }
930 inline int imrecv(
931 void *buf, int count, MPI_Datatype type, MPI_Message *message, MPI_Request *request) {
932 CALL_LOG_RETURN(MPI_Imrecv, (buf, count, type, message, request));
933 }
934 inline MPI_Fint info_c2f(MPI_Info info) { CALL_LOG_RETURN(MPI_Info_c2f, (info)); }
935 inline int info_create(MPI_Info *info) { CALL_LOG_RETURN(MPI_Info_create, (info)); }
936 inline int info_delete(MPI_Info info, const char *key) {
937 CALL_LOG_RETURN(MPI_Info_delete, (info, key));
938 }
939 inline int info_dup(MPI_Info info, MPI_Info *newinfo) {
940 CALL_LOG_RETURN(MPI_Info_dup, (info, newinfo));
941 }
942 inline MPI_Info info_f2c(MPI_Fint info) { CALL_LOG_RETURN(MPI_Info_f2c, (info)); }
943 inline int info_free(MPI_Info *info) { CALL_LOG_RETURN(MPI_Info_free, (info)); }
944 inline int info_get(MPI_Info info, const char *key, int valuelen, char *value, int *flag) {
945 CALL_LOG_RETURN(MPI_Info_get, (info, key, valuelen, value, flag));
946 }
947 inline int info_get_nkeys(MPI_Info info, int *nkeys) {
948 CALL_LOG_RETURN(MPI_Info_get_nkeys, (info, nkeys));
949 }
950 inline int info_get_nthkey(MPI_Info info, int n, char *key) {
951 CALL_LOG_RETURN(MPI_Info_get_nthkey, (info, n, key));
952 }
953 inline int info_get_valuelen(MPI_Info info, const char *key, int *valuelen, int *flag) {
954 CALL_LOG_RETURN(MPI_Info_get_valuelen, (info, key, valuelen, flag));
955 }
956 inline int info_set(MPI_Info info, const char *key, const char *value) {
957 CALL_LOG_RETURN(MPI_Info_set, (info, key, value));
958 }
959 inline int init(int *argc, char ***argv) { CALL_LOG_RETURN(MPI_Init, (argc, argv)); }
960 inline int initialized(int *flag) { CALL_LOG_RETURN(MPI_Initialized, (flag)); }
961 inline int init_thread(int *argc, char ***argv, int required, int *provided) {
962 CALL_LOG_RETURN(MPI_Init_thread, (argc, argv, required, provided));
963 }
964 inline int intercomm_create(
965 MPI_Comm local_comm,
966 int local_leader,
967 MPI_Comm bridge_comm,
968 int remote_leader,
969 int tag,
970 MPI_Comm *newintercomm) {
971 CALL_LOG_RETURN(
972 MPI_Intercomm_create,
973 (local_comm, local_leader, bridge_comm, remote_leader, tag, newintercomm));
974 }
975 inline int intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintercomm) {
976 CALL_LOG_RETURN(MPI_Intercomm_merge, (intercomm, high, newintercomm));
977 }
978 inline int iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status) {
979 CALL_LOG_RETURN(MPI_Iprobe, (source, tag, comm, flag, status));
980 }
981 inline int irsend(
982 const void *buf,
983 int count,
984 MPI_Datatype datatype,
985 int dest,
986 int tag,
987 MPI_Comm comm,
988 MPI_Request *request) {
989 CALL_LOG_RETURN(MPI_Irsend, (buf, count, datatype, dest, tag, comm, request));
990 }
991 inline int issend(
992 const void *buf,
993 int count,
994 MPI_Datatype datatype,
995 int dest,
996 int tag,
997 MPI_Comm comm,
998 MPI_Request *request) {
999 CALL_LOG_RETURN(MPI_Issend, (buf, count, datatype, dest, tag, comm, request));
1000 }
1001 inline int is_thread_main(int *flag) { CALL_LOG_RETURN(MPI_Is_thread_main, (flag)); }
1002 inline int lookup_name(const char *service_name, MPI_Info info, char *port_name) {
1003 CALL_LOG_RETURN(MPI_Lookup_name, (service_name, info, port_name));
1004 }
1005 inline MPI_Fint message_c2f(MPI_Message message) {
1006 CALL_LOG_RETURN(MPI_Message_c2f, (message));
1007 }
1008 inline MPI_Message message_f2c(MPI_Fint message) {
1009 CALL_LOG_RETURN(MPI_Message_f2c, (message));
1010 }
1011 inline int mprobe(
1012 int source, int tag, MPI_Comm comm, MPI_Message *message, MPI_Status *status) {
1013 CALL_LOG_RETURN(MPI_Mprobe, (source, tag, comm, message, status));
1014 }
1015 inline int mrecv(
1016 void *buf, int count, MPI_Datatype type, MPI_Message *message, MPI_Status *status) {
1017 CALL_LOG_RETURN(MPI_Mrecv, (buf, count, type, message, status));
1018 }
1019 inline int neighbor_allgather(
1020 const void *sendbuf,
1021 int sendcount,
1022 MPI_Datatype sendtype,
1023 void *recvbuf,
1024 int recvcount,
1025 MPI_Datatype recvtype,
1026 MPI_Comm comm) {
1027 CALL_LOG_RETURN(
1028 MPI_Neighbor_allgather,
1029 (sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm));
1030 }
1031 inline int ineighbor_allgather(
1032 const void *sendbuf,
1033 int sendcount,
1034 MPI_Datatype sendtype,
1035 void *recvbuf,
1036 int recvcount,
1037 MPI_Datatype recvtype,
1038 MPI_Comm comm,
1039 MPI_Request *request) {
1040 CALL_LOG_RETURN(
1041 MPI_Ineighbor_allgather,
1042 (sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request));
1043 }
1044 inline int neighbor_allgatherv(
1045 const void *sendbuf,
1046 int sendcount,
1047 MPI_Datatype sendtype,
1048 void *recvbuf,
1049 const int recvcounts[],
1050 const int displs[],
1051 MPI_Datatype recvtype,
1052 MPI_Comm comm) {
1053 CALL_LOG_RETURN(
1054 MPI_Neighbor_allgatherv,
1055 (sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm));
1056 }
1057 inline int ineighbor_allgatherv(
1058 const void *sendbuf,
1059 int sendcount,
1060 MPI_Datatype sendtype,
1061 void *recvbuf,
1062 const int recvcounts[],
1063 const int displs[],
1064 MPI_Datatype recvtype,
1065 MPI_Comm comm,
1066 MPI_Request *request) {
1067 CALL_LOG_RETURN(
1068 MPI_Ineighbor_allgatherv,
1069 (sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, request));
1070 }
1071 inline int neighbor_alltoall(
1072 const void *sendbuf,
1073 int sendcount,
1074 MPI_Datatype sendtype,
1075 void *recvbuf,
1076 int recvcount,
1077 MPI_Datatype recvtype,
1078 MPI_Comm comm) {
1079 CALL_LOG_RETURN(
1080 MPI_Neighbor_alltoall,
1081 (sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm));
1082 }
1083 inline int ineighbor_alltoall(
1084 const void *sendbuf,
1085 int sendcount,
1086 MPI_Datatype sendtype,
1087 void *recvbuf,
1088 int recvcount,
1089 MPI_Datatype recvtype,
1090 MPI_Comm comm,
1091 MPI_Request *request) {
1092 CALL_LOG_RETURN(
1093 MPI_Ineighbor_alltoall,
1094 (sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request));
1095 }
1096 inline int neighbor_alltoallv(
1097 const void *sendbuf,
1098 const int sendcounts[],
1099 const int sdispls[],
1100 MPI_Datatype sendtype,
1101 void *recvbuf,
1102 const int recvcounts[],
1103 const int rdispls[],
1104 MPI_Datatype recvtype,
1105 MPI_Comm comm) {
1106 CALL_LOG_RETURN(
1107 MPI_Neighbor_alltoallv,
1108 (sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm));
1109 }
1110 inline int ineighbor_alltoallv(
1111 const void *sendbuf,
1112 const int sendcounts[],
1113 const int sdispls[],
1114 MPI_Datatype sendtype,
1115 void *recvbuf,
1116 const int recvcounts[],
1117 const int rdispls[],
1118 MPI_Datatype recvtype,
1119 MPI_Comm comm,
1120 MPI_Request *request) {
1121 CALL_LOG_RETURN(
1122 MPI_Ineighbor_alltoallv,
1123 (sendbuf,
1124 sendcounts,
1125 sdispls,
1126 sendtype,
1127 recvbuf,
1128 recvcounts,
1129 rdispls,
1130 recvtype,
1131 comm,
1132 request));
1133 }
1134 inline int neighbor_alltoallw(
1135 const void *sendbuf,
1136 const int sendcounts[],
1137 const MPI_Aint sdispls[],
1138 const MPI_Datatype sendtypes[],
1139 void *recvbuf,
1140 const int recvcounts[],
1141 const MPI_Aint rdispls[],
1142 const MPI_Datatype recvtypes[],
1143 MPI_Comm comm) {
1144 CALL_LOG_RETURN(
1145 MPI_Neighbor_alltoallw,
1146 (sendbuf,
1147 sendcounts,
1148 sdispls,
1149 sendtypes,
1150 recvbuf,
1151 recvcounts,
1152 rdispls,
1153 recvtypes,
1154 comm));
1155 }
1156 inline int ineighbor_alltoallw(
1157 const void *sendbuf,
1158 const int sendcounts[],
1159 const MPI_Aint sdispls[],
1160 const MPI_Datatype sendtypes[],
1161 void *recvbuf,
1162 const int recvcounts[],
1163 const MPI_Aint rdispls[],
1164 const MPI_Datatype recvtypes[],
1165 MPI_Comm comm,
1166 MPI_Request *request) {
1167 CALL_LOG_RETURN(
1168 MPI_Ineighbor_alltoallw,
1169 (sendbuf,
1170 sendcounts,
1171 sdispls,
1172 sendtypes,
1173 recvbuf,
1174 recvcounts,
1175 rdispls,
1176 recvtypes,
1177 comm,
1178 request));
1179 }
1180 inline MPI_Fint op_c2f(MPI_Op op) { CALL_LOG_RETURN(MPI_Op_c2f, (op)); }
1181 inline int op_commutative(MPI_Op op, int *commute) {
1182 CALL_LOG_RETURN(MPI_Op_commutative, (op, commute));
1183 }
1184 inline int op_create(MPI_User_function *function, int commute, MPI_Op *op) {
1185 CALL_LOG_RETURN(MPI_Op_create, (function, commute, op));
1186 }
1187 inline int open_port(MPI_Info info, char *port_name) {
1188 CALL_LOG_RETURN(MPI_Open_port, (info, port_name));
1189 }
1190 inline MPI_Op op_f2c(MPI_Fint op) { CALL_LOG_RETURN(MPI_Op_f2c, (op)); }
1191 inline int op_free(MPI_Op *op) { CALL_LOG_RETURN(MPI_Op_free, (op)); }
1192 inline int pack_external(
1193 const char datarep[],
1194 const void *inbuf,
1195 int incount,
1196 MPI_Datatype datatype,
1197 void *outbuf,
1198 MPI_Aint outsize,
1199 MPI_Aint *position) {
1200 CALL_LOG_RETURN(
1201 MPI_Pack_external, (datarep, inbuf, incount, datatype, outbuf, outsize, position));
1202 }
1203 inline int pack_external_size(
1204 const char datarep[], int incount, MPI_Datatype datatype, MPI_Aint *size) {
1205 CALL_LOG_RETURN(MPI_Pack_external_size, (datarep, incount, datatype, size));
1206 }
1207 inline int pack(
1208 const void *inbuf,
1209 int incount,
1210 MPI_Datatype datatype,
1211 void *outbuf,
1212 int outsize,
1213 int *position,
1214 MPI_Comm comm) {
1215 CALL_LOG_RETURN(MPI_Pack, (inbuf, incount, datatype, outbuf, outsize, position, comm));
1216 }
1217 inline int pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int *size) {
1218 CALL_LOG_RETURN(MPI_Pack_size, (incount, datatype, comm, size));
1219 }
1220 /*
1221 inline int pcontrol(const int level, ...){
1222 CALL_LOG_RETURN(MPI_Pcontrol,(level,...));
1223 }*/
1224 inline int publish_name(const char *service_name, MPI_Info info, const char *port_name) {
1225 CALL_LOG_RETURN(MPI_Publish_name, (service_name, info, port_name));
1226 }
1227 inline int put(
1228 const void *origin_addr,
1229 int origin_count,
1230 MPI_Datatype origin_datatype,
1231 int target_rank,
1232 MPI_Aint target_disp,
1233 int target_count,
1234 MPI_Datatype target_datatype,
1235 MPI_Win win) {
1236 CALL_LOG_RETURN(
1237 MPI_Put,
1238 (origin_addr,
1239 origin_count,
1240 origin_datatype,
1241 target_rank,
1242 target_disp,
1243 target_count,
1244 target_datatype,
1245 win));
1246 }
1247 inline int query_thread(int *provided) { CALL_LOG_RETURN(MPI_Query_thread, (provided)); }
1248 inline int raccumulate(
1249 const void *origin_addr,
1250 int origin_count,
1251 MPI_Datatype origin_datatype,
1252 int target_rank,
1253 MPI_Aint target_disp,
1254 int target_count,
1255 MPI_Datatype target_datatype,
1256 MPI_Op op,
1257 MPI_Win win,
1258 MPI_Request *request) {
1259 CALL_LOG_RETURN(
1260 MPI_Raccumulate,
1261 (origin_addr,
1262 origin_count,
1263 origin_datatype,
1264 target_rank,
1265 target_disp,
1266 target_count,
1267 target_datatype,
1268 op,
1269 win,
1270 request));
1271 }
1272 inline int recv_init(
1273 void *buf,
1274 int count,
1275 MPI_Datatype datatype,
1276 int source,
1277 int tag,
1278 MPI_Comm comm,
1279 MPI_Request *request) {
1280 CALL_LOG_RETURN(MPI_Recv_init, (buf, count, datatype, source, tag, comm, request));
1281 }
1282 inline int reduce(
1283 const void *sendbuf,
1284 void *recvbuf,
1285 int count,
1286 MPI_Datatype datatype,
1287 MPI_Op op,
1288 int root,
1289 MPI_Comm comm) {
1290 CALL_LOG_RETURN(MPI_Reduce, (sendbuf, recvbuf, count, datatype, op, root, comm));
1291 }
1292 inline int ireduce(
1293 const void *sendbuf,
1294 void *recvbuf,
1295 int count,
1296 MPI_Datatype datatype,
1297 MPI_Op op,
1298 int root,
1299 MPI_Comm comm,
1300 MPI_Request *request) {
1301 CALL_LOG_RETURN(MPI_Ireduce, (sendbuf, recvbuf, count, datatype, op, root, comm, request));
1302 }
1303 inline int reduce_local(
1304 const void *inbuf, void *inoutbuf, int count, MPI_Datatype datatype, MPI_Op op) {
1305 CALL_LOG_RETURN(MPI_Reduce_local, (inbuf, inoutbuf, count, datatype, op));
1306 }
1307 inline int reduce_scatter(
1308 const void *sendbuf,
1309 void *recvbuf,
1310 const int recvcounts[],
1311 MPI_Datatype datatype,
1312 MPI_Op op,
1313 MPI_Comm comm) {
1314 CALL_LOG_RETURN(MPI_Reduce_scatter, (sendbuf, recvbuf, recvcounts, datatype, op, comm));
1315 }
1316 inline int ireduce_scatter(
1317 const void *sendbuf,
1318 void *recvbuf,
1319 const int recvcounts[],
1320 MPI_Datatype datatype,
1321 MPI_Op op,
1322 MPI_Comm comm,
1323 MPI_Request *request) {
1324 CALL_LOG_RETURN(
1325 MPI_Ireduce_scatter, (sendbuf, recvbuf, recvcounts, datatype, op, comm, request));
1326 }
1327 inline int reduce_scatter_block(
1328 const void *sendbuf,
1329 void *recvbuf,
1330 int recvcount,
1331 MPI_Datatype datatype,
1332 MPI_Op op,
1333 MPI_Comm comm) {
1334 CALL_LOG_RETURN(
1335 MPI_Reduce_scatter_block, (sendbuf, recvbuf, recvcount, datatype, op, comm));
1336 }
1337 inline int ireduce_scatter_block(
1338 const void *sendbuf,
1339 void *recvbuf,
1340 int recvcount,
1341 MPI_Datatype datatype,
1342 MPI_Op op,
1343 MPI_Comm comm,
1344 MPI_Request *request) {
1345 CALL_LOG_RETURN(
1346 MPI_Ireduce_scatter_block, (sendbuf, recvbuf, recvcount, datatype, op, comm, request));
1347 }
1348 inline int register_datarep(
1349 const char *datarep,
1350 MPI_Datarep_conversion_function *read_conversion_fn,
1351 MPI_Datarep_conversion_function *write_conversion_fn,
1352 MPI_Datarep_extent_function *dtype_file_extent_fn,
1353 void *extra_state) {
1354 CALL_LOG_RETURN(
1355 MPI_Register_datarep,
1356 (datarep, read_conversion_fn, write_conversion_fn, dtype_file_extent_fn, extra_state));
1357 }
1358 inline MPI_Fint request_c2f(MPI_Request request) {
1359 CALL_LOG_RETURN(MPI_Request_c2f, (request));
1360 }
1361 inline MPI_Request request_f2c(MPI_Fint request) {
1362 CALL_LOG_RETURN(MPI_Request_f2c, (request));
1363 }
1364 inline int request_free(MPI_Request *request) { CALL_LOG_RETURN(MPI_Request_free, (request)); }
1365 inline int request_get_status(MPI_Request request, int *flag, MPI_Status *status) {
1366 CALL_LOG_RETURN(MPI_Request_get_status, (request, flag, status));
1367 }
1368 inline int rget(
1369 void *origin_addr,
1370 int origin_count,
1371 MPI_Datatype origin_datatype,
1372 int target_rank,
1373 MPI_Aint target_disp,
1374 int target_count,
1375 MPI_Datatype target_datatype,
1376 MPI_Win win,
1377 MPI_Request *request) {
1378 CALL_LOG_RETURN(
1379 MPI_Rget,
1380 (origin_addr,
1381 origin_count,
1382 origin_datatype,
1383 target_rank,
1384 target_disp,
1385 target_count,
1386 target_datatype,
1387 win,
1388 request));
1389 }
1390 inline int rget_accumulate(
1391 const void *origin_addr,
1392 int origin_count,
1393 MPI_Datatype origin_datatype,
1394 void *result_addr,
1395 int result_count,
1396 MPI_Datatype result_datatype,
1397 int target_rank,
1398 MPI_Aint target_disp,
1399 int target_count,
1400 MPI_Datatype target_datatype,
1401 MPI_Op op,
1402 MPI_Win win,
1403 MPI_Request *request) {
1404 CALL_LOG_RETURN(
1405 MPI_Rget_accumulate,
1406 (origin_addr,
1407 origin_count,
1408 origin_datatype,
1409 result_addr,
1410 result_count,
1411 result_datatype,
1412 target_rank,
1413 target_disp,
1414 target_count,
1415 target_datatype,
1416 op,
1417 win,
1418 request));
1419 }
1420 inline int rput(
1421 const void *origin_addr,
1422 int origin_count,
1423 MPI_Datatype origin_datatype,
1424 int target_rank,
1425 MPI_Aint target_disp,
1426 int target_cout,
1427 MPI_Datatype target_datatype,
1428 MPI_Win win,
1429 MPI_Request *request) {
1430 CALL_LOG_RETURN(
1431 MPI_Rput,
1432 (origin_addr,
1433 origin_count,
1434 origin_datatype,
1435 target_rank,
1436 target_disp,
1437 target_cout,
1438 target_datatype,
1439 win,
1440 request));
1441 }
1442 inline int rsend(
1443 const void *ibuf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
1444 CALL_LOG_RETURN(MPI_Rsend, (ibuf, count, datatype, dest, tag, comm));
1445 }
1446 inline int rsend_init(
1447 const void *buf,
1448 int count,
1449 MPI_Datatype datatype,
1450 int dest,
1451 int tag,
1452 MPI_Comm comm,
1453 MPI_Request *request) {
1454 CALL_LOG_RETURN(MPI_Rsend_init, (buf, count, datatype, dest, tag, comm, request));
1455 }
1456 inline int scan(
1457 const void *sendbuf,
1458 void *recvbuf,
1459 int count,
1460 MPI_Datatype datatype,
1461 MPI_Op op,
1462 MPI_Comm comm) {
1463 CALL_LOG_RETURN(MPI_Scan, (sendbuf, recvbuf, count, datatype, op, comm));
1464 }
1465 inline int iscan(
1466 const void *sendbuf,
1467 void *recvbuf,
1468 int count,
1469 MPI_Datatype datatype,
1470 MPI_Op op,
1471 MPI_Comm comm,
1472 MPI_Request *request) {
1473 CALL_LOG_RETURN(MPI_Iscan, (sendbuf, recvbuf, count, datatype, op, comm, request));
1474 }
1475 inline int scatter(
1476 const void *sendbuf,
1477 int sendcount,
1478 MPI_Datatype sendtype,
1479 void *recvbuf,
1480 int recvcount,
1481 MPI_Datatype recvtype,
1482 int root,
1483 MPI_Comm comm) {
1484 CALL_LOG_RETURN(
1485 MPI_Scatter, (sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm));
1486 }
1487 inline int iscatter(
1488 const void *sendbuf,
1489 int sendcount,
1490 MPI_Datatype sendtype,
1491 void *recvbuf,
1492 int recvcount,
1493 MPI_Datatype recvtype,
1494 int root,
1495 MPI_Comm comm,
1496 MPI_Request *request) {
1497 CALL_LOG_RETURN(
1498 MPI_Iscatter,
1499 (sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request));
1500 }
1501 inline int scatterv(
1502 const void *sendbuf,
1503 const int sendcounts[],
1504 const int displs[],
1505 MPI_Datatype sendtype,
1506 void *recvbuf,
1507 int recvcount,
1508 MPI_Datatype recvtype,
1509 int root,
1510 MPI_Comm comm) {
1511 CALL_LOG_RETURN(
1512 MPI_Scatterv,
1513 (sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm));
1514 }
1515 inline int iscatterv(
1516 const void *sendbuf,
1517 const int sendcounts[],
1518 const int displs[],
1519 MPI_Datatype sendtype,
1520 void *recvbuf,
1521 int recvcount,
1522 MPI_Datatype recvtype,
1523 int root,
1524 MPI_Comm comm,
1525 MPI_Request *request) {
1526 CALL_LOG_RETURN(
1527 MPI_Iscatterv,
1528 (sendbuf,
1529 sendcounts,
1530 displs,
1531 sendtype,
1532 recvbuf,
1533 recvcount,
1534 recvtype,
1535 root,
1536 comm,
1537 request));
1538 }
1539 inline int send_init(
1540 const void *buf,
1541 int count,
1542 MPI_Datatype datatype,
1543 int dest,
1544 int tag,
1545 MPI_Comm comm,
1546 MPI_Request *request) {
1547 CALL_LOG_RETURN(MPI_Send_init, (buf, count, datatype, dest, tag, comm, request));
1548 }
1549 inline int sendrecv(
1550 const void *sendbuf,
1551 int sendcount,
1552 MPI_Datatype sendtype,
1553 int dest,
1554 int sendtag,
1555 void *recvbuf,
1556 int recvcount,
1557 MPI_Datatype recvtype,
1558 int source,
1559 int recvtag,
1560 MPI_Comm comm,
1561 MPI_Status *status) {
1562 CALL_LOG_RETURN(
1563 MPI_Sendrecv,
1564 (sendbuf,
1565 sendcount,
1566 sendtype,
1567 dest,
1568 sendtag,
1569 recvbuf,
1570 recvcount,
1571 recvtype,
1572 source,
1573 recvtag,
1574 comm,
1575 status));
1576 }
1577 inline int sendrecv_replace(
1578 void *buf,
1579 int count,
1580 MPI_Datatype datatype,
1581 int dest,
1582 int sendtag,
1583 int source,
1584 int recvtag,
1585 MPI_Comm comm,
1586 MPI_Status *status) {
1587 CALL_LOG_RETURN(
1588 MPI_Sendrecv_replace,
1589 (buf, count, datatype, dest, sendtag, source, recvtag, comm, status));
1590 }
1591 inline int ssend_init(
1592 const void *buf,
1593 int count,
1594 MPI_Datatype datatype,
1595 int dest,
1596 int tag,
1597 MPI_Comm comm,
1598 MPI_Request *request) {
1599 CALL_LOG_RETURN(MPI_Ssend_init, (buf, count, datatype, dest, tag, comm, request));
1600 }
1601 inline int ssend(
1602 const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
1603 CALL_LOG_RETURN(MPI_Ssend, (buf, count, datatype, dest, tag, comm));
1604 }
1605 inline int start(MPI_Request *request) { CALL_LOG_RETURN(MPI_Start, (request)); }
1606 inline int startall(int count, MPI_Request array_of_requests[]) {
1607 CALL_LOG_RETURN(MPI_Startall, (count, array_of_requests));
1608 }
1609 inline int status_c2f(const MPI_Status *c_status, MPI_Fint *f_status) {
1610 CALL_LOG_RETURN(MPI_Status_c2f, (c_status, f_status));
1611 }
1612 inline int status_f2c(const MPI_Fint *f_status, MPI_Status *c_status) {
1613 CALL_LOG_RETURN(MPI_Status_f2c, (f_status, c_status));
1614 }
1615 inline int status_set_cancelled(MPI_Status *status, int flag) {
1616 CALL_LOG_RETURN(MPI_Status_set_cancelled, (status, flag));
1617 }
1618 inline int status_set_elements(MPI_Status *status, MPI_Datatype datatype, int count) {
1619 CALL_LOG_RETURN(MPI_Status_set_elements, (status, datatype, count));
1620 }
1621 inline int status_set_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Count count) {
1622 CALL_LOG_RETURN(MPI_Status_set_elements_x, (status, datatype, count));
1623 }
1624 inline int testall(
1625 int count, MPI_Request array_of_requests[], int *flag, MPI_Status array_of_statuses[]) {
1626 CALL_LOG_RETURN(MPI_Testall, (count, array_of_requests, flag, array_of_statuses));
1627 }
1628 inline int testany(
1629 int count, MPI_Request array_of_requests[], int *index, int *flag, MPI_Status *status) {
1630 CALL_LOG_RETURN(MPI_Testany, (count, array_of_requests, index, flag, status));
1631 }
1632 inline int test(MPI_Request *request, int *flag, MPI_Status *status) {
1633 CALL_LOG_RETURN(MPI_Test, (request, flag, status));
1634 }
1635 inline int test_cancelled(const MPI_Status *status, int *flag) {
1636 CALL_LOG_RETURN(MPI_Test_cancelled, (status, flag));
1637 }
1638 inline int testsome(
1639 int incount,
1640 MPI_Request array_of_requests[],
1641 int *outcount,
1642 int array_of_indices[],
1643 MPI_Status array_of_statuses[]) {
1644 CALL_LOG_RETURN(
1645 MPI_Testsome,
1646 (incount, array_of_requests, outcount, array_of_indices, array_of_statuses));
1647 }
1648 inline int topo_test(MPI_Comm comm, int *status) {
1649 CALL_LOG_RETURN(MPI_Topo_test, (comm, status));
1650 }
1651 inline MPI_Fint type_c2f(MPI_Datatype datatype) { CALL_LOG_RETURN(MPI_Type_c2f, (datatype)); }
1652 inline int type_commit(MPI_Datatype *type) { CALL_LOG_RETURN(MPI_Type_commit, (type)); }
1653 inline int type_contiguous(int count, MPI_Datatype oldtype, MPI_Datatype *newtype) {
1654 CALL_LOG_RETURN(MPI_Type_contiguous, (count, oldtype, newtype));
1655 }
1656 inline int type_create_darray(
1657 int size,
1658 int rank,
1659 int ndims,
1660 const int gsize_array[],
1661 const int distrib_array[],
1662 const int darg_array[],
1663 const int psize_array[],
1664 int order,
1665 MPI_Datatype oldtype,
1666 MPI_Datatype *newtype) {
1667 CALL_LOG_RETURN(
1668 MPI_Type_create_darray,
1669 (size,
1670 rank,
1671 ndims,
1672 gsize_array,
1673 distrib_array,
1674 darg_array,
1675 psize_array,
1676 order,
1677 oldtype,
1678 newtype));
1679 }
1680 inline int type_create_f90_complex(int p, int r, MPI_Datatype *newtype) {
1681 CALL_LOG_RETURN(MPI_Type_create_f90_complex, (p, r, newtype));
1682 }
1683 inline int type_create_f90_integer(int r, MPI_Datatype *newtype) {
1684 CALL_LOG_RETURN(MPI_Type_create_f90_integer, (r, newtype));
1685 }
1686 inline int type_create_f90_real(int p, int r, MPI_Datatype *newtype) {
1687 CALL_LOG_RETURN(MPI_Type_create_f90_real, (p, r, newtype));
1688 }
1689 inline int type_create_hindexed_block(
1690 int count,
1691 int blocklength,
1692 const MPI_Aint array_of_displacements[],
1693 MPI_Datatype oldtype,
1694 MPI_Datatype *newtype) {
1695 CALL_LOG_RETURN(
1696 MPI_Type_create_hindexed_block,
1697 (count, blocklength, array_of_displacements, oldtype, newtype));
1698 }
1699 inline int type_create_hindexed(
1700 int count,
1701 const int array_of_blocklengths[],
1702 const MPI_Aint array_of_displacements[],
1703 MPI_Datatype oldtype,
1704 MPI_Datatype *newtype) {
1705 CALL_LOG_RETURN(
1706 MPI_Type_create_hindexed,
1707 (count, array_of_blocklengths, array_of_displacements, oldtype, newtype));
1708 }
1709 inline int type_create_hvector(
1710 int count, int blocklength, MPI_Aint stride, MPI_Datatype oldtype, MPI_Datatype *newtype) {
1711 CALL_LOG_RETURN(MPI_Type_create_hvector, (count, blocklength, stride, oldtype, newtype));
1712 }
1713 inline int type_create_keyval(
1714 MPI_Type_copy_attr_function *type_copy_attr_fn,
1715 MPI_Type_delete_attr_function *type_delete_attr_fn,
1716 int *type_keyval,
1717 void *extra_state) {
1718 CALL_LOG_RETURN(
1719 MPI_Type_create_keyval,
1720 (type_copy_attr_fn, type_delete_attr_fn, type_keyval, extra_state));
1721 }
1722 inline int type_create_indexed_block(
1723 int count,
1724 int blocklength,
1725 const int array_of_displacements[],
1726 MPI_Datatype oldtype,
1727 MPI_Datatype *newtype) {
1728 CALL_LOG_RETURN(
1729 MPI_Type_create_indexed_block,
1730 (count, blocklength, array_of_displacements, oldtype, newtype));
1731 }
1732 inline int type_create_struct(
1733 int count,
1734 const int array_of_block_lengths[],
1735 const MPI_Aint array_of_displacements[],
1736 const MPI_Datatype array_of_types[],
1737 MPI_Datatype *newtype) {
1738 CALL_LOG_RETURN(
1739 MPI_Type_create_struct,
1740 (count, array_of_block_lengths, array_of_displacements, array_of_types, newtype));
1741 }
1742 inline int type_create_subarray(
1743 int ndims,
1744 const int size_array[],
1745 const int subsize_array[],
1746 const int start_array[],
1747 int order,
1748 MPI_Datatype oldtype,
1749 MPI_Datatype *newtype) {
1750 CALL_LOG_RETURN(
1751 MPI_Type_create_subarray,
1752 (ndims, size_array, subsize_array, start_array, order, oldtype, newtype));
1753 }
1754 inline int type_create_resized(
1755 MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype) {
1756 CALL_LOG_RETURN(MPI_Type_create_resized, (oldtype, lb, extent, newtype));
1757 }
1758 inline int type_delete_attr(MPI_Datatype type, int type_keyval) {
1759 CALL_LOG_RETURN(MPI_Type_delete_attr, (type, type_keyval));
1760 }
1761 inline int type_dup(MPI_Datatype type, MPI_Datatype *newtype) {
1762 CALL_LOG_RETURN(MPI_Type_dup, (type, newtype));
1763 }
1764 inline int type_free(MPI_Datatype *type) { CALL_LOG_RETURN(MPI_Type_free, (type)); }
1765 inline int type_free_keyval(int *type_keyval) {
1766 CALL_LOG_RETURN(MPI_Type_free_keyval, (type_keyval));
1767 }
1768 inline MPI_Datatype type_f2c(MPI_Fint datatype) { CALL_LOG_RETURN(MPI_Type_f2c, (datatype)); }
1769 inline int type_get_attr(MPI_Datatype type, int type_keyval, void *attribute_val, int *flag) {
1770 CALL_LOG_RETURN(MPI_Type_get_attr, (type, type_keyval, attribute_val, flag));
1771 }
1772 inline int type_get_contents(
1773 MPI_Datatype mtype,
1774 int max_integers,
1775 int max_addresses,
1776 int max_datatypes,
1777 int array_of_integers[],
1778 MPI_Aint array_of_addresses[],
1779 MPI_Datatype array_of_datatypes[]) {
1780 CALL_LOG_RETURN(
1781 MPI_Type_get_contents,
1782 (mtype,
1783 max_integers,
1784 max_addresses,
1785 max_datatypes,
1786 array_of_integers,
1787 array_of_addresses,
1788 array_of_datatypes));
1789 }
1790 inline int type_get_envelope(
1791 MPI_Datatype type,
1792 int *num_integers,
1793 int *num_addresses,
1794 int *num_datatypes,
1795 int *combiner) {
1796 CALL_LOG_RETURN(
1797 MPI_Type_get_envelope, (type, num_integers, num_addresses, num_datatypes, combiner));
1798 }
1799 inline int type_get_extent_x(MPI_Datatype type, MPI_Count *lb, MPI_Count *extent) {
1800 CALL_LOG_RETURN(MPI_Type_get_extent_x, (type, lb, extent));
1801 }
1802 inline int type_get_name(MPI_Datatype type, char *type_name, int *resultlen) {
1803 CALL_LOG_RETURN(MPI_Type_get_name, (type, type_name, resultlen));
1804 }
1805 inline int type_get_true_extent(
1806 MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint *true_extent) {
1807 CALL_LOG_RETURN(MPI_Type_get_true_extent, (datatype, true_lb, true_extent));
1808 }
1809 inline int type_get_true_extent_x(
1810 MPI_Datatype datatype, MPI_Count *true_lb, MPI_Count *true_extent) {
1811 CALL_LOG_RETURN(MPI_Type_get_true_extent_x, (datatype, true_lb, true_extent));
1812 }
1813 inline int type_indexed(
1814 int count,
1815 const int array_of_blocklengths[],
1816 const int array_of_displacements[],
1817 MPI_Datatype oldtype,
1818 MPI_Datatype *newtype) {
1819 CALL_LOG_RETURN(
1820 MPI_Type_indexed,
1821 (count, array_of_blocklengths, array_of_displacements, oldtype, newtype));
1822 }
1823 inline int type_match_size(int typeclass, int size, MPI_Datatype *type) {
1824 CALL_LOG_RETURN(MPI_Type_match_size, (typeclass, size, type));
1825 }
1826 inline int type_set_attr(MPI_Datatype type, int type_keyval, void *attr_val) {
1827 CALL_LOG_RETURN(MPI_Type_set_attr, (type, type_keyval, attr_val));
1828 }
1829 inline int type_set_name(MPI_Datatype type, const char *type_name) {
1830 CALL_LOG_RETURN(MPI_Type_set_name, (type, type_name));
1831 }
1832 inline int type_size(MPI_Datatype type, int *size) {
1833 CALL_LOG_RETURN(MPI_Type_size, (type, size));
1834 }
1835 inline int type_size_x(MPI_Datatype type, MPI_Count *size) {
1836 CALL_LOG_RETURN(MPI_Type_size_x, (type, size));
1837 }
1838 inline int type_vector(
1839 int count, int blocklength, int stride, MPI_Datatype oldtype, MPI_Datatype *newtype) {
1840 CALL_LOG_RETURN(MPI_Type_vector, (count, blocklength, stride, oldtype, newtype));
1841 }
1842 inline int unpack(
1843 const void *inbuf,
1844 int insize,
1845 int *position,
1846 void *outbuf,
1847 int outcount,
1848 MPI_Datatype datatype,
1849 MPI_Comm comm) {
1850 CALL_LOG_RETURN(MPI_Unpack, (inbuf, insize, position, outbuf, outcount, datatype, comm));
1851 }
1852 inline int unpublish_name(const char *service_name, MPI_Info info, const char *port_name) {
1853 CALL_LOG_RETURN(MPI_Unpublish_name, (service_name, info, port_name));
1854 }
1855 inline int unpack_external(
1856 const char datarep[],
1857 const void *inbuf,
1858 MPI_Aint insize,
1859 MPI_Aint *position,
1860 void *outbuf,
1861 int outcount,
1862 MPI_Datatype datatype) {
1863 CALL_LOG_RETURN(
1864 MPI_Unpack_external, (datarep, inbuf, insize, position, outbuf, outcount, datatype));
1865 }
1866 inline int waitany(int count, MPI_Request array_of_requests[], int *index, MPI_Status *status) {
1867 CALL_LOG_RETURN(MPI_Waitany, (count, array_of_requests, index, status));
1868 }
1869
1870 inline int waitsome(
1871 int incount,
1872 MPI_Request array_of_requests[],
1873 int *outcount,
1874 int array_of_indices[],
1875 MPI_Status array_of_statuses[]) {
1876 CALL_LOG_RETURN(
1877 MPI_Waitsome,
1878 (incount, array_of_requests, outcount, array_of_indices, array_of_statuses));
1879 }
1880 inline int win_allocate(
1881 MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *baseptr, MPI_Win *win) {
1882 CALL_LOG_RETURN(MPI_Win_allocate, (size, disp_unit, info, comm, baseptr, win));
1883 }
1884 inline int win_allocate_shared(
1885 MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *baseptr, MPI_Win *win) {
1886 CALL_LOG_RETURN(MPI_Win_allocate_shared, (size, disp_unit, info, comm, baseptr, win));
1887 }
1888 inline int win_attach(MPI_Win win, void *base, MPI_Aint size) {
1889 CALL_LOG_RETURN(MPI_Win_attach, (win, base, size));
1890 }
1891 inline MPI_Fint win_c2f(MPI_Win win) { CALL_LOG_RETURN(MPI_Win_c2f, (win)); }
1892 inline int win_call_errhandler(MPI_Win win, int errorcode) {
1893 CALL_LOG_RETURN(MPI_Win_call_errhandler, (win, errorcode));
1894 }
1895 inline int win_complete(MPI_Win win) { CALL_LOG_RETURN(MPI_Win_complete, (win)); }
1896 inline int win_create(
1897 void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win) {
1898 CALL_LOG_RETURN(MPI_Win_create, (base, size, disp_unit, info, comm, win));
1899 }
1900 inline int win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win) {
1901 CALL_LOG_RETURN(MPI_Win_create_dynamic, (info, comm, win));
1902 }
1903 inline int win_create_errhandler(
1904 MPI_Win_errhandler_function *function, MPI_Errhandler *errhandler) {
1905 CALL_LOG_RETURN(MPI_Win_create_errhandler, (function, errhandler));
1906 }
1907 inline int win_create_keyval(
1908 MPI_Win_copy_attr_function *win_copy_attr_fn,
1909 MPI_Win_delete_attr_function *win_delete_attr_fn,
1910 int *win_keyval,
1911 void *extra_state) {
1912 CALL_LOG_RETURN(
1913 MPI_Win_create_keyval, (win_copy_attr_fn, win_delete_attr_fn, win_keyval, extra_state));
1914 }
1915 inline int win_delete_attr(MPI_Win win, int win_keyval) {
1916 CALL_LOG_RETURN(MPI_Win_delete_attr, (win, win_keyval));
1917 }
1918 inline int win_detach(MPI_Win win, const void *base) {
1919 CALL_LOG_RETURN(MPI_Win_detach, (win, base));
1920 }
1921 inline MPI_Win win_f2c(MPI_Fint win) { CALL_LOG_RETURN(MPI_Win_f2c, (win)); }
1922 inline int win_fence(int assert, MPI_Win win) { CALL_LOG_RETURN(MPI_Win_fence, (assert, win)); }
1923 inline int win_flush(int rank, MPI_Win win) { CALL_LOG_RETURN(MPI_Win_flush, (rank, win)); }
1924 inline int win_flush_all(MPI_Win win) { CALL_LOG_RETURN(MPI_Win_flush_all, (win)); }
1925 inline int win_flush_local(int rank, MPI_Win win) {
1926 CALL_LOG_RETURN(MPI_Win_flush_local, (rank, win));
1927 }
1928 inline int win_flush_local_all(MPI_Win win) { CALL_LOG_RETURN(MPI_Win_flush_local_all, (win)); }
1929 inline int win_free(MPI_Win *win) { CALL_LOG_RETURN(MPI_Win_free, (win)); }
1930 inline int win_free_keyval(int *win_keyval) {
1931 CALL_LOG_RETURN(MPI_Win_free_keyval, (win_keyval));
1932 }
1933 inline int win_get_attr(MPI_Win win, int win_keyval, void *attribute_val, int *flag) {
1934 CALL_LOG_RETURN(MPI_Win_get_attr, (win, win_keyval, attribute_val, flag));
1935 }
1936 inline int win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler) {
1937 CALL_LOG_RETURN(MPI_Win_get_errhandler, (win, errhandler));
1938 }
1939 inline int win_get_group(MPI_Win win, MPI_Group *group) {
1940 CALL_LOG_RETURN(MPI_Win_get_group, (win, group));
1941 }
1942 inline int win_get_info(MPI_Win win, MPI_Info *info_used) {
1943 CALL_LOG_RETURN(MPI_Win_get_info, (win, info_used));
1944 }
1945 inline int win_get_name(MPI_Win win, char *win_name, int *resultlen) {
1946 CALL_LOG_RETURN(MPI_Win_get_name, (win, win_name, resultlen));
1947 }
1948 inline int win_lock(int lock_type, int rank, int assert, MPI_Win win) {
1949 CALL_LOG_RETURN(MPI_Win_lock, (lock_type, rank, assert, win));
1950 }
1951 inline int win_lock_all(int assert, MPI_Win win) {
1952 CALL_LOG_RETURN(MPI_Win_lock_all, (assert, win));
1953 }
1954 inline int win_post(MPI_Group group, int assert, MPI_Win win) {
1955 CALL_LOG_RETURN(MPI_Win_post, (group, assert, win));
1956 }
1957 inline int win_set_attr(MPI_Win win, int win_keyval, void *attribute_val) {
1958 CALL_LOG_RETURN(MPI_Win_set_attr, (win, win_keyval, attribute_val));
1959 }
1960 inline int win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler) {
1961 CALL_LOG_RETURN(MPI_Win_set_errhandler, (win, errhandler));
1962 }
1963 inline int win_set_info(MPI_Win win, MPI_Info info) {
1964 CALL_LOG_RETURN(MPI_Win_set_info, (win, info));
1965 }
1966 inline int win_set_name(MPI_Win win, const char *win_name) {
1967 CALL_LOG_RETURN(MPI_Win_set_name, (win, win_name));
1968 }
1969 inline int win_shared_query(
1970 MPI_Win win, int rank, MPI_Aint *size, int *disp_unit, void *baseptr) {
1971 CALL_LOG_RETURN(MPI_Win_shared_query, (win, rank, size, disp_unit, baseptr));
1972 }
1973 inline int win_start(MPI_Group group, int assert, MPI_Win win) {
1974 CALL_LOG_RETURN(MPI_Win_start, (group, assert, win));
1975 }
1976 inline int win_sync(MPI_Win win) { CALL_LOG_RETURN(MPI_Win_sync, (win)); }
1977 inline int win_test(MPI_Win win, int *flag) { CALL_LOG_RETURN(MPI_Win_test, (win, flag)); }
1978 inline int win_unlock(int rank, MPI_Win win) { CALL_LOG_RETURN(MPI_Win_unlock, (rank, win)); }
1979 inline int win_unlock_all(MPI_Win win) { CALL_LOG_RETURN(MPI_Win_unlock_all, (win)); }
1980 inline int win_wait(MPI_Win win) { CALL_LOG_RETURN(MPI_Win_wait, (win)); }
1981 inline double wtick(void) { CALL_LOG_RETURN(MPI_Wtick, ()); }
1982 inline double wtime(void) { CALL_LOG_RETURN(MPI_Wtime, ()); }
1983
1984} // namespace mpi
1985
1986#undef CALL_LOG_RETURN
Use this header to include MPI properly.