+
+void mpi_graph_get_ (int* comm, int* maxindex, int* maxedges, int* index, int* edges, int* ierr) {
+ *ierr = MPI_Graph_get(smpi_comm_f2c(*comm), *maxindex, *maxedges, index, edges);
+}
+
+void mpi_graph_map_ (int* comm_old, int* nnodes, int* index, int* edges, int* newrank, int* ierr) {
+ *ierr = MPI_Graph_map(smpi_comm_f2c(*comm_old), *nnodes, index, edges, newrank);
+}
+
+void mpi_graph_neighbors_ (int* comm, int* rank, int* maxneighbors, int* neighbors, int* ierr) {
+ *ierr = MPI_Graph_neighbors(smpi_comm_f2c(*comm), *rank, *maxneighbors, neighbors);
+}
+
+void mpi_graph_neighbors_count_ (int* comm, int* rank, int* nneighbors, int* ierr) {
+ *ierr = MPI_Graph_neighbors_count(smpi_comm_f2c(*comm), *rank, nneighbors);
+}
+
+void mpi_graphdims_get_ (int* comm, int* nnodes, int* nedges, int* ierr) {
+ *ierr = MPI_Graphdims_get(smpi_comm_f2c(*comm), nnodes, nedges);
+}
+
+void mpi_topo_test_ (int* comm, int* top_type, int* ierr) {
+ *ierr = MPI_Topo_test(smpi_comm_f2c(*comm), top_type);
+}
+
+void mpi_error_class_ (int* errorcode, int* errorclass, int* ierr) {
+ *ierr = MPI_Error_class(*errorcode, errorclass);
+}
+
+void mpi_errhandler_create_ (void* function, void* errhandler, int* ierr) {
+ *ierr = MPI_Errhandler_create((MPI_Handler_function*)function, (MPI_Errhandler*)errhandler);
+}
+
+void mpi_errhandler_free_ (void* errhandler, int* ierr) {
+ *ierr = MPI_Errhandler_free((MPI_Errhandler*)errhandler);
+}
+
+void mpi_errhandler_get_ (int* comm, void* errhandler, int* ierr) {
+ *ierr = MPI_Errhandler_get(smpi_comm_f2c(*comm), (MPI_Errhandler*) errhandler);
+}
+
+void mpi_errhandler_set_ (int* comm, void* errhandler, int* ierr) {
+ *ierr = MPI_Errhandler_set(smpi_comm_f2c(*comm), *(MPI_Errhandler*)errhandler);
+}
+
+void mpi_comm_set_errhandler_ (int* comm, void* errhandler, int* ierr) {
+ *ierr = MPI_Errhandler_set(smpi_comm_f2c(*comm), *(MPI_Errhandler*)errhandler);
+}
+
+void mpi_comm_get_errhandler_ (int* comm, void* errhandler, int* ierr) {
+ *ierr = MPI_Errhandler_set(smpi_comm_f2c(*comm), (MPI_Errhandler*)errhandler);
+}
+
+void mpi_type_contiguous_ (int* count, int* old_type, int* newtype, int* ierr) {
+ MPI_Datatype tmp;
+ *ierr = MPI_Type_contiguous(*count, smpi_type_f2c(*old_type), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newtype = smpi_type_c2f(tmp);
+ }
+}
+
+void mpi_cancel_ (int* request, int* ierr) {
+ MPI_Request tmp=smpi_request_f2c(*request);
+ *ierr = MPI_Cancel(&tmp);
+}
+
+void mpi_buffer_attach_ (void* buffer, int* size, int* ierr) {
+ *ierr = MPI_Buffer_attach(buffer, *size);
+}
+
+void mpi_buffer_detach_ (void* buffer, int* size, int* ierr) {
+ *ierr = MPI_Buffer_detach(buffer, size);
+}
+
+void mpi_testsome_ (int* incount, int* requests, int* outcount, int* indices, MPI_Status* statuses, int* ierr) {
+ MPI_Request* reqs;
+ int i;
+
+ reqs = xbt_new(MPI_Request, *incount);
+ for(i = 0; i < *incount; i++) {
+ reqs[i] = smpi_request_f2c(requests[i]);
+ indices[i]=0;
+ }
+ *ierr = MPI_Testsome(*incount, reqs, outcount, indices, FORT_STATUSES_IGNORE(statuses));
+ for(i=0;i<*incount;i++){
+ if(indices[i]){
+ if(reqs[indices[i]]==MPI_REQUEST_NULL){
+ free_request(requests[indices[i]]);
+ requests[indices[i]]=MPI_FORTRAN_REQUEST_NULL;
+ }
+ }
+ }
+ free(reqs);
+}
+
+void mpi_comm_test_inter_ (int* comm, int* flag, int* ierr) {
+ *ierr = MPI_Comm_test_inter(smpi_comm_f2c(*comm), flag);
+}
+
+void mpi_unpack_ (void* inbuf, int* insize, int* position, void* outbuf, int* outcount, int* type, int* comm, int* ierr) {
+ *ierr = MPI_Unpack(inbuf, *insize, position, outbuf, *outcount, smpi_type_f2c(*type), smpi_comm_f2c(*comm));
+}
+
+void mpi_pack_external_size_ (char *datarep, int* incount, int* datatype, MPI_Aint *size, int* ierr){
+ *ierr = MPI_Pack_external_size(datarep, *incount, smpi_type_f2c(*datatype), size);
+}
+
+void mpi_pack_external_ (char *datarep, void *inbuf, int* incount, int* datatype, void *outbuf, MPI_Aint* outcount, MPI_Aint *position, int* ierr){
+ *ierr = MPI_Pack_external(datarep, inbuf, *incount, smpi_type_f2c(*datatype), outbuf, *outcount, position);
+}
+
+void mpi_unpack_external_ ( char *datarep, void *inbuf, MPI_Aint* insize, MPI_Aint *position, void *outbuf, int* outcount, int* datatype, int* ierr){
+ *ierr = MPI_Unpack_external( datarep, inbuf, *insize, position, outbuf, *outcount, smpi_type_f2c(*datatype));
+}
+
+void mpi_type_hindexed_ (int* count, int* blocklens, MPI_Aint* indices, int* old_type, int* newtype, int* ierr) {
+ MPI_Datatype tmp;
+ *ierr = MPI_Type_hindexed(*count, blocklens, indices, smpi_type_f2c(*old_type), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newtype = smpi_type_c2f(tmp);
+ }
+}
+
+void mpi_type_create_hindexed_ (int* count, int* blocklens, MPI_Aint* indices, int* old_type, int* newtype, int* ierr) {
+ MPI_Datatype tmp;
+ *ierr = MPI_Type_create_hindexed(*count, blocklens, indices, smpi_type_f2c(*old_type), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newtype = smpi_type_c2f(tmp);
+ }
+}
+
+void mpi_type_create_hindexed_block_ (int* count, int* blocklength, MPI_Aint* indices, int* old_type, int* newtype, int* ierr) {
+ MPI_Datatype tmp;
+ *ierr = MPI_Type_create_hindexed_block(*count, *blocklength, indices, smpi_type_f2c(*old_type), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newtype = smpi_type_c2f(tmp);
+ }
+}
+
+void mpi_type_indexed_ (int* count, int* blocklens, int* indices, int* old_type, int* newtype, int* ierr) {
+ MPI_Datatype tmp;
+ *ierr = MPI_Type_indexed(*count, blocklens, indices, smpi_type_f2c(*old_type), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newtype = smpi_type_c2f(tmp);
+ }
+}
+
+void mpi_type_create_indexed_block_ (int* count, int* blocklength, int* indices, int* old_type, int*newtype, int* ierr){
+ MPI_Datatype tmp;
+ *ierr = MPI_Type_create_indexed_block(*count, *blocklength, indices, smpi_type_f2c(*old_type), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newtype = smpi_type_c2f(tmp);
+ }
+}
+
+void mpi_type_struct_ (int* count, int* blocklens, MPI_Aint* indices, int* old_types, int* newtype, int* ierr) {
+ MPI_Datatype tmp;
+ int i=0;
+ MPI_Datatype* types = (MPI_Datatype*)xbt_malloc(*count*sizeof(MPI_Datatype));
+ for(i=0; i< *count; i++){
+ types[i] = smpi_type_f2c(old_types[i]);
+ }
+ *ierr = MPI_Type_struct(*count, blocklens, indices, types, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newtype = smpi_type_c2f(tmp);
+ }
+ xbt_free(types);
+}
+
+void mpi_type_create_struct_ (int* count, int* blocklens, MPI_Aint* indices, int* old_types, int* newtype, int* ierr) {
+ MPI_Datatype tmp;
+ int i=0;
+ MPI_Datatype* types = (MPI_Datatype*)xbt_malloc(*count*sizeof(MPI_Datatype));
+ for(i=0; i< *count; i++){
+ types[i] = smpi_type_f2c(old_types[i]);
+ }
+ *ierr = MPI_Type_create_struct(*count, blocklens, indices, types, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newtype = smpi_type_c2f(tmp);
+ }
+ xbt_free(types);
+}
+
+void mpi_ssend_ (void* buf, int* count, int* datatype, int* dest, int* tag, int* comm, int* ierr) {
+ *ierr = MPI_Ssend(buf, *count, smpi_type_f2c(*datatype), *dest, *tag, smpi_comm_f2c(*comm));
+}
+
+void mpi_ssend_init_ (void* buf, int* count, int* datatype, int* dest, int* tag, int* comm, int* request, int* ierr) {
+ MPI_Request tmp;
+ *ierr = MPI_Ssend_init(buf, *count, smpi_type_f2c(*datatype), *dest, *tag, smpi_comm_f2c(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *request = smpi_request_c2f(tmp);
+ }
+}
+
+void mpi_intercomm_create_ (int* local_comm, int *local_leader, int* peer_comm, int* remote_leader, int* tag, int* comm_out, int* ierr) {
+ MPI_Comm tmp;
+ *ierr = MPI_Intercomm_create(smpi_comm_f2c(*local_comm), *local_leader,smpi_comm_f2c(*peer_comm), *remote_leader, *tag, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *comm_out = smpi_comm_c2f(tmp);
+ }
+}
+
+void mpi_intercomm_merge_ (int* comm, int* high, int* comm_out, int* ierr) {
+ MPI_Comm tmp;
+ *ierr = MPI_Intercomm_merge(smpi_comm_f2c(*comm), *high, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *comm_out = smpi_comm_c2f(tmp);
+ }
+}
+
+void mpi_bsend_ (void* buf, int* count, int* datatype, int *dest, int* tag, int* comm, int* ierr) {
+ *ierr = MPI_Bsend(buf, *count, smpi_type_f2c(*datatype), *dest, *tag, smpi_comm_f2c(*comm));
+}
+
+void mpi_bsend_init_ (void* buf, int* count, int* datatype, int *dest, int* tag, int* comm, int* request, int* ierr) {
+ MPI_Request tmp;
+ *ierr = MPI_Bsend_init(buf, *count, smpi_type_f2c(*datatype), *dest, *tag, smpi_comm_f2c(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *request = smpi_request_c2f(tmp);
+ }
+}
+
+void mpi_ibsend_ (void* buf, int* count, int* datatype, int *dest, int* tag, int* comm, int* request, int* ierr) {
+ MPI_Request tmp;
+ *ierr = MPI_Ibsend(buf, *count, smpi_type_f2c(*datatype), *dest, *tag, smpi_comm_f2c(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *request = smpi_request_c2f(tmp);
+ }
+}
+
+void mpi_comm_remote_group_ (int* comm, int* group, int* ierr) {
+ MPI_Group tmp;
+ *ierr = MPI_Comm_remote_group(smpi_comm_f2c(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *group = smpi_group_c2f(tmp);
+ }
+}
+
+void mpi_comm_remote_size_ (int* comm, int* size, int* ierr) {
+ *ierr = MPI_Comm_remote_size(smpi_comm_f2c(*comm), size);
+}
+
+void mpi_issend_ (void* buf, int* count, int* datatype, int *dest, int* tag, int* comm, int* request, int* ierr) {
+ MPI_Request tmp;
+ *ierr = MPI_Issend(buf, *count, smpi_type_f2c(*datatype), *dest, *tag, smpi_comm_f2c(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *request = smpi_request_c2f(tmp);
+ }
+}
+
+void mpi_probe_ (int* source, int* tag, int* comm, MPI_Status* status, int* ierr) {
+ *ierr = MPI_Probe(*source, *tag, smpi_comm_f2c(*comm), FORT_STATUS_IGNORE(status));
+}
+
+void mpi_attr_delete_ (int* comm, int* keyval, int* ierr) {
+ *ierr = MPI_Attr_delete(smpi_comm_f2c(*comm), *keyval);
+}
+
+void mpi_attr_put_ (int* comm, int* keyval, void* attr_value, int* ierr) {
+ *ierr = MPI_Attr_put(smpi_comm_f2c(*comm), *keyval, attr_value);
+}
+
+void mpi_rsend_init_ (void* buf, int* count, int* datatype, int *dest, int* tag, int* comm, int* request, int* ierr) {
+ MPI_Request tmp;
+ *ierr = MPI_Rsend_init(buf, *count, smpi_type_f2c(*datatype), *dest, *tag, smpi_comm_f2c(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *request = smpi_request_c2f(tmp);
+ }
+}
+
+void mpi_keyval_create_ (void* copy_fn, void* delete_fn, int* keyval, void* extra_state, int* ierr) {
+ *ierr = MPI_Keyval_create((MPI_Copy_function*)copy_fn, (MPI_Delete_function*)delete_fn, keyval, extra_state);
+}
+
+void mpi_keyval_free_ (int* keyval, int* ierr) {
+ *ierr = MPI_Keyval_free(keyval);
+}
+
+void mpi_test_cancelled_ (MPI_Status* status, int* flag, int* ierr) {
+ *ierr = MPI_Test_cancelled(status, flag);
+}
+
+void mpi_pack_ (void* inbuf, int* incount, int* type, void* outbuf, int* outcount, int* position, int* comm, int* ierr) {
+ *ierr = MPI_Pack(inbuf, *incount, smpi_type_f2c(*type), outbuf, *outcount, position, smpi_comm_f2c(*comm));
+}
+
+void mpi_get_elements_ (MPI_Status* status, int* datatype, int* elements, int* ierr) {
+ *ierr = MPI_Get_elements(status, smpi_type_f2c(*datatype), elements);
+}
+
+void mpi_dims_create_ (int* nnodes, int* ndims, int* dims, int* ierr) {
+ *ierr = MPI_Dims_create(*nnodes, *ndims, dims);
+}
+
+void mpi_iprobe_ (int* source, int* tag, int* comm, int* flag, MPI_Status* status, int* ierr) {
+ *ierr = MPI_Iprobe(*source, *tag, smpi_comm_f2c(*comm), flag, status);
+}
+
+void mpi_type_get_envelope_ ( int* datatype, int *num_integers, int *num_addresses, int *num_datatypes, int *combiner, int* ierr){
+
+ *ierr = MPI_Type_get_envelope( smpi_type_f2c(*datatype), num_integers,
+ num_addresses, num_datatypes, combiner);
+}
+
+void mpi_type_get_contents_ (int* datatype, int* max_integers, int* max_addresses, int* max_datatypes, int* array_of_integers, MPI_Aint* array_of_addresses,
+ int* array_of_datatypes, int* ierr){
+ *ierr = MPI_Type_get_contents(smpi_type_f2c(*datatype), *max_integers, *max_addresses,*max_datatypes, array_of_integers, array_of_addresses, (MPI_Datatype*)array_of_datatypes);
+}
+
+void mpi_type_create_darray_ (int* size, int* rank, int* ndims, int* array_of_gsizes, int* array_of_distribs, int* array_of_dargs, int* array_of_psizes,
+ int* order, int* oldtype, int*newtype, int* ierr) {
+ MPI_Datatype tmp;
+ *ierr = MPI_Type_create_darray(*size, *rank, *ndims, array_of_gsizes,
+ array_of_distribs, array_of_dargs, array_of_psizes,
+ *order, smpi_type_f2c(*oldtype), &tmp) ;
+ if(*ierr == MPI_SUCCESS) {
+ *newtype = smpi_type_c2f(tmp);
+ }
+}
+
+void mpi_type_create_resized_ (int* oldtype,MPI_Aint* lb, MPI_Aint* extent, int*newtype, int* ierr){
+ MPI_Datatype tmp;
+ *ierr = MPI_Type_create_resized(smpi_type_f2c(*oldtype),*lb, *extent, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newtype = smpi_type_c2f(tmp);
+ }
+}
+
+void mpi_type_create_subarray_ (int* ndims,int *array_of_sizes, int *array_of_subsizes, int *array_of_starts, int* order, int* oldtype, int*newtype, int* ierr){
+ MPI_Datatype tmp;
+ *ierr = MPI_Type_create_subarray(*ndims,array_of_sizes, array_of_subsizes, array_of_starts, *order, smpi_type_f2c(*oldtype), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newtype = smpi_type_c2f(tmp);
+ }
+}
+
+void mpi_type_match_size_ (int* typeclass,int* size,int* datatype, int* ierr){
+ MPI_Datatype tmp;
+ *ierr = MPI_Type_match_size(*typeclass,*size,&tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *datatype = smpi_type_c2f(tmp);
+ }
+}
+
+void mpi_alltoallw_ ( void *sendbuf, int *sendcnts, int *sdispls, int* sendtypes, void *recvbuf, int *recvcnts, int *rdispls, int* recvtypes,
+ int* comm, int* ierr){
+ *ierr = MPI_Alltoallw( sendbuf, sendcnts, sdispls, (MPI_Datatype*) sendtypes, recvbuf, recvcnts, rdispls, (MPI_Datatype*)recvtypes, smpi_comm_f2c(*comm));
+}
+
+void mpi_exscan_ (void *sendbuf, void *recvbuf, int* count, int* datatype, int* op, int* comm, int* ierr){
+ *ierr = MPI_Exscan(sendbuf, recvbuf, *count, smpi_type_f2c(*datatype), smpi_op_f2c(*op), smpi_comm_f2c(*comm));
+}
+
+void mpi_comm_set_name_ (int* comm, char* name, int* ierr, int size){
+ char* tname = xbt_malloc((size+1)*sizeof(char));
+ strncpy(tname, name, size);
+ tname[size]='\0';
+ *ierr = MPI_Comm_set_name (smpi_comm_f2c(*comm), tname);
+ xbt_free(tname);
+}
+
+void mpi_comm_dup_with_info_ (int* comm, int* info, int* newcomm, int* ierr){
+ MPI_Comm tmp;
+ *ierr = MPI_Comm_dup_with_info(smpi_comm_f2c(*comm),smpi_info_f2c(*info),&tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newcomm = smpi_comm_c2f(tmp);
+ }
+}
+
+void mpi_comm_split_type_ (int* comm, int* split_type, int* key, int* info, int* newcomm, int* ierr){
+ MPI_Comm tmp;
+ *ierr = MPI_Comm_split_type(smpi_comm_f2c(*comm), *split_type, *key, smpi_info_f2c(*info), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newcomm = smpi_comm_c2f(tmp);
+ }
+}
+
+void mpi_comm_set_info_ (int* comm, int* info, int* ierr){
+ *ierr = MPI_Comm_set_info (smpi_comm_f2c(*comm), smpi_info_f2c(*info));
+}
+
+void mpi_comm_get_info_ (int* comm, int* info, int* ierr){
+ MPI_Info tmp;
+ *ierr = MPI_Comm_get_info (smpi_comm_f2c(*comm), &tmp);
+ if(*ierr==MPI_SUCCESS){
+ *info = smpi_info_c2f(tmp);
+ }
+}
+
+
+void mpi_comm_create_errhandler_ ( void *function, void *errhandler, int* ierr){
+ *ierr = MPI_Comm_create_errhandler( (MPI_Comm_errhandler_fn*) function, (MPI_Errhandler*)errhandler);
+}
+
+void mpi_add_error_class_ ( int *errorclass, int* ierr){
+ *ierr = MPI_Add_error_class( errorclass);
+}
+
+void mpi_add_error_code_ ( int* errorclass, int *errorcode, int* ierr){
+ *ierr = MPI_Add_error_code(*errorclass, errorcode);
+}
+
+void mpi_add_error_string_ ( int* errorcode, char *string, int* ierr){
+ *ierr = MPI_Add_error_string(*errorcode, string);
+}
+
+void mpi_comm_call_errhandler_ (int* comm,int* errorcode, int* ierr){
+ *ierr = MPI_Comm_call_errhandler(smpi_comm_f2c(*comm), *errorcode);
+}
+
+void mpi_info_dup_ (int* info, int* newinfo, int* ierr){
+ MPI_Info tmp;
+ *ierr = MPI_Info_dup(smpi_info_f2c(*info), &tmp);
+ if(*ierr==MPI_SUCCESS){
+ *newinfo= smpi_info_c2f(tmp);
+ }
+}
+
+void mpi_info_get_valuelen_ ( int* info, char *key, int *valuelen, int *flag, int* ierr, unsigned int keylen){
+ while(key[keylen-1]==' ')keylen--;
+ while(*key==' '){//handle leading blanks
+ keylen --;
+ key++;
+ }
+ char* tkey = xbt_malloc((keylen+1)*sizeof(char));
+ strncpy(tkey, key, keylen);
+ tkey[keylen]='\0';
+ *ierr = MPI_Info_get_valuelen( smpi_info_f2c(*info), tkey, valuelen, flag);
+ xbt_free(tkey);
+}
+
+void mpi_info_delete_ (int* info, char *key, int* ierr, unsigned int keylen){
+ while(key[keylen-1]==' ')keylen--;
+ while(*key==' '){//handle leading blanks
+ keylen --;
+ key++;
+ }
+ char* tkey = xbt_malloc((keylen+1)*sizeof(char));
+ strncpy(tkey, key, keylen);
+ tkey[keylen]='\0';
+ *ierr = MPI_Info_delete(smpi_info_f2c(*info), tkey);
+ xbt_free(tkey);
+}
+
+void mpi_info_get_nkeys_ ( int* info, int *nkeys, int* ierr){
+ *ierr = MPI_Info_get_nkeys( smpi_info_f2c(*info), nkeys);
+}
+
+void mpi_info_get_nthkey_ ( int* info, int* n, char *key, int* ierr, unsigned int keylen){
+ *ierr = MPI_Info_get_nthkey( smpi_info_f2c(*info), *n, key);
+ int i = 0;
+ for (i=strlen(key); i<keylen; i++)
+ key[i]=' ';
+}
+
+void mpi_get_version_ (int *version,int *subversion, int* ierr){
+ *ierr = MPI_Get_version (version,subversion);
+}
+
+void mpi_get_library_version_ (char *version,int *len, int* ierr){
+ *ierr = MPI_Get_library_version (version,len);
+}
+
+void mpi_request_get_status_ ( int* request, int *flag, MPI_Status* status, int* ierr){
+ *ierr = MPI_Request_get_status( smpi_request_f2c(*request), flag, status);
+}
+
+void mpi_grequest_start_ ( void *query_fn, void *free_fn, void *cancel_fn, void *extra_state, int*request, int* ierr){
+ MPI_Request tmp;
+ *ierr = MPI_Grequest_start( (MPI_Grequest_query_function*)query_fn, (MPI_Grequest_free_function*)free_fn, (MPI_Grequest_cancel_function*)cancel_fn, extra_state, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *request = smpi_request_c2f(tmp);
+ }
+}
+
+void mpi_grequest_complete_ ( int* request, int* ierr){
+ *ierr = MPI_Grequest_complete( smpi_request_f2c(*request));
+}
+
+void mpi_status_set_cancelled_ (MPI_Status* status,int* flag, int* ierr){
+ *ierr = MPI_Status_set_cancelled(status,*flag);
+}
+
+void mpi_status_set_elements_ ( MPI_Status* status, int* datatype, int* count, int* ierr){
+ *ierr = MPI_Status_set_elements( status, smpi_type_f2c(*datatype), *count);
+}
+
+void mpi_comm_connect_ ( char *port_name, int* info, int* root, int* comm, int*newcomm, int* ierr){
+ MPI_Comm tmp;
+ *ierr = MPI_Comm_connect( port_name, *(MPI_Info*)info, *root, smpi_comm_f2c(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newcomm = smpi_comm_c2f(tmp);
+ }
+}
+
+void mpi_publish_name_ ( char *service_name, int* info, char *port_name, int* ierr){
+ *ierr = MPI_Publish_name( service_name, *(MPI_Info*)info, port_name);
+}
+
+void mpi_unpublish_name_ ( char *service_name, int* info, char *port_name, int* ierr){
+ *ierr = MPI_Unpublish_name( service_name, *(MPI_Info*)info, port_name);
+}
+
+void mpi_lookup_name_ ( char *service_name, int* info, char *port_name, int* ierr){
+ *ierr = MPI_Lookup_name( service_name, *(MPI_Info*)info, port_name);
+}
+
+void mpi_comm_join_ ( int* fd, int* intercomm, int* ierr){
+ MPI_Comm tmp;
+ *ierr = MPI_Comm_join( *fd, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *intercomm = smpi_comm_c2f(tmp);
+ }
+}
+
+void mpi_open_port_ ( int* info, char *port_name, int* ierr){
+ *ierr = MPI_Open_port( *(MPI_Info*)info,port_name);
+}
+
+void mpi_close_port_ ( char *port_name, int* ierr){
+ *ierr = MPI_Close_port( port_name);
+}
+
+void mpi_comm_accept_ ( char *port_name, int* info, int* root, int* comm, int*newcomm, int* ierr){
+ MPI_Comm tmp;
+ *ierr = MPI_Comm_accept( port_name, *(MPI_Info*)info, *root, smpi_comm_f2c(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newcomm = smpi_comm_c2f(tmp);
+ }
+}
+
+void mpi_comm_spawn_ ( char *command, char *argv, int* maxprocs, int* info, int* root, int* comm, int* intercomm, int* array_of_errcodes, int* ierr){
+ MPI_Comm tmp;
+ *ierr = MPI_Comm_spawn( command, NULL, *maxprocs, *(MPI_Info*)info, *root, smpi_comm_f2c(*comm), &tmp, array_of_errcodes);
+ if(*ierr == MPI_SUCCESS) {
+ *intercomm = smpi_comm_c2f(tmp);
+ }
+}
+
+void mpi_comm_spawn_multiple_ ( int* count, char *array_of_commands, char** array_of_argv, int* array_of_maxprocs, int* array_of_info, int* root,
+ int* comm, int* intercomm, int* array_of_errcodes, int* ierr){
+ MPI_Comm tmp;
+ *ierr = MPI_Comm_spawn_multiple(* count, &array_of_commands, &array_of_argv, array_of_maxprocs,
+ (MPI_Info*)array_of_info, *root, smpi_comm_f2c(*comm), &tmp, array_of_errcodes);
+ if(*ierr == MPI_SUCCESS) {
+ *intercomm = smpi_comm_c2f(tmp);
+ }
+}
+
+void mpi_comm_get_parent_ ( int* parent, int* ierr){
+ MPI_Comm tmp;
+ *ierr = MPI_Comm_get_parent( &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *parent = smpi_comm_c2f(tmp);
+ }
+}
+