1 /* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #include "src/smpi/private.h"
7 #include "src/smpi/smpi_comm.hpp"
8 #include "src/smpi/smpi_datatype.hpp"
9 #include "src/smpi/smpi_op.hpp"
10 #include "src/smpi/smpi_process.hpp"
11 #include "src/smpi/smpi_request.hpp"
12 #include "src/smpi/smpi_win.hpp"
14 static int running_processes = 0;
16 #if defined(__alpha__) || defined(__sparc64__) || defined(__x86_64__) || defined(__ia64__)
19 typedef long int integer;
22 /* Convert between Fortran and C */
24 #define FORT_BOTTOM(addr) ((*(int*)addr) == -200 ? MPI_BOTTOM : (void*)addr)
25 #define FORT_IN_PLACE(addr) ((*(int*)addr) == -100 ? MPI_IN_PLACE : (void*)addr)
26 #define FORT_STATUS_IGNORE(addr) (static_cast<MPI_Status*>((*(int*)addr) == -300 ? MPI_STATUS_IGNORE : (void*)addr))
27 #define FORT_STATUSES_IGNORE(addr) (static_cast<MPI_Status*>((*(int*)addr) == -400 ? MPI_STATUSES_IGNORE : (void*)addr))
29 #define KEY_SIZE (sizeof(int) * 2 + 1)
31 static char* get_key(char* key, int id) {
32 snprintf(key, KEY_SIZE, "%x",id);
36 static char* get_key_id(char* key, int id) {
37 snprintf(key, KEY_SIZE, "%x_%d",id, smpi_process()->index());
41 static void smpi_init_fortran_types(){
42 if(simgrid::smpi::F2C::lookup() == nullptr){
43 MPI_COMM_WORLD->add_f();
44 MPI_BYTE->add_f();//MPI_BYTE
45 MPI_CHAR->add_f();//MPI_CHARACTER
46 #if defined(__alpha__) || defined(__sparc64__) || defined(__x86_64__) || defined(__ia64__)
47 MPI_C_BOOL->add_f();//MPI_LOGICAL
48 MPI_INT->add_f();//MPI_INTEGER
50 MPI_C_BOOL->add_f();//MPI_LOGICAL
51 MPI_LONG->add_f();//MPI_INTEGER
53 MPI_INT8_T->add_f();//MPI_INTEGER1
54 MPI_INT16_T->add_f();//MPI_INTEGER2
55 MPI_INT32_T->add_f();//MPI_INTEGER4
56 MPI_INT64_T->add_f();//MPI_INTEGER8
57 MPI_REAL->add_f();//MPI_REAL
58 MPI_REAL4->add_f();//MPI_REAL4
59 MPI_REAL8->add_f();//MPI_REAL8
60 MPI_DOUBLE->add_f();//MPI_DOUBLE_PRECISION
61 MPI_C_FLOAT_COMPLEX->add_f();//MPI_COMPLEX
62 MPI_C_DOUBLE_COMPLEX->add_f();//MPI_DOUBLE_COMPLEX
63 #if defined(__alpha__) || defined(__sparc64__) || defined(__x86_64__) || defined(__ia64__)
64 MPI_2INT->add_f();//MPI_2INTEGER
66 MPI_2LONG->add_f();//MPI_2INTEGER
68 MPI_UINT8_T->add_f();//MPI_LOGICAL1
69 MPI_UINT16_T->add_f();//MPI_LOGICAL2
70 MPI_UINT32_T->add_f();//MPI_LOGICAL4
71 MPI_UINT64_T->add_f();//MPI_LOGICAL8
72 MPI_2FLOAT->add_f();//MPI_2REAL
73 MPI_2DOUBLE->add_f();//MPI_2DOUBLE_PRECISION
74 MPI_PTR->add_f();//MPI_AINT
75 MPI_OFFSET->add_f();//MPI_OFFSET
76 MPI_AINT->add_f();//MPI_COUNT
77 MPI_REAL16->add_f();//MPI_REAL16
78 MPI_PACKED->add_f();//MPI_PACKED
95 extern "C" { // This should really use the C linkage to be usable from Fortran
98 void mpi_init_(int* ierr) {
99 smpi_init_fortran_types();
100 *ierr = MPI_Init(nullptr, nullptr);
104 void mpi_finalize_(int* ierr) {
105 *ierr = MPI_Finalize();
107 if(running_processes==0){
108 simgrid::smpi::F2C::delete_lookup();
112 void mpi_abort_(int* comm, int* errorcode, int* ierr) {
113 *ierr = MPI_Abort(simgrid::smpi::Comm::f2c(*comm), *errorcode);
116 void mpi_comm_rank_(int* comm, int* rank, int* ierr) {
117 *ierr = MPI_Comm_rank(simgrid::smpi::Comm::f2c(*comm), rank);
120 void mpi_comm_size_(int* comm, int* size, int* ierr) {
121 *ierr = MPI_Comm_size(simgrid::smpi::Comm::f2c(*comm), size);
124 double mpi_wtime_() {
128 double mpi_wtick_() {
132 void mpi_comm_dup_(int* comm, int* newcomm, int* ierr) {
135 *ierr = MPI_Comm_dup(simgrid::smpi::Comm::f2c(*comm), &tmp);
136 if(*ierr == MPI_SUCCESS) {
137 *newcomm = tmp->add_f();
141 void mpi_comm_create_(int* comm, int* group, int* newcomm, int* ierr) {
144 *ierr = MPI_Comm_create(simgrid::smpi::Comm::f2c(*comm),simgrid::smpi::Group::f2c(*group), &tmp);
145 if(*ierr == MPI_SUCCESS) {
146 *newcomm = tmp->add_f();
150 void mpi_comm_free_(int* comm, int* ierr) {
151 MPI_Comm tmp = simgrid::smpi::Comm::f2c(*comm);
153 *ierr = MPI_Comm_free(&tmp);
155 if(*ierr == MPI_SUCCESS) {
156 simgrid::smpi::Comm::free_f(*comm);
160 void mpi_comm_split_(int* comm, int* color, int* key, int* comm_out, int* ierr) {
163 *ierr = MPI_Comm_split(simgrid::smpi::Comm::f2c(*comm), *color, *key, &tmp);
164 if(*ierr == MPI_SUCCESS) {
165 *comm_out = tmp->add_f();
169 void mpi_group_incl_(int* group, int* n, int* ranks, int* group_out, int* ierr) {
172 *ierr = MPI_Group_incl(simgrid::smpi::Group::f2c(*group), *n, ranks, &tmp);
173 if(*ierr == MPI_SUCCESS) {
174 *group_out = tmp->add_f();
178 void mpi_comm_group_(int* comm, int* group_out, int* ierr) {
181 *ierr = MPI_Comm_group(simgrid::smpi::Comm::f2c(*comm), &tmp);
182 if(*ierr == MPI_SUCCESS) {
183 *group_out = tmp->c2f();
187 void mpi_initialized_(int* flag, int* ierr){
188 *ierr = MPI_Initialized(flag);
191 void mpi_send_init_(void *buf, int* count, int* datatype, int* dst, int* tag, int* comm, int* request, int* ierr) {
193 buf = static_cast<char *>(FORT_BOTTOM(buf));
194 *ierr = MPI_Send_init(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *dst, *tag, simgrid::smpi::Comm::f2c(*comm), &req);
195 if(*ierr == MPI_SUCCESS) {
196 *request = req->add_f();
200 void mpi_isend_(void *buf, int* count, int* datatype, int* dst, int* tag, int* comm, int* request, int* ierr) {
202 buf = static_cast<char *>(FORT_BOTTOM(buf));
203 *ierr = MPI_Isend(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *dst, *tag, simgrid::smpi::Comm::f2c(*comm), &req);
204 if(*ierr == MPI_SUCCESS) {
205 *request = req->add_f();
209 void mpi_irsend_(void *buf, int* count, int* datatype, int* dst, int* tag, int* comm, int* request, int* ierr) {
211 buf = static_cast<char *>(FORT_BOTTOM(buf));
212 *ierr = MPI_Irsend(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *dst, *tag, simgrid::smpi::Comm::f2c(*comm), &req);
213 if(*ierr == MPI_SUCCESS) {
214 *request = req->add_f();
218 void mpi_send_(void* buf, int* count, int* datatype, int* dst, int* tag, int* comm, int* ierr) {
219 buf = static_cast<char *>(FORT_BOTTOM(buf));
220 *ierr = MPI_Send(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *dst, *tag, simgrid::smpi::Comm::f2c(*comm));
223 void mpi_rsend_(void* buf, int* count, int* datatype, int* dst, int* tag, int* comm, int* ierr) {
224 buf = static_cast<char *>(FORT_BOTTOM(buf));
225 *ierr = MPI_Rsend(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *dst, *tag, simgrid::smpi::Comm::f2c(*comm));
228 void mpi_sendrecv_(void* sendbuf, int* sendcount, int* sendtype, int* dst, int* sendtag, void *recvbuf, int* recvcount,
229 int* recvtype, int* src, int* recvtag, int* comm, MPI_Status* status, int* ierr) {
230 sendbuf = static_cast<char *>( FORT_BOTTOM(sendbuf));
231 recvbuf = static_cast<char *>( FORT_BOTTOM(recvbuf));
232 *ierr = MPI_Sendrecv(sendbuf, *sendcount, simgrid::smpi::Datatype::f2c(*sendtype), *dst, *sendtag, recvbuf, *recvcount,
233 simgrid::smpi::Datatype::f2c(*recvtype), *src, *recvtag, simgrid::smpi::Comm::f2c(*comm), FORT_STATUS_IGNORE(status));
236 void mpi_recv_init_(void *buf, int* count, int* datatype, int* src, int* tag, int* comm, int* request, int* ierr) {
238 buf = static_cast<char *>( FORT_BOTTOM(buf));
239 *ierr = MPI_Recv_init(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *src, *tag, simgrid::smpi::Comm::f2c(*comm), &req);
240 if(*ierr == MPI_SUCCESS) {
241 *request = req->add_f();
245 void mpi_irecv_(void *buf, int* count, int* datatype, int* src, int* tag, int* comm, int* request, int* ierr) {
247 buf = static_cast<char *>( FORT_BOTTOM(buf));
248 *ierr = MPI_Irecv(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *src, *tag, simgrid::smpi::Comm::f2c(*comm), &req);
249 if(*ierr == MPI_SUCCESS) {
250 *request = req->add_f();
254 void mpi_recv_(void* buf, int* count, int* datatype, int* src, int* tag, int* comm, MPI_Status* status, int* ierr) {
255 buf = static_cast<char *>( FORT_BOTTOM(buf));
256 *ierr = MPI_Recv(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *src, *tag, simgrid::smpi::Comm::f2c(*comm), status);
259 void mpi_start_(int* request, int* ierr) {
260 MPI_Request req = simgrid::smpi::Request::f2c(*request);
262 *ierr = MPI_Start(&req);
265 void mpi_startall_(int* count, int* requests, int* ierr) {
269 reqs = xbt_new(MPI_Request, *count);
270 for(i = 0; i < *count; i++) {
271 reqs[i] = simgrid::smpi::Request::f2c(requests[i]);
273 *ierr = MPI_Startall(*count, reqs);
277 void mpi_wait_(int* request, MPI_Status* status, int* ierr) {
278 MPI_Request req = simgrid::smpi::Request::f2c(*request);
280 *ierr = MPI_Wait(&req, FORT_STATUS_IGNORE(status));
281 if(req==MPI_REQUEST_NULL){
282 simgrid::smpi::Request::free_f(*request);
283 *request=MPI_FORTRAN_REQUEST_NULL;
287 void mpi_waitany_(int* count, int* requests, int* index, MPI_Status* status, int* ierr) {
291 reqs = xbt_new(MPI_Request, *count);
292 for(i = 0; i < *count; i++) {
293 reqs[i] = simgrid::smpi::Request::f2c(requests[i]);
295 *ierr = MPI_Waitany(*count, reqs, index, status);
296 if(reqs[*index]==MPI_REQUEST_NULL){
297 simgrid::smpi::Request::free_f(requests[*index]);
298 requests[*index]=MPI_FORTRAN_REQUEST_NULL;
303 void mpi_waitall_(int* count, int* requests, MPI_Status* status, int* ierr) {
307 reqs = xbt_new(MPI_Request, *count);
308 for(i = 0; i < *count; i++) {
309 reqs[i] = simgrid::smpi::Request::f2c(requests[i]);
311 *ierr = MPI_Waitall(*count, reqs, FORT_STATUSES_IGNORE(status));
312 for(i = 0; i < *count; i++) {
313 if(reqs[i]==MPI_REQUEST_NULL){
314 simgrid::smpi::Request::free_f(requests[i]);
315 requests[i]=MPI_FORTRAN_REQUEST_NULL;
322 void mpi_barrier_(int* comm, int* ierr) {
323 *ierr = MPI_Barrier(simgrid::smpi::Comm::f2c(*comm));
326 void mpi_bcast_(void *buf, int* count, int* datatype, int* root, int* comm, int* ierr) {
327 *ierr = MPI_Bcast(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *root, simgrid::smpi::Comm::f2c(*comm));
330 void mpi_reduce_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* root, int* comm, int* ierr) {
331 sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
332 sendbuf = static_cast<char *>( FORT_BOTTOM(sendbuf));
333 recvbuf = static_cast<char *>( FORT_BOTTOM(recvbuf));
334 *ierr = MPI_Reduce(sendbuf, recvbuf, *count, simgrid::smpi::Datatype::f2c(*datatype), simgrid::smpi::Op::f2c(*op), *root, simgrid::smpi::Comm::f2c(*comm));
337 void mpi_allreduce_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* ierr) {
338 sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
339 *ierr = MPI_Allreduce(sendbuf, recvbuf, *count, simgrid::smpi::Datatype::f2c(*datatype), simgrid::smpi::Op::f2c(*op), simgrid::smpi::Comm::f2c(*comm));
342 void mpi_reduce_scatter_(void* sendbuf, void* recvbuf, int* recvcounts, int* datatype, int* op, int* comm, int* ierr) {
343 sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
344 *ierr = MPI_Reduce_scatter(sendbuf, recvbuf, recvcounts, simgrid::smpi::Datatype::f2c(*datatype),
345 simgrid::smpi::Op::f2c(*op), simgrid::smpi::Comm::f2c(*comm));
348 void mpi_scatter_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype,
349 int* root, int* comm, int* ierr) {
350 recvbuf = static_cast<char *>( FORT_IN_PLACE(recvbuf));
351 *ierr = MPI_Scatter(sendbuf, *sendcount, simgrid::smpi::Datatype::f2c(*sendtype),
352 recvbuf, *recvcount, simgrid::smpi::Datatype::f2c(*recvtype), *root, simgrid::smpi::Comm::f2c(*comm));
355 void mpi_scatterv_(void* sendbuf, int* sendcounts, int* displs, int* sendtype,
356 void* recvbuf, int* recvcount, int* recvtype, int* root, int* comm, int* ierr) {
357 recvbuf = static_cast<char *>( FORT_IN_PLACE(recvbuf));
358 *ierr = MPI_Scatterv(sendbuf, sendcounts, displs, simgrid::smpi::Datatype::f2c(*sendtype),
359 recvbuf, *recvcount, simgrid::smpi::Datatype::f2c(*recvtype), *root, simgrid::smpi::Comm::f2c(*comm));
362 void mpi_gather_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype,
363 int* root, int* comm, int* ierr) {
364 sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
365 sendbuf = sendbuf!=MPI_IN_PLACE ? static_cast<char *>( FORT_BOTTOM(sendbuf)) : MPI_IN_PLACE;
366 recvbuf = static_cast<char *>( FORT_BOTTOM(recvbuf));
367 *ierr = MPI_Gather(sendbuf, *sendcount, simgrid::smpi::Datatype::f2c(*sendtype),
368 recvbuf, *recvcount, simgrid::smpi::Datatype::f2c(*recvtype), *root, simgrid::smpi::Comm::f2c(*comm));
371 void mpi_gatherv_(void* sendbuf, int* sendcount, int* sendtype,
372 void* recvbuf, int* recvcounts, int* displs, int* recvtype, int* root, int* comm, int* ierr) {
373 sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
374 sendbuf = sendbuf!=MPI_IN_PLACE ? static_cast<char *>( FORT_BOTTOM(sendbuf)) : MPI_IN_PLACE;
375 recvbuf = static_cast<char *>( FORT_BOTTOM(recvbuf));
376 *ierr = MPI_Gatherv(sendbuf, *sendcount, simgrid::smpi::Datatype::f2c(*sendtype),
377 recvbuf, recvcounts, displs, simgrid::smpi::Datatype::f2c(*recvtype), *root, simgrid::smpi::Comm::f2c(*comm));
380 void mpi_allgather_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype,
381 int* comm, int* ierr) {
382 sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
383 *ierr = MPI_Allgather(sendbuf, *sendcount, simgrid::smpi::Datatype::f2c(*sendtype),
384 recvbuf, *recvcount, simgrid::smpi::Datatype::f2c(*recvtype), simgrid::smpi::Comm::f2c(*comm));
387 void mpi_allgatherv_(void* sendbuf, int* sendcount, int* sendtype,
388 void* recvbuf, int* recvcounts,int* displs, int* recvtype, int* comm, int* ierr) {
389 sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
390 *ierr = MPI_Allgatherv(sendbuf, *sendcount, simgrid::smpi::Datatype::f2c(*sendtype),
391 recvbuf, recvcounts, displs, simgrid::smpi::Datatype::f2c(*recvtype), simgrid::smpi::Comm::f2c(*comm));
394 void mpi_scan_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* ierr) {
395 *ierr = MPI_Scan(sendbuf, recvbuf, *count, simgrid::smpi::Datatype::f2c(*datatype),
396 simgrid::smpi::Op::f2c(*op), simgrid::smpi::Comm::f2c(*comm));
399 void mpi_alltoall_(void* sendbuf, int* sendcount, int* sendtype,
400 void* recvbuf, int* recvcount, int* recvtype, int* comm, int* ierr) {
401 *ierr = MPI_Alltoall(sendbuf, *sendcount, simgrid::smpi::Datatype::f2c(*sendtype),
402 recvbuf, *recvcount, simgrid::smpi::Datatype::f2c(*recvtype), simgrid::smpi::Comm::f2c(*comm));
405 void mpi_alltoallv_(void* sendbuf, int* sendcounts, int* senddisps, int* sendtype,
406 void* recvbuf, int* recvcounts, int* recvdisps, int* recvtype, int* comm, int* ierr) {
407 *ierr = MPI_Alltoallv(sendbuf, sendcounts, senddisps, simgrid::smpi::Datatype::f2c(*sendtype),
408 recvbuf, recvcounts, recvdisps, simgrid::smpi::Datatype::f2c(*recvtype), simgrid::smpi::Comm::f2c(*comm));
411 void mpi_test_ (int * request, int *flag, MPI_Status * status, int* ierr){
412 MPI_Request req = simgrid::smpi::Request::f2c(*request);
413 *ierr= MPI_Test(&req, flag, FORT_STATUS_IGNORE(status));
414 if(req==MPI_REQUEST_NULL){
415 simgrid::smpi::Request::free_f(*request);
416 *request=MPI_FORTRAN_REQUEST_NULL;
420 void mpi_testall_ (int* count, int * requests, int *flag, MPI_Status * statuses, int* ierr){
422 MPI_Request* reqs = xbt_new(MPI_Request, *count);
423 for(i = 0; i < *count; i++) {
424 reqs[i] = simgrid::smpi::Request::f2c(requests[i]);
426 *ierr= MPI_Testall(*count, reqs, flag, FORT_STATUSES_IGNORE(statuses));
427 for(i = 0; i < *count; i++) {
428 if(reqs[i]==MPI_REQUEST_NULL){
429 simgrid::smpi::Request::free_f(requests[i]);
430 requests[i]=MPI_FORTRAN_REQUEST_NULL;
436 void mpi_get_processor_name_(char *name, int *resultlen, int* ierr){
437 *ierr = MPI_Get_processor_name(name, resultlen);
440 void mpi_get_count_(MPI_Status * status, int* datatype, int *count, int* ierr){
441 *ierr = MPI_Get_count(FORT_STATUS_IGNORE(status), simgrid::smpi::Datatype::f2c(*datatype), count);
444 void mpi_attr_get_(int* comm, int* keyval, void* attr_value, int* flag, int* ierr ){
445 *ierr = MPI_Attr_get(simgrid::smpi::Comm::f2c(*comm), *keyval, attr_value, flag);
448 void mpi_type_extent_(int* datatype, MPI_Aint * extent, int* ierr){
449 *ierr= MPI_Type_extent(simgrid::smpi::Datatype::f2c(*datatype), extent);
452 void mpi_type_commit_(int* datatype, int* ierr){
453 MPI_Datatype tmp= simgrid::smpi::Datatype::f2c(*datatype);
454 *ierr= MPI_Type_commit(&tmp);
457 void mpi_type_vector_(int* count, int* blocklen, int* stride, int* old_type, int* newtype, int* ierr){
459 *ierr= MPI_Type_vector(*count, *blocklen, *stride, simgrid::smpi::Datatype::f2c(*old_type), &tmp);
460 if(*ierr == MPI_SUCCESS) {
461 *newtype = tmp->add_f();
465 void mpi_type_create_vector_(int* count, int* blocklen, int* stride, int* old_type, int* newtype, int* ierr){
467 *ierr= MPI_Type_vector(*count, *blocklen, *stride, simgrid::smpi::Datatype::f2c(*old_type), &tmp);
468 if(*ierr == MPI_SUCCESS) {
469 *newtype = tmp->add_f();
473 void mpi_type_hvector_(int* count, int* blocklen, MPI_Aint* stride, int* old_type, int* newtype, int* ierr){
475 *ierr= MPI_Type_hvector (*count, *blocklen, *stride, simgrid::smpi::Datatype::f2c(*old_type), &tmp);
476 if(*ierr == MPI_SUCCESS) {
477 *newtype = tmp->add_f();
481 void mpi_type_create_hvector_(int* count, int* blocklen, MPI_Aint* stride, int* old_type, int* newtype, int* ierr){
483 *ierr= MPI_Type_hvector(*count, *blocklen, *stride, simgrid::smpi::Datatype::f2c(*old_type), &tmp);
484 if(*ierr == MPI_SUCCESS) {
485 *newtype = tmp->add_f();
489 void mpi_type_free_(int* datatype, int* ierr){
490 MPI_Datatype tmp= simgrid::smpi::Datatype::f2c(*datatype);
491 *ierr= MPI_Type_free (&tmp);
492 if(*ierr == MPI_SUCCESS) {
493 simgrid::smpi::F2C::free_f(*datatype);
497 void mpi_type_ub_(int* datatype, MPI_Aint * disp, int* ierr){
498 *ierr= MPI_Type_ub(simgrid::smpi::Datatype::f2c(*datatype), disp);
501 void mpi_type_lb_(int* datatype, MPI_Aint * extent, int* ierr){
502 *ierr= MPI_Type_extent(simgrid::smpi::Datatype::f2c(*datatype), extent);
505 void mpi_type_size_(int* datatype, int *size, int* ierr)
507 *ierr = MPI_Type_size(simgrid::smpi::Datatype::f2c(*datatype), size);
510 void mpi_error_string_(int* errorcode, char* string, int* resultlen, int* ierr){
511 *ierr = MPI_Error_string(*errorcode, string, resultlen);
514 void mpi_win_fence_( int* assert, int* win, int* ierr){
515 *ierr = MPI_Win_fence(* assert, simgrid::smpi::Win::f2c(*win));
518 void mpi_win_free_( int* win, int* ierr){
519 MPI_Win tmp = simgrid::smpi::Win::f2c(*win);
520 *ierr = MPI_Win_free(&tmp);
521 if(*ierr == MPI_SUCCESS) {
522 simgrid::smpi::F2C::free_f(*win);
526 void mpi_win_create_( int *base, MPI_Aint* size, int* disp_unit, int* info, int* comm, int *win, int* ierr){
528 *ierr = MPI_Win_create( static_cast<void*>(base), *size, *disp_unit, simgrid::smpi::Info::f2c(*info), simgrid::smpi::Comm::f2c(*comm),&tmp);
529 if(*ierr == MPI_SUCCESS) {
534 void mpi_win_post_(int* group, int assert, int* win, int* ierr){
535 *ierr = MPI_Win_post(simgrid::smpi::Group::f2c(*group), assert, simgrid::smpi::Win::f2c(*win));
538 void mpi_win_start_(int* group, int assert, int* win, int* ierr){
539 *ierr = MPI_Win_start(simgrid::smpi::Group::f2c(*group), assert, simgrid::smpi::Win::f2c(*win));
542 void mpi_win_complete_(int* win, int* ierr){
543 *ierr = MPI_Win_complete(simgrid::smpi::Win::f2c(*win));
546 void mpi_win_wait_(int* win, int* ierr){
547 *ierr = MPI_Win_wait(simgrid::smpi::Win::f2c(*win));
550 void mpi_win_set_name_ (int* win, char * name, int* ierr, int size){
551 //handle trailing blanks
552 while(name[size-1]==' ')
554 while(*name==' '){//handle leading blanks
558 char* tname = xbt_new(char,size+1);
559 strncpy(tname, name, size);
561 *ierr = MPI_Win_set_name(simgrid::smpi::Win::f2c(*win), tname);
565 void mpi_win_get_name_ (int* win, char * name, int* len, int* ierr){
566 *ierr = MPI_Win_get_name(simgrid::smpi::Win::f2c(*win),name,len);
568 name[*len]=' ';//blank padding, not \0
571 void mpi_info_create_( int *info, int* ierr){
573 *ierr = MPI_Info_create(&tmp);
574 if(*ierr == MPI_SUCCESS) {
575 *info = tmp->add_f();
579 void mpi_info_set_( int *info, char *key, char *value, int* ierr, unsigned int keylen, unsigned int valuelen){
580 //handle trailing blanks
581 while(key[keylen-1]==' ')
583 while(*key==' '){//handle leading blanks
587 char* tkey = xbt_new(char,keylen+1);
588 strncpy(tkey, key, keylen);
591 while(value[valuelen-1]==' ')
593 while(*value==' '){//handle leading blanks
597 char* tvalue = xbt_new(char,valuelen+1);
598 strncpy(tvalue, value, valuelen);
599 tvalue[valuelen]='\0';
601 *ierr = MPI_Info_set( simgrid::smpi::Info::f2c(*info), tkey, tvalue);
606 void mpi_info_get_ (int* info,char *key,int* valuelen, char *value, int *flag, int* ierr, unsigned int keylen ){
607 while(key[keylen-1]==' ')
609 while(*key==' '){//handle leading blanks
613 char* tkey = xbt_new(char,keylen+1);
614 strncpy(tkey, key, keylen);
616 *ierr = MPI_Info_get(simgrid::smpi::Info::f2c(*info),tkey,*valuelen, value, flag);
621 for (i=0; i<*valuelen; i++){
630 void mpi_info_free_(int* info, int* ierr){
631 MPI_Info tmp = simgrid::smpi::Info::f2c(*info);
632 *ierr = MPI_Info_free(&tmp);
633 if(*ierr == MPI_SUCCESS) {
634 simgrid::smpi::F2C::free_f(*info);
638 void mpi_get_( int *origin_addr, int* origin_count, int* origin_datatype, int *target_rank,
639 MPI_Aint* target_disp, int *target_count, int* tarsmpi_type_f2c, int* win, int* ierr){
640 *ierr = MPI_Get( static_cast<void*>(origin_addr),*origin_count, simgrid::smpi::Datatype::f2c(*origin_datatype),*target_rank,
641 *target_disp, *target_count, simgrid::smpi::Datatype::f2c(*tarsmpi_type_f2c), simgrid::smpi::Win::f2c(*win));
644 void mpi_accumulate_( int *origin_addr, int* origin_count, int* origin_datatype, int *target_rank,
645 MPI_Aint* target_disp, int *target_count, int* tarsmpi_type_f2c, int* op, int* win, int* ierr){
646 *ierr = MPI_Accumulate( static_cast<void *>(origin_addr),*origin_count, simgrid::smpi::Datatype::f2c(*origin_datatype),*target_rank,
647 *target_disp, *target_count, simgrid::smpi::Datatype::f2c(*tarsmpi_type_f2c), simgrid::smpi::Op::f2c(*op), simgrid::smpi::Win::f2c(*win));
650 void mpi_put_( int *origin_addr, int* origin_count, int* origin_datatype, int *target_rank,
651 MPI_Aint* target_disp, int *target_count, int* tarsmpi_type_f2c, int* win, int* ierr){
652 *ierr = MPI_Put( static_cast<void *>(origin_addr),*origin_count, simgrid::smpi::Datatype::f2c(*origin_datatype),*target_rank,
653 *target_disp, *target_count, simgrid::smpi::Datatype::f2c(*tarsmpi_type_f2c), simgrid::smpi::Win::f2c(*win));
656 //following are automatically generated, and have to be checked
657 void mpi_finalized_ (int * flag, int* ierr){
659 *ierr = MPI_Finalized(flag);
662 void mpi_init_thread_ (int* required, int *provided, int* ierr){
663 smpi_init_fortran_types();
664 *ierr = MPI_Init_thread(nullptr, nullptr,*required, provided);
668 void mpi_query_thread_ (int *provided, int* ierr){
670 *ierr = MPI_Query_thread(provided);
673 void mpi_is_thread_main_ (int *flag, int* ierr){
675 *ierr = MPI_Is_thread_main(flag);
678 void mpi_address_ (void *location, MPI_Aint * address, int* ierr){
680 *ierr = MPI_Address(location, address);
683 void mpi_get_address_ (void *location, MPI_Aint * address, int* ierr){
685 *ierr = MPI_Get_address(location, address);
688 void mpi_type_dup_ (int* datatype, int* newdatatype, int* ierr){
690 *ierr = MPI_Type_dup(simgrid::smpi::Datatype::f2c(*datatype), &tmp);
691 if(*ierr == MPI_SUCCESS) {
692 *newdatatype = tmp->add_f();
696 void mpi_type_set_name_ (int* datatype, char * name, int* ierr, int size){
697 char* tname = xbt_new(char, size+1);
698 strncpy(tname, name, size);
700 *ierr = MPI_Type_set_name(simgrid::smpi::Datatype::f2c(*datatype), tname);
704 void mpi_type_get_name_ (int* datatype, char * name, int* len, int* ierr){
705 *ierr = MPI_Type_get_name(simgrid::smpi::Datatype::f2c(*datatype),name,len);
710 void mpi_type_get_attr_ (int* type, int* type_keyval, void *attribute_val, int* flag, int* ierr){
712 *ierr = MPI_Type_get_attr ( simgrid::smpi::Datatype::f2c(*type), *type_keyval, attribute_val,flag);
715 void mpi_type_set_attr_ (int* type, int* type_keyval, void *attribute_val, int* ierr){
717 *ierr = MPI_Type_set_attr ( simgrid::smpi::Datatype::f2c(*type), *type_keyval, attribute_val);
720 void mpi_type_delete_attr_ (int* type, int* type_keyval, int* ierr){
722 *ierr = MPI_Type_delete_attr ( simgrid::smpi::Datatype::f2c(*type), *type_keyval);
725 void mpi_type_create_keyval_ (void* copy_fn, void* delete_fn, int* keyval, void* extra_state, int* ierr){
727 *ierr = MPI_Type_create_keyval(reinterpret_cast<MPI_Type_copy_attr_function*>(copy_fn), reinterpret_cast<MPI_Type_delete_attr_function*>(delete_fn),
728 keyval, extra_state) ;
731 void mpi_type_free_keyval_ (int* keyval, int* ierr) {
732 *ierr = MPI_Type_free_keyval( keyval);
735 void mpi_pcontrol_ (int* level , int* ierr){
736 *ierr = MPI_Pcontrol(*static_cast<const int*>(level));
739 void mpi_type_get_extent_ (int* datatype, MPI_Aint * lb, MPI_Aint * extent, int* ierr){
741 *ierr = MPI_Type_get_extent(simgrid::smpi::Datatype::f2c(*datatype), lb, extent);
744 void mpi_type_get_true_extent_ (int* datatype, MPI_Aint * lb, MPI_Aint * extent, int* ierr){
746 *ierr = MPI_Type_get_true_extent(simgrid::smpi::Datatype::f2c(*datatype), lb, extent);
749 void mpi_op_create_ (void * function, int* commute, int* op, int* ierr){
751 *ierr = MPI_Op_create(reinterpret_cast<MPI_User_function*>(function),*commute, &tmp);
752 if(*ierr == MPI_SUCCESS) {
753 tmp->set_fortran_op();
758 void mpi_op_free_ (int* op, int* ierr){
759 MPI_Op tmp= simgrid::smpi::Op::f2c(*op);
760 *ierr = MPI_Op_free(& tmp);
761 if(*ierr == MPI_SUCCESS) {
762 simgrid::smpi::F2C::free_f(*op);
766 void mpi_group_free_ (int* group, int* ierr){
767 MPI_Group tmp = simgrid::smpi::Group::f2c(*group);
768 *ierr = MPI_Group_free(&tmp);
769 if(*ierr == MPI_SUCCESS) {
770 simgrid::smpi::F2C::free_f(*group);
774 void mpi_group_size_ (int* group, int *size, int* ierr){
776 *ierr = MPI_Group_size(simgrid::smpi::Group::f2c(*group), size);
779 void mpi_group_rank_ (int* group, int *rank, int* ierr){
781 *ierr = MPI_Group_rank(simgrid::smpi::Group::f2c(*group), rank);
784 void mpi_group_translate_ranks_ (int* group1, int* n, int *ranks1, int* group2, int *ranks2, int* ierr)
787 *ierr = MPI_Group_translate_ranks(simgrid::smpi::Group::f2c(*group1), *n, ranks1, simgrid::smpi::Group::f2c(*group2), ranks2);
790 void mpi_group_compare_ (int* group1, int* group2, int *result, int* ierr){
792 *ierr = MPI_Group_compare(simgrid::smpi::Group::f2c(*group1), simgrid::smpi::Group::f2c(*group2), result);
795 void mpi_group_union_ (int* group1, int* group2, int* newgroup, int* ierr){
797 *ierr = MPI_Group_union(simgrid::smpi::Group::f2c(*group1), simgrid::smpi::Group::f2c(*group2), &tmp);
798 if(*ierr == MPI_SUCCESS) {
799 *newgroup = tmp->add_f();
803 void mpi_group_intersection_ (int* group1, int* group2, int* newgroup, int* ierr){
805 *ierr = MPI_Group_intersection(simgrid::smpi::Group::f2c(*group1), simgrid::smpi::Group::f2c(*group2), &tmp);
806 if(*ierr == MPI_SUCCESS) {
807 *newgroup = tmp->add_f();
811 void mpi_group_difference_ (int* group1, int* group2, int* newgroup, int* ierr){
813 *ierr = MPI_Group_difference(simgrid::smpi::Group::f2c(*group1), simgrid::smpi::Group::f2c(*group2), &tmp);
814 if(*ierr == MPI_SUCCESS) {
815 *newgroup = tmp->add_f();
819 void mpi_group_excl_ (int* group, int* n, int *ranks, int* newgroup, int* ierr){
821 *ierr = MPI_Group_excl(simgrid::smpi::Group::f2c(*group), *n, ranks, &tmp);
822 if(*ierr == MPI_SUCCESS) {
823 *newgroup = tmp->add_f();
827 void mpi_group_range_incl_ (int* group, int* n, int ranges[][3], int* newgroup, int* ierr)
830 *ierr = MPI_Group_range_incl(simgrid::smpi::Group::f2c(*group), *n, ranges, &tmp);
831 if(*ierr == MPI_SUCCESS) {
832 *newgroup = tmp->add_f();
836 void mpi_group_range_excl_ (int* group, int* n, int ranges[][3], int* newgroup, int* ierr)
839 *ierr = MPI_Group_range_excl(simgrid::smpi::Group::f2c(*group), *n, ranges, &tmp);
840 if(*ierr == MPI_SUCCESS) {
841 *newgroup = tmp->add_f();
845 void mpi_comm_get_attr_ (int* comm, int* comm_keyval, void *attribute_val, int *flag, int* ierr){
847 *ierr = MPI_Comm_get_attr (simgrid::smpi::Comm::f2c(*comm), *comm_keyval, attribute_val, flag);
850 void mpi_comm_set_attr_ (int* comm, int* comm_keyval, void *attribute_val, int* ierr){
852 *ierr = MPI_Comm_set_attr ( simgrid::smpi::Comm::f2c(*comm), *comm_keyval, attribute_val);
855 void mpi_comm_delete_attr_ (int* comm, int* comm_keyval, int* ierr){
857 *ierr = MPI_Comm_delete_attr (simgrid::smpi::Comm::f2c(*comm), *comm_keyval);
860 void mpi_comm_create_keyval_ (void* copy_fn, void* delete_fn, int* keyval, void* extra_state, int* ierr){
862 *ierr = MPI_Comm_create_keyval(reinterpret_cast<MPI_Comm_copy_attr_function*>(copy_fn), reinterpret_cast<MPI_Comm_delete_attr_function*>(delete_fn),
863 keyval, extra_state) ;
866 void mpi_comm_free_keyval_ (int* keyval, int* ierr) {
867 *ierr = MPI_Comm_free_keyval( keyval);
870 void mpi_comm_get_name_ (int* comm, char* name, int* len, int* ierr){
871 *ierr = MPI_Comm_get_name(simgrid::smpi::Comm::f2c(*comm), name, len);
876 void mpi_comm_compare_ (int* comm1, int* comm2, int *result, int* ierr){
878 *ierr = MPI_Comm_compare(simgrid::smpi::Comm::f2c(*comm1), simgrid::smpi::Comm::f2c(*comm2), result);
881 void mpi_comm_disconnect_ (int* comm, int* ierr){
882 MPI_Comm tmp = simgrid::smpi::Comm::f2c(*comm);
883 *ierr = MPI_Comm_disconnect(&tmp);
884 if(*ierr == MPI_SUCCESS) {
885 simgrid::smpi::Comm::free_f(*comm);
889 void mpi_request_free_ (int* request, int* ierr){
890 MPI_Request tmp=simgrid::smpi::Request::f2c(*request);
891 *ierr = MPI_Request_free(&tmp);
892 if(*ierr == MPI_SUCCESS) {
893 simgrid::smpi::Request::free_f(*request);
897 void mpi_sendrecv_replace_ (void *buf, int* count, int* datatype, int* dst, int* sendtag, int* src, int* recvtag,
898 int* comm, MPI_Status* status, int* ierr)
900 *ierr = MPI_Sendrecv_replace(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *dst, *sendtag, *src,
901 *recvtag, simgrid::smpi::Comm::f2c(*comm), FORT_STATUS_IGNORE(status));
904 void mpi_testany_ (int* count, int* requests, int *index, int *flag, MPI_Status* status, int* ierr)
909 reqs = xbt_new(MPI_Request, *count);
910 for(i = 0; i < *count; i++) {
911 reqs[i] = simgrid::smpi::Request::f2c(requests[i]);
913 *ierr = MPI_Testany(*count, reqs, index, flag, FORT_STATUS_IGNORE(status));
914 if(*index!=MPI_UNDEFINED && reqs[*index]==MPI_REQUEST_NULL){
915 simgrid::smpi::Request::free_f(requests[*index]);
916 requests[*index]=MPI_FORTRAN_REQUEST_NULL;
921 void mpi_waitsome_ (int* incount, int* requests, int *outcount, int *indices, MPI_Status* status, int* ierr)
926 reqs = xbt_new(MPI_Request, *incount);
927 for(i = 0; i < *incount; i++) {
928 reqs[i] = simgrid::smpi::Request::f2c(requests[i]);
930 *ierr = MPI_Waitsome(*incount, reqs, outcount, indices, status);
931 for(i=0;i<*outcount;i++){
932 if(reqs[indices[i]]==MPI_REQUEST_NULL){
933 simgrid::smpi::Request::free_f(requests[indices[i]]);
934 requests[indices[i]]=MPI_FORTRAN_REQUEST_NULL;
940 void mpi_reduce_local_ (void *inbuf, void *inoutbuf, int* count, int* datatype, int* op, int* ierr){
942 *ierr = MPI_Reduce_local(inbuf, inoutbuf, *count, simgrid::smpi::Datatype::f2c(*datatype), simgrid::smpi::Op::f2c(*op));
945 void mpi_reduce_scatter_block_ (void *sendbuf, void *recvbuf, int* recvcount, int* datatype, int* op, int* comm,
948 sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
949 *ierr = MPI_Reduce_scatter_block(sendbuf, recvbuf, *recvcount, simgrid::smpi::Datatype::f2c(*datatype), simgrid::smpi::Op::f2c(*op),
950 simgrid::smpi::Comm::f2c(*comm));
953 void mpi_pack_size_ (int* incount, int* datatype, int* comm, int* size, int* ierr) {
954 *ierr = MPI_Pack_size(*incount, simgrid::smpi::Datatype::f2c(*datatype), simgrid::smpi::Comm::f2c(*comm), size);
957 void mpi_cart_coords_ (int* comm, int* rank, int* maxdims, int* coords, int* ierr) {
958 *ierr = MPI_Cart_coords(simgrid::smpi::Comm::f2c(*comm), *rank, *maxdims, coords);
961 void mpi_cart_create_ (int* comm_old, int* ndims, int* dims, int* periods, int* reorder, int* comm_cart, int* ierr) {
963 *ierr = MPI_Cart_create(simgrid::smpi::Comm::f2c(*comm_old), *ndims, dims, periods, *reorder, &tmp);
964 if(*ierr == MPI_SUCCESS) {
965 *comm_cart = tmp->add_f();
969 void mpi_cart_get_ (int* comm, int* maxdims, int* dims, int* periods, int* coords, int* ierr) {
970 *ierr = MPI_Cart_get(simgrid::smpi::Comm::f2c(*comm), *maxdims, dims, periods, coords);
973 void mpi_cart_map_ (int* comm_old, int* ndims, int* dims, int* periods, int* newrank, int* ierr) {
974 *ierr = MPI_Cart_map(simgrid::smpi::Comm::f2c(*comm_old), *ndims, dims, periods, newrank);
977 void mpi_cart_rank_ (int* comm, int* coords, int* rank, int* ierr) {
978 *ierr = MPI_Cart_rank(simgrid::smpi::Comm::f2c(*comm), coords, rank);
981 void mpi_cart_shift_ (int* comm, int* direction, int* displ, int* source, int* dest, int* ierr) {
982 *ierr = MPI_Cart_shift(simgrid::smpi::Comm::f2c(*comm), *direction, *displ, source, dest);
985 void mpi_cart_sub_ (int* comm, int* remain_dims, int* comm_new, int* ierr) {
987 *ierr = MPI_Cart_sub(simgrid::smpi::Comm::f2c(*comm), remain_dims, &tmp);
988 if(*ierr == MPI_SUCCESS) {
989 *comm_new = tmp->add_f();
993 void mpi_cartdim_get_ (int* comm, int* ndims, int* ierr) {
994 *ierr = MPI_Cartdim_get(simgrid::smpi::Comm::f2c(*comm), ndims);
997 void mpi_graph_create_ (int* comm_old, int* nnodes, int* index, int* edges, int* reorder, int* comm_graph, int* ierr) {
999 *ierr = MPI_Graph_create(simgrid::smpi::Comm::f2c(*comm_old), *nnodes, index, edges, *reorder, &tmp);
1000 if(*ierr == MPI_SUCCESS) {
1001 *comm_graph = tmp->add_f();
1005 void mpi_graph_get_ (int* comm, int* maxindex, int* maxedges, int* index, int* edges, int* ierr) {
1006 *ierr = MPI_Graph_get(simgrid::smpi::Comm::f2c(*comm), *maxindex, *maxedges, index, edges);
1009 void mpi_graph_map_ (int* comm_old, int* nnodes, int* index, int* edges, int* newrank, int* ierr) {
1010 *ierr = MPI_Graph_map(simgrid::smpi::Comm::f2c(*comm_old), *nnodes, index, edges, newrank);
1013 void mpi_graph_neighbors_ (int* comm, int* rank, int* maxneighbors, int* neighbors, int* ierr) {
1014 *ierr = MPI_Graph_neighbors(simgrid::smpi::Comm::f2c(*comm), *rank, *maxneighbors, neighbors);
1017 void mpi_graph_neighbors_count_ (int* comm, int* rank, int* nneighbors, int* ierr) {
1018 *ierr = MPI_Graph_neighbors_count(simgrid::smpi::Comm::f2c(*comm), *rank, nneighbors);
1021 void mpi_graphdims_get_ (int* comm, int* nnodes, int* nedges, int* ierr) {
1022 *ierr = MPI_Graphdims_get(simgrid::smpi::Comm::f2c(*comm), nnodes, nedges);
1025 void mpi_topo_test_ (int* comm, int* top_type, int* ierr) {
1026 *ierr = MPI_Topo_test(simgrid::smpi::Comm::f2c(*comm), top_type);
1029 void mpi_error_class_ (int* errorcode, int* errorclass, int* ierr) {
1030 *ierr = MPI_Error_class(*errorcode, errorclass);
1033 void mpi_errhandler_create_ (void* function, void* errhandler, int* ierr) {
1034 *ierr = MPI_Errhandler_create(reinterpret_cast<MPI_Handler_function*>(function), static_cast<MPI_Errhandler*>(errhandler));
1037 void mpi_errhandler_free_ (void* errhandler, int* ierr) {
1038 *ierr = MPI_Errhandler_free(static_cast<MPI_Errhandler*>(errhandler));
1041 void mpi_errhandler_get_ (int* comm, void* errhandler, int* ierr) {
1042 *ierr = MPI_Errhandler_get(simgrid::smpi::Comm::f2c(*comm), static_cast<MPI_Errhandler*>(errhandler));
1045 void mpi_errhandler_set_ (int* comm, void* errhandler, int* ierr) {
1046 *ierr = MPI_Errhandler_set(simgrid::smpi::Comm::f2c(*comm), *static_cast<MPI_Errhandler*>(errhandler));
1049 void mpi_comm_set_errhandler_ (int* comm, void* errhandler, int* ierr) {
1050 *ierr = MPI_Errhandler_set(simgrid::smpi::Comm::f2c(*comm), *static_cast<MPI_Errhandler*>(errhandler));
1053 void mpi_comm_get_errhandler_ (int* comm, void* errhandler, int* ierr) {
1054 *ierr = MPI_Errhandler_set(simgrid::smpi::Comm::f2c(*comm), static_cast<MPI_Errhandler*>(errhandler));
1057 void mpi_type_contiguous_ (int* count, int* old_type, int* newtype, int* ierr) {
1059 *ierr = MPI_Type_contiguous(*count, simgrid::smpi::Datatype::f2c(*old_type), &tmp);
1060 if(*ierr == MPI_SUCCESS) {
1061 *newtype = tmp->add_f();
1065 void mpi_cancel_ (int* request, int* ierr) {
1066 MPI_Request tmp=simgrid::smpi::Request::f2c(*request);
1067 *ierr = MPI_Cancel(&tmp);
1070 void mpi_buffer_attach_ (void* buffer, int* size, int* ierr) {
1071 *ierr = MPI_Buffer_attach(buffer, *size);
1074 void mpi_buffer_detach_ (void* buffer, int* size, int* ierr) {
1075 *ierr = MPI_Buffer_detach(buffer, size);
1078 void mpi_testsome_ (int* incount, int* requests, int* outcount, int* indices, MPI_Status* statuses, int* ierr) {
1082 reqs = xbt_new(MPI_Request, *incount);
1083 for(i = 0; i < *incount; i++) {
1084 reqs[i] = simgrid::smpi::Request::f2c(requests[i]);
1087 *ierr = MPI_Testsome(*incount, reqs, outcount, indices, FORT_STATUSES_IGNORE(statuses));
1088 for(i=0;i<*incount;i++){
1089 if(indices[i] && reqs[indices[i]]==MPI_REQUEST_NULL){
1090 simgrid::smpi::Request::free_f(requests[indices[i]]);
1091 requests[indices[i]]=MPI_FORTRAN_REQUEST_NULL;
1097 void mpi_comm_test_inter_ (int* comm, int* flag, int* ierr) {
1098 *ierr = MPI_Comm_test_inter(simgrid::smpi::Comm::f2c(*comm), flag);
1101 void mpi_unpack_ (void* inbuf, int* insize, int* position, void* outbuf, int* outcount, int* type, int* comm,
1103 *ierr = MPI_Unpack(inbuf, *insize, position, outbuf, *outcount, simgrid::smpi::Datatype::f2c(*type), simgrid::smpi::Comm::f2c(*comm));
1106 void mpi_pack_external_size_ (char *datarep, int* incount, int* datatype, MPI_Aint *size, int* ierr){
1107 *ierr = MPI_Pack_external_size(datarep, *incount, simgrid::smpi::Datatype::f2c(*datatype), size);
1110 void mpi_pack_external_ (char *datarep, void *inbuf, int* incount, int* datatype, void *outbuf, MPI_Aint* outcount,
1111 MPI_Aint *position, int* ierr){
1112 *ierr = MPI_Pack_external(datarep, inbuf, *incount, simgrid::smpi::Datatype::f2c(*datatype), outbuf, *outcount, position);
1115 void mpi_unpack_external_ ( char *datarep, void *inbuf, MPI_Aint* insize, MPI_Aint *position, void *outbuf,
1116 int* outcount, int* datatype, int* ierr){
1117 *ierr = MPI_Unpack_external( datarep, inbuf, *insize, position, outbuf, *outcount, simgrid::smpi::Datatype::f2c(*datatype));
1120 void mpi_type_hindexed_ (int* count, int* blocklens, MPI_Aint* indices, int* old_type, int* newtype, int* ierr) {
1122 *ierr = MPI_Type_hindexed(*count, blocklens, indices, simgrid::smpi::Datatype::f2c(*old_type), &tmp);
1123 if(*ierr == MPI_SUCCESS) {
1124 *newtype = tmp->add_f();
1128 void mpi_type_create_hindexed_(int* count, int* blocklens, MPI_Aint* indices, int* old_type, int* newtype, int* ierr){
1130 *ierr = MPI_Type_create_hindexed(*count, blocklens, indices, simgrid::smpi::Datatype::f2c(*old_type), &tmp);
1131 if(*ierr == MPI_SUCCESS) {
1132 *newtype = tmp->add_f();
1136 void mpi_type_create_hindexed_block_ (int* count, int* blocklength, MPI_Aint* indices, int* old_type, int* newtype,
1139 *ierr = MPI_Type_create_hindexed_block(*count, *blocklength, indices, simgrid::smpi::Datatype::f2c(*old_type), &tmp);
1140 if(*ierr == MPI_SUCCESS) {
1141 *newtype = tmp->add_f();
1145 void mpi_type_indexed_ (int* count, int* blocklens, int* indices, int* old_type, int* newtype, int* ierr) {
1147 *ierr = MPI_Type_indexed(*count, blocklens, indices, simgrid::smpi::Datatype::f2c(*old_type), &tmp);
1148 if(*ierr == MPI_SUCCESS) {
1149 *newtype = tmp->add_f();
1153 void mpi_type_create_indexed_block_ (int* count, int* blocklength, int* indices, int* old_type, int*newtype,
1156 *ierr = MPI_Type_create_indexed_block(*count, *blocklength, indices, simgrid::smpi::Datatype::f2c(*old_type), &tmp);
1157 if(*ierr == MPI_SUCCESS) {
1158 *newtype = tmp->add_f();
1162 void mpi_type_struct_ (int* count, int* blocklens, MPI_Aint* indices, int* old_types, int* newtype, int* ierr) {
1165 MPI_Datatype* types = static_cast<MPI_Datatype*>(xbt_malloc(*count*sizeof(MPI_Datatype)));
1166 for(i=0; i< *count; i++){
1167 types[i] = simgrid::smpi::Datatype::f2c(old_types[i]);
1169 *ierr = MPI_Type_struct(*count, blocklens, indices, types, &tmp);
1170 if(*ierr == MPI_SUCCESS) {
1171 *newtype = tmp->add_f();
1176 void mpi_type_create_struct_(int* count, int* blocklens, MPI_Aint* indices, int* old_types, int* newtype, int* ierr){
1179 MPI_Datatype* types = static_cast<MPI_Datatype*>(xbt_malloc(*count*sizeof(MPI_Datatype)));
1180 for(i=0; i< *count; i++){
1181 types[i] = simgrid::smpi::Datatype::f2c(old_types[i]);
1183 *ierr = MPI_Type_create_struct(*count, blocklens, indices, types, &tmp);
1184 if(*ierr == MPI_SUCCESS) {
1185 *newtype = tmp->add_f();
1190 void mpi_ssend_ (void* buf, int* count, int* datatype, int* dest, int* tag, int* comm, int* ierr) {
1191 *ierr = MPI_Ssend(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *dest, *tag, simgrid::smpi::Comm::f2c(*comm));
1194 void mpi_ssend_init_ (void* buf, int* count, int* datatype, int* dest, int* tag, int* comm, int* request, int* ierr) {
1196 *ierr = MPI_Ssend_init(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *dest, *tag, simgrid::smpi::Comm::f2c(*comm), &tmp);
1197 if(*ierr == MPI_SUCCESS) {
1198 *request = tmp->add_f();
1202 void mpi_intercomm_create_ (int* local_comm, int *local_leader, int* peer_comm, int* remote_leader, int* tag,
1203 int* comm_out, int* ierr) {
1205 *ierr = MPI_Intercomm_create(simgrid::smpi::Comm::f2c(*local_comm), *local_leader, simgrid::smpi::Comm::f2c(*peer_comm), *remote_leader,
1207 if(*ierr == MPI_SUCCESS) {
1208 *comm_out = tmp->add_f();
1212 void mpi_intercomm_merge_ (int* comm, int* high, int* comm_out, int* ierr) {
1214 *ierr = MPI_Intercomm_merge(simgrid::smpi::Comm::f2c(*comm), *high, &tmp);
1215 if(*ierr == MPI_SUCCESS) {
1216 *comm_out = tmp->add_f();
1220 void mpi_bsend_ (void* buf, int* count, int* datatype, int *dest, int* tag, int* comm, int* ierr) {
1221 *ierr = MPI_Bsend(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *dest, *tag, simgrid::smpi::Comm::f2c(*comm));
1224 void mpi_bsend_init_ (void* buf, int* count, int* datatype, int *dest, int* tag, int* comm, int* request, int* ierr) {
1226 *ierr = MPI_Bsend_init(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *dest, *tag, simgrid::smpi::Comm::f2c(*comm), &tmp);
1227 if(*ierr == MPI_SUCCESS) {
1228 *request = tmp->add_f();
1232 void mpi_ibsend_ (void* buf, int* count, int* datatype, int *dest, int* tag, int* comm, int* request, int* ierr) {
1234 *ierr = MPI_Ibsend(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *dest, *tag, simgrid::smpi::Comm::f2c(*comm), &tmp);
1235 if(*ierr == MPI_SUCCESS) {
1236 *request = tmp->add_f();
1240 void mpi_comm_remote_group_ (int* comm, int* group, int* ierr) {
1242 *ierr = MPI_Comm_remote_group(simgrid::smpi::Comm::f2c(*comm), &tmp);
1243 if(*ierr == MPI_SUCCESS) {
1244 *group = tmp->c2f();
1248 void mpi_comm_remote_size_ (int* comm, int* size, int* ierr) {
1249 *ierr = MPI_Comm_remote_size(simgrid::smpi::Comm::f2c(*comm), size);
1252 void mpi_issend_ (void* buf, int* count, int* datatype, int *dest, int* tag, int* comm, int* request, int* ierr) {
1254 *ierr = MPI_Issend(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *dest, *tag, simgrid::smpi::Comm::f2c(*comm), &tmp);
1255 if(*ierr == MPI_SUCCESS) {
1256 *request = tmp->add_f();
1260 void mpi_probe_ (int* source, int* tag, int* comm, MPI_Status* status, int* ierr) {
1261 *ierr = MPI_Probe(*source, *tag, simgrid::smpi::Comm::f2c(*comm), FORT_STATUS_IGNORE(status));
1264 void mpi_attr_delete_ (int* comm, int* keyval, int* ierr) {
1265 *ierr = MPI_Attr_delete(simgrid::smpi::Comm::f2c(*comm), *keyval);
1268 void mpi_attr_put_ (int* comm, int* keyval, void* attr_value, int* ierr) {
1269 *ierr = MPI_Attr_put(simgrid::smpi::Comm::f2c(*comm), *keyval, attr_value);
1272 void mpi_rsend_init_ (void* buf, int* count, int* datatype, int *dest, int* tag, int* comm, int* request, int* ierr) {
1274 *ierr = MPI_Rsend_init(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *dest, *tag, simgrid::smpi::Comm::f2c(*comm), &tmp);
1275 if(*ierr == MPI_SUCCESS) {
1276 *request = tmp->add_f();
1280 void mpi_keyval_create_ (void* copy_fn, void* delete_fn, int* keyval, void* extra_state, int* ierr) {
1281 *ierr = MPI_Keyval_create(reinterpret_cast<MPI_Copy_function*>(copy_fn),reinterpret_cast<MPI_Delete_function*>(delete_fn), keyval, extra_state);
1284 void mpi_keyval_free_ (int* keyval, int* ierr) {
1285 *ierr = MPI_Keyval_free(keyval);
1288 void mpi_test_cancelled_ (MPI_Status* status, int* flag, int* ierr) {
1289 *ierr = MPI_Test_cancelled(status, flag);
1292 void mpi_pack_ (void* inbuf, int* incount, int* type, void* outbuf, int* outcount, int* position, int* comm, int* ierr) {
1293 *ierr = MPI_Pack(inbuf, *incount, simgrid::smpi::Datatype::f2c(*type), outbuf, *outcount, position, simgrid::smpi::Comm::f2c(*comm));
1296 void mpi_get_elements_ (MPI_Status* status, int* datatype, int* elements, int* ierr) {
1297 *ierr = MPI_Get_elements(status, simgrid::smpi::Datatype::f2c(*datatype), elements);
1300 void mpi_dims_create_ (int* nnodes, int* ndims, int* dims, int* ierr) {
1301 *ierr = MPI_Dims_create(*nnodes, *ndims, dims);
1304 void mpi_iprobe_ (int* source, int* tag, int* comm, int* flag, MPI_Status* status, int* ierr) {
1305 *ierr = MPI_Iprobe(*source, *tag, simgrid::smpi::Comm::f2c(*comm), flag, status);
1308 void mpi_type_get_envelope_ ( int* datatype, int *num_integers, int *num_addresses, int *num_datatypes, int *combiner,
1310 *ierr = MPI_Type_get_envelope( simgrid::smpi::Datatype::f2c(*datatype), num_integers,
1311 num_addresses, num_datatypes, combiner);
1314 void mpi_type_get_contents_ (int* datatype, int* max_integers, int* max_addresses, int* max_datatypes,
1315 int* array_of_integers, MPI_Aint* array_of_addresses,
1316 int* array_of_datatypes, int* ierr){
1317 *ierr = MPI_Type_get_contents(simgrid::smpi::Datatype::f2c(*datatype), *max_integers, *max_addresses,*max_datatypes,
1318 array_of_integers, array_of_addresses, reinterpret_cast<MPI_Datatype*>(array_of_datatypes));
1321 void mpi_type_create_darray_ (int* size, int* rank, int* ndims, int* array_of_gsizes, int* array_of_distribs,
1322 int* array_of_dargs, int* array_of_psizes,
1323 int* order, int* oldtype, int*newtype, int* ierr) {
1325 *ierr = MPI_Type_create_darray(*size, *rank, *ndims, array_of_gsizes,
1326 array_of_distribs, array_of_dargs, array_of_psizes,
1327 *order, simgrid::smpi::Datatype::f2c(*oldtype), &tmp) ;
1328 if(*ierr == MPI_SUCCESS) {
1329 *newtype = tmp->add_f();
1333 void mpi_type_create_resized_ (int* oldtype,MPI_Aint* lb, MPI_Aint* extent, int*newtype, int* ierr){
1335 *ierr = MPI_Type_create_resized(simgrid::smpi::Datatype::f2c(*oldtype),*lb, *extent, &tmp);
1336 if(*ierr == MPI_SUCCESS) {
1337 *newtype = tmp->add_f();
1341 void mpi_type_create_subarray_ (int* ndims,int *array_of_sizes, int *array_of_subsizes, int *array_of_starts,
1342 int* order, int* oldtype, int*newtype, int* ierr){
1344 *ierr = MPI_Type_create_subarray(*ndims,array_of_sizes, array_of_subsizes, array_of_starts, *order,
1345 simgrid::smpi::Datatype::f2c(*oldtype), &tmp);
1346 if(*ierr == MPI_SUCCESS) {
1347 *newtype = tmp->add_f();
1351 void mpi_type_match_size_ (int* typeclass,int* size,int* datatype, int* ierr){
1353 *ierr = MPI_Type_match_size(*typeclass,*size,&tmp);
1354 if(*ierr == MPI_SUCCESS) {
1355 *datatype = tmp->c2f();
1359 void mpi_alltoallw_ ( void *sendbuf, int *sendcnts, int *sdispls, int* sendtypes, void *recvbuf, int *recvcnts,
1360 int *rdispls, int* recvtypes, int* comm, int* ierr){
1361 *ierr = MPI_Alltoallw( sendbuf, sendcnts, sdispls, reinterpret_cast<MPI_Datatype*>(sendtypes), recvbuf, recvcnts, rdispls,
1362 reinterpret_cast<MPI_Datatype*>(recvtypes), simgrid::smpi::Comm::f2c(*comm));
1365 void mpi_exscan_ (void *sendbuf, void *recvbuf, int* count, int* datatype, int* op, int* comm, int* ierr){
1366 *ierr = MPI_Exscan(sendbuf, recvbuf, *count, simgrid::smpi::Datatype::f2c(*datatype), simgrid::smpi::Op::f2c(*op), simgrid::smpi::Comm::f2c(*comm));
1369 void mpi_comm_set_name_ (int* comm, char* name, int* ierr, int size){
1370 char* tname = xbt_new(char, size+1);
1371 strncpy(tname, name, size);
1373 *ierr = MPI_Comm_set_name (simgrid::smpi::Comm::f2c(*comm), tname);
1377 void mpi_comm_dup_with_info_ (int* comm, int* info, int* newcomm, int* ierr){
1379 *ierr = MPI_Comm_dup_with_info(simgrid::smpi::Comm::f2c(*comm), simgrid::smpi::Info::f2c(*info),&tmp);
1380 if(*ierr == MPI_SUCCESS) {
1381 *newcomm = tmp->add_f();
1385 void mpi_comm_split_type_ (int* comm, int* split_type, int* key, int* info, int* newcomm, int* ierr){
1387 *ierr = MPI_Comm_split_type(simgrid::smpi::Comm::f2c(*comm), *split_type, *key, simgrid::smpi::Info::f2c(*info), &tmp);
1388 if(*ierr == MPI_SUCCESS) {
1389 *newcomm = tmp->add_f();
1393 void mpi_comm_set_info_ (int* comm, int* info, int* ierr){
1394 *ierr = MPI_Comm_set_info (simgrid::smpi::Comm::f2c(*comm), simgrid::smpi::Info::f2c(*info));
1397 void mpi_comm_get_info_ (int* comm, int* info, int* ierr){
1399 *ierr = MPI_Comm_get_info (simgrid::smpi::Comm::f2c(*comm), &tmp);
1400 if(*ierr==MPI_SUCCESS){
1405 void mpi_comm_create_errhandler_ ( void *function, void *errhandler, int* ierr){
1406 *ierr = MPI_Comm_create_errhandler( reinterpret_cast<MPI_Comm_errhandler_fn*>(function), static_cast<MPI_Errhandler*>(errhandler));
1409 void mpi_add_error_class_ ( int *errorclass, int* ierr){
1410 *ierr = MPI_Add_error_class( errorclass);
1413 void mpi_add_error_code_ ( int* errorclass, int *errorcode, int* ierr){
1414 *ierr = MPI_Add_error_code(*errorclass, errorcode);
1417 void mpi_add_error_string_ ( int* errorcode, char *string, int* ierr){
1418 *ierr = MPI_Add_error_string(*errorcode, string);
1421 void mpi_comm_call_errhandler_ (int* comm,int* errorcode, int* ierr){
1422 *ierr = MPI_Comm_call_errhandler(simgrid::smpi::Comm::f2c(*comm), *errorcode);
1425 void mpi_info_dup_ (int* info, int* newinfo, int* ierr){
1427 *ierr = MPI_Info_dup(simgrid::smpi::Info::f2c(*info), &tmp);
1428 if(*ierr==MPI_SUCCESS){
1429 *newinfo= tmp->add_f();
1433 void mpi_info_get_valuelen_ ( int* info, char *key, int *valuelen, int *flag, int* ierr, unsigned int keylen){
1434 while(key[keylen-1]==' ')
1436 while(*key==' '){//handle leading blanks
1440 char* tkey = xbt_new(char, keylen+1);
1441 strncpy(tkey, key, keylen);
1443 *ierr = MPI_Info_get_valuelen( simgrid::smpi::Info::f2c(*info), tkey, valuelen, flag);
1447 void mpi_info_delete_ (int* info, char *key, int* ierr, unsigned int keylen){
1448 while(key[keylen-1]==' ')
1450 while(*key==' '){//handle leading blanks
1454 char* tkey = xbt_new(char, keylen+1);
1455 strncpy(tkey, key, keylen);
1457 *ierr = MPI_Info_delete(simgrid::smpi::Info::f2c(*info), tkey);
1461 void mpi_info_get_nkeys_ ( int* info, int *nkeys, int* ierr){
1462 *ierr = MPI_Info_get_nkeys( simgrid::smpi::Info::f2c(*info), nkeys);
1465 void mpi_info_get_nthkey_ ( int* info, int* n, char *key, int* ierr, unsigned int keylen){
1466 *ierr = MPI_Info_get_nthkey( simgrid::smpi::Info::f2c(*info), *n, key);
1468 for (i=strlen(key); i<keylen; i++)
1472 void mpi_get_version_ (int *version,int *subversion, int* ierr){
1473 *ierr = MPI_Get_version (version,subversion);
1476 void mpi_get_library_version_ (char *version,int *len, int* ierr){
1477 *ierr = MPI_Get_library_version (version,len);
1480 void mpi_request_get_status_ ( int* request, int *flag, MPI_Status* status, int* ierr){
1481 *ierr = MPI_Request_get_status( simgrid::smpi::Request::f2c(*request), flag, status);
1484 void mpi_grequest_start_ ( void *query_fn, void *free_fn, void *cancel_fn, void *extra_state, int*request, int* ierr){
1486 *ierr = MPI_Grequest_start( reinterpret_cast<MPI_Grequest_query_function*>(query_fn), reinterpret_cast<MPI_Grequest_free_function*>(free_fn),
1487 reinterpret_cast<MPI_Grequest_cancel_function*>(cancel_fn), extra_state, &tmp);
1488 if(*ierr == MPI_SUCCESS) {
1489 *request = tmp->add_f();
1493 void mpi_grequest_complete_ ( int* request, int* ierr){
1494 *ierr = MPI_Grequest_complete( simgrid::smpi::Request::f2c(*request));
1497 void mpi_status_set_cancelled_ (MPI_Status* status,int* flag, int* ierr){
1498 *ierr = MPI_Status_set_cancelled(status,*flag);
1501 void mpi_status_set_elements_ ( MPI_Status* status, int* datatype, int* count, int* ierr){
1502 *ierr = MPI_Status_set_elements( status, simgrid::smpi::Datatype::f2c(*datatype), *count);
1505 void mpi_comm_connect_ ( char *port_name, int* info, int* root, int* comm, int*newcomm, int* ierr){
1507 *ierr = MPI_Comm_connect( port_name, *reinterpret_cast<MPI_Info*>(info), *root, simgrid::smpi::Comm::f2c(*comm), &tmp);
1508 if(*ierr == MPI_SUCCESS) {
1509 *newcomm = tmp->add_f();
1513 void mpi_publish_name_ ( char *service_name, int* info, char *port_name, int* ierr){
1514 *ierr = MPI_Publish_name( service_name, *reinterpret_cast<MPI_Info*>(info), port_name);
1517 void mpi_unpublish_name_ ( char *service_name, int* info, char *port_name, int* ierr){
1518 *ierr = MPI_Unpublish_name( service_name, *reinterpret_cast<MPI_Info*>(info), port_name);
1521 void mpi_lookup_name_ ( char *service_name, int* info, char *port_name, int* ierr){
1522 *ierr = MPI_Lookup_name( service_name, *reinterpret_cast<MPI_Info*>(info), port_name);
1525 void mpi_comm_join_ ( int* fd, int* intercomm, int* ierr){
1527 *ierr = MPI_Comm_join( *fd, &tmp);
1528 if(*ierr == MPI_SUCCESS) {
1529 *intercomm = tmp->add_f();
1533 void mpi_open_port_ ( int* info, char *port_name, int* ierr){
1534 *ierr = MPI_Open_port( *reinterpret_cast<MPI_Info*>(info),port_name);
1537 void mpi_close_port_ ( char *port_name, int* ierr){
1538 *ierr = MPI_Close_port( port_name);
1541 void mpi_comm_accept_ ( char *port_name, int* info, int* root, int* comm, int*newcomm, int* ierr){
1543 *ierr = MPI_Comm_accept( port_name, *reinterpret_cast<MPI_Info*>(info), *root, simgrid::smpi::Comm::f2c(*comm), &tmp);
1544 if(*ierr == MPI_SUCCESS) {
1545 *newcomm = tmp->add_f();
1549 void mpi_comm_spawn_ ( char *command, char *argv, int* maxprocs, int* info, int* root, int* comm, int* intercomm,
1550 int* array_of_errcodes, int* ierr){
1552 *ierr = MPI_Comm_spawn( command, nullptr, *maxprocs, *reinterpret_cast<MPI_Info*>(info), *root, simgrid::smpi::Comm::f2c(*comm), &tmp,
1554 if(*ierr == MPI_SUCCESS) {
1555 *intercomm = tmp->add_f();
1559 void mpi_comm_spawn_multiple_ ( int* count, char *array_of_commands, char** array_of_argv, int* array_of_maxprocs,
1560 int* array_of_info, int* root,
1561 int* comm, int* intercomm, int* array_of_errcodes, int* ierr){
1563 *ierr = MPI_Comm_spawn_multiple(* count, &array_of_commands, &array_of_argv, array_of_maxprocs,
1564 reinterpret_cast<MPI_Info*>(array_of_info), *root, simgrid::smpi::Comm::f2c(*comm), &tmp, array_of_errcodes);
1565 if(*ierr == MPI_SUCCESS) {
1566 *intercomm = tmp->add_f();
1570 void mpi_comm_get_parent_ ( int* parent, int* ierr){
1572 *ierr = MPI_Comm_get_parent( &tmp);
1573 if(*ierr == MPI_SUCCESS) {
1574 *parent = tmp->c2f();
1578 void mpi_file_close_ ( int* file, int* ierr){
1579 *ierr= MPI_File_close(reinterpret_cast<MPI_File*>(*file));
1582 void mpi_file_delete_ ( char* filename, int* info, int* ierr){
1583 *ierr= MPI_File_delete(filename, simgrid::smpi::Info::f2c(*info));
1586 void mpi_file_open_ ( int* comm, char* filename, int* amode, int* info, int* fh, int* ierr){
1587 *ierr= MPI_File_open(simgrid::smpi::Comm::f2c(*comm), filename, *amode, simgrid::smpi::Info::f2c(*info), reinterpret_cast<MPI_File*>(*fh));
1590 void mpi_file_set_view_ ( int* fh, long long int* offset, int* etype, int* filetype, char* datarep, int* info, int* ierr){
1591 *ierr= MPI_File_set_view(reinterpret_cast<MPI_File>(*fh) , reinterpret_cast<MPI_Offset>(*offset), simgrid::smpi::Datatype::f2c(*etype), simgrid::smpi::Datatype::f2c(*filetype), datarep, simgrid::smpi::Info::f2c(*info));
1594 void mpi_file_read_ ( int* fh, void* buf, int* count, int* datatype, MPI_Status* status, int* ierr){
1595 *ierr= MPI_File_read(reinterpret_cast<MPI_File>(*fh), buf, *count, simgrid::smpi::Datatype::f2c(*datatype), status);
1598 void mpi_file_write_ ( int* fh, void* buf, int* count, int* datatype, MPI_Status* status, int* ierr){
1599 *ierr= MPI_File_write(reinterpret_cast<MPI_File>(*fh), buf, *count, simgrid::smpi::Datatype::f2c(*datatype), status);