void ompi_ireduce_f(char *sendbuf, char *recvbuf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *root, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { int c_ierr; MPI_Datatype c_type; MPI_Request c_request; MPI_Op c_op; MPI_Comm c_comm; c_type = MPI_Type_f2c(*datatype); c_op = MPI_Op_f2c(*op); c_comm = MPI_Comm_f2c(*comm); sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); c_ierr = MPI_Ireduce(sendbuf, recvbuf, OMPI_FINT_2_INT(*count), c_type, c_op, OMPI_FINT_2_INT(*root), c_comm, &c_request); if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); if (MPI_SUCCESS == c_ierr) *request = MPI_Request_c2f(c_request); }
void ompi_ialltoall_f(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { int c_ierr; MPI_Comm c_comm; MPI_Request c_req; MPI_Datatype c_sendtype, c_recvtype; c_comm = MPI_Comm_f2c(*comm); c_sendtype = MPI_Type_f2c(*sendtype); c_recvtype = MPI_Type_f2c(*recvtype); sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); c_ierr = MPI_Ialltoall(sendbuf, OMPI_FINT_2_INT(*sendcount), c_sendtype, recvbuf, OMPI_FINT_2_INT(*recvcount), c_recvtype, c_comm, &c_req); if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); if (MPI_SUCCESS == c_ierr) *request = MPI_Request_c2f(c_req); }
__FRET__ __FFNAME__(__FPARAMS__) { double tstart, tstop; #if HAVE_CREQ /* HAVE _CREQ */ MPI_Request creq; #endif #if HAVE_CSTAT /* HAVE _CSTAT */ MPI_Status cstat; #endif #if HAVE_CCOMM_OUT MPI_Comm ccomm_out; #endif /* HAVE _CCOMM_OUT */ #if HAVE_CCOMM_INOUT MPI_Comm ccomm_inout; #endif /* HAVE _CCOMM_INOUT */ #if HAVE_CCOMM_INOUT ccomm_inout = MPI_Comm_f2c(*comm_inout); #endif #if HAVE_CGROUP_OUT /* HAVE _CGROUP_OUT */ MPI_Group cgroup_out; #endif IPM_TIMESTAMP(tstart); p__FFNAME__(__FARGS__); IPM_TIMESTAMP(tstop); if( ipm_state!=STATE_ACTIVE ) { return; } #if HAVE_CSTAT /* HAVE_CSTAT */ if (*info==MPI_SUCCESS) MPI_Status_c2f(&cstat, status); #endif #if HAVE_CREQ /* HAVE_CREQ */ if( *info==MPI_SUCCESS ) *req=MPI_Request_c2f(creq); #endif #if HAVE_CCOMM_OUT /* HAVE _CCOMM_OUT */ if( *info==MPI_SUCCESS ) *comm_out=MPI_Comm_c2f(ccomm_out); #endif #if HAVE_CCOMM_INOUT /* HAVE _CCOMM_INOUT */ if( *info==MPI_SUCCESS ) *comm_inout=MPI_Comm_c2f(ccomm_inout); #endif #if HAVE_CGROUP_OUT /* HAVE _CGROUP_OUT */ if( *info==MPI_SUCCESS ) *group_out=MPI_Group_c2f(cgroup_out); #endif IPM___CFNAME__(__F2CARGS__, tstart, tstop); }
void ompi_igatherv_f(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs, MPI_Fint *recvtype, MPI_Fint *root, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { MPI_Comm c_comm; MPI_Datatype c_sendtype, c_recvtype; MPI_Request c_request; int size, c_ierr; OMPI_ARRAY_NAME_DECL(recvcounts); OMPI_ARRAY_NAME_DECL(displs); c_comm = MPI_Comm_f2c(*comm); c_sendtype = MPI_Type_f2c(*sendtype); c_recvtype = MPI_Type_f2c(*recvtype); MPI_Comm_size(c_comm, &size); OMPI_ARRAY_FINT_2_INT(recvcounts, size); OMPI_ARRAY_FINT_2_INT(displs, size); sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); c_ierr = MPI_Igatherv(sendbuf, OMPI_FINT_2_INT(*sendcount), c_sendtype, recvbuf, OMPI_ARRAY_NAME_CONVERT(recvcounts), OMPI_ARRAY_NAME_CONVERT(displs), c_recvtype, OMPI_FINT_2_INT(*root), c_comm, &c_request); if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); if (MPI_SUCCESS == c_ierr) *request = MPI_Request_c2f(c_request); }
void ompi_ineighbor_allgather_f(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { int ierr_c; MPI_Comm c_comm; MPI_Request c_req; MPI_Datatype c_sendtype, c_recvtype; c_comm = MPI_Comm_f2c(*comm); c_sendtype = MPI_Type_f2c(*sendtype); c_recvtype = MPI_Type_f2c(*recvtype); sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); ierr_c = MPI_Ineighbor_allgather(sendbuf, OMPI_FINT_2_INT(*sendcount), c_sendtype, recvbuf, OMPI_FINT_2_INT(*recvcount), c_recvtype, c_comm, &c_req); if (NULL != ierr) *ierr = OMPI_INT_2_FINT(ierr_c); if (MPI_SUCCESS == ierr_c) *request = MPI_Request_c2f(c_req); }
void ompi_ireduce_scatter_f(char *sendbuf, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { int c_ierr; MPI_Comm c_comm; MPI_Datatype c_type; MPI_Request c_request; MPI_Op c_op; int size; OMPI_ARRAY_NAME_DECL(recvcounts); c_comm = MPI_Comm_f2c(*comm); c_type = MPI_Type_f2c(*datatype); c_op = MPI_Op_f2c(*op); MPI_Comm_size(c_comm, &size); OMPI_ARRAY_FINT_2_INT(recvcounts, size); sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); c_ierr = MPI_Ireduce_scatter(sendbuf, recvbuf, OMPI_ARRAY_NAME_CONVERT(recvcounts), c_type, c_op, c_comm, &c_request); if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); if (MPI_SUCCESS == c_ierr) *request = MPI_Request_c2f(c_request); }
void f2crequest_( MPI_Fint * req ) { MPI_Request cReq; MPI_Irecv( NULL, 0, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &cReq ); MPI_Cancel( &cReq ); *req = MPI_Request_c2f( cReq ); }
void mpi_irecv (void *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *__ierr) { MPI_Request lrequest; *__ierr = MPI_Irecv (buf, (int)*count, MPI_Type_f2c (*datatype), (int)*source,(int)*tag, MPI_Comm_f2c(*comm),&lrequest); *request = MPI_Request_c2f (lrequest); }
void mpi_issend (void *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *__ierr) { MPI_Request lrequest; *__ierr = MPI_Issend (buf, (int) *count, MPI_Type_f2c (*datatype), (int) *dest, (int) *tag, MPI_Comm_f2c (*comm), &lrequest); *request = MPI_Request_c2f (lrequest); }
int main( int argc, char *argv[] ) { MPI_Fint handleA, handleB; int rc; int errs = 0; int buf[1]; MPI_Request cRequest; MPI_Status st; int tFlag; MTest_Init( &argc, &argv ); /* Request */ rc = MPI_Irecv( buf, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &cRequest ); if (rc) { errs++; printf( "Unable to create request\n" ); } else { handleA = MPI_Request_c2f( cRequest ); handleB = MPI_Request_c2f( cRequest ); if (handleA != handleB) { errs++; printf( "MPI_Request_c2f does not give the same handle twice on the same MPI_Request\n" ); } } MPI_Cancel( &cRequest ); MPI_Test( &cRequest, &tFlag, &st ); MPI_Test_cancelled( &st, &tFlag ); if (!tFlag) { errs++; printf( "Unable to cancel MPI_Irecv request\n" ); } /* Using MPI_Request_free should be ok, but some MPI implementations object to it imediately after the cancel and that isn't essential to this test */ MTest_Finalize( errs ); MPI_Finalize(); return 0; }
void mpif_recv_init_ (void*buffer, int*count, MPI_Fint*type, int*src, int*tag, MPI_Fint*comm, MPI_Fint *req, int*error) { MPI_Datatype c_type = MPI_Type_f2c(*type); MPI_Comm c_comm = MPI_Comm_f2c(*comm); MPI_Request c_req = MPI_Request_f2c(*req); *error = MPI_Recv_init_core(buffer, *count, c_type, *src, *tag, c_comm, &c_req); *req = MPI_Request_c2f(c_req); MPI_Recv_init_epilog(buffer, *count, c_type, *src, *tag, c_comm, req); }
void mpi_wait (MPI_Fint *request, MPI_Fint *status, MPI_Fint *__ierr) { MPI_Request lrequest; MPI_Status c_status; lrequest = MPI_Request_f2c (*request); *__ierr = MPI_Wait (&lrequest, &c_status); *request = MPI_Request_c2f (lrequest); MPI_Status_c2f (&c_status, status); }
FORTRAN_API void FORT_CALL mpi_wait_ ( MPI_Fint *request, MPI_Fint *status, MPI_Fint *__ierr ) { MPI_Request lrequest; MPI_Status c_status; lrequest = MPI_Request_f2c(*request); *__ierr = MPI_Wait(&lrequest, &c_status); *request = MPI_Request_c2f(lrequest); if (*__ierr == MPI_SUCCESS) MPI_Status_c2f(&c_status, status); }
void mpi_file_iwrite_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *request, MPI_Fint *ierr) { MPI_File c_fh = MPI_File_f2c(*fh); MPI_Datatype c_type = MPI_Type_f2c(*datatype); MPI_Request c_request; *ierr = OMPI_INT_2_FINT(MPI_File_iwrite(c_fh, OMPI_F2C_BOTTOM(buf), OMPI_FINT_2_INT(*count), c_type, &c_request)); if (MPI_SUCCESS == OMPI_FINT_2_INT(*ierr)) { *request = MPI_Request_c2f(c_request); } }
void ompi_file_iwrite_all_f(MPI_Fint *fh, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *request, MPI_Fint *ierr) { int c_ierr; MPI_File c_fh = MPI_File_f2c(*fh); MPI_Datatype c_type = MPI_Type_f2c(*datatype); MPI_Request c_request; c_ierr = MPI_File_iwrite_all(c_fh, OMPI_F2C_BOTTOM(buf), OMPI_FINT_2_INT(*count), c_type, &c_request); if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); if (MPI_SUCCESS == c_ierr) { *request = MPI_Request_c2f(c_request); } }
void mpi_issend_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { MPI_Datatype c_type = MPI_Type_f2c(*datatype); MPI_Request c_req; MPI_Comm c_comm; c_comm = MPI_Comm_f2c (*comm); *ierr = OMPI_INT_2_FINT(MPI_Issend(OMPI_F2C_BOTTOM(buf), OMPI_FINT_2_INT(*count), c_type, OMPI_FINT_2_INT(*dest), OMPI_FINT_2_INT(*tag), c_comm, &c_req)); if (MPI_SUCCESS == OMPI_FINT_2_INT(*ierr)) { *request = MPI_Request_c2f(c_req); } }
MPI_Fint c2frequest_ ( MPI_Fint *request ) { MPI_Request req = MPI_Request_f2c( *request ); MPI_Status status; int flag; MPI_Test( &req, &flag, &status ); MPI_Test_cancelled( &status, &flag ); if (!flag) { fprintf( stderr, "Request: Wrong value for flag\n" ); return 1; } else { *request = MPI_Request_c2f( req ); } return 0; }
FORTRAN_API void FORT_CALL mpi_waitall_(MPI_Fint *count, MPI_Fint array_of_requests[], MPI_Fint array_of_statuses[][MPI_STATUS_SIZE], MPI_Fint *__ierr ) { int i; MPI_Request *lrequest = 0; MPI_Request local_lrequest[MPIR_USE_LOCAL_ARRAY]; MPI_Status *c_status = 0; MPI_Status local_c_status[MPIR_USE_LOCAL_ARRAY]; if ((int)*count > 0) { if ((int)*count > MPIR_USE_LOCAL_ARRAY) { MPIR_FALLOC(lrequest,(MPI_Request*)MALLOC(sizeof(MPI_Request) * (int)*count), MPIR_COMM_WORLD, MPI_ERR_EXHAUSTED, "MPI_WAITALL" ); MPIR_FALLOC(c_status,(MPI_Status*)MALLOC(sizeof(MPI_Status) * (int)*count), MPIR_COMM_WORLD, MPI_ERR_EXHAUSTED, "MPI_WAITALL" ); } else { lrequest = local_lrequest; c_status = local_c_status; } for (i=0; i<(int)*count; i++) { lrequest[i] = MPI_Request_f2c( array_of_requests[i] ); } *__ierr = MPI_Waitall((int)*count,lrequest,c_status); /* By checking for lrequest[i] = 0, we handle persistant requests */ for (i=0; i<(int)*count; i++) { array_of_requests[i] = MPI_Request_c2f( lrequest[i] ); } } else *__ierr = MPI_Waitall((int)*count,(MPI_Request *)0, c_status ); if (*__ierr == MPI_SUCCESS) for (i=0; i<(int)*count; i++) MPI_Status_c2f(&(c_status[i]), &(array_of_statuses[i][0]) ); if ((int)*count > MPIR_USE_LOCAL_ARRAY) { FREE( lrequest ); FREE( c_status ); } }
/* ** mpi_waitall was simplified from the FPMPI version. ** This one has a hard limit of LOCAL_ARRAY_SIZE requests. ** If this limit is exceeded, MPI_Abort is called. There is probably ** a better solution. */ void mpi_waitall (MPI_Fint *count, MPI_Fint array_of_requests[], MPI_Fint array_of_statuses[][MPI_STATUS_SIZE], MPI_Fint *__ierr) { const int LOCAL_ARRAY_SIZE = 128; int i; MPI_Request lrequest[LOCAL_ARRAY_SIZE]; MPI_Status c_status[LOCAL_ARRAY_SIZE]; static const char *thisfunc = "GPTL's mpi_waitall"; if (MPI_STATUS_SIZE != sizeof(MPI_Status)/sizeof(int)) { /* Warning - */ fprintf (stderr, "%s ERROR: mpi_waitall expected sizeof MPI_Status\n" "to be %d integers but it is %d. Rebuild GPTL after ensuring that the\n" "correct value is found and set in macros.make\n", thisfunc, MPI_STATUS_SIZE, (int) (sizeof(MPI_Status)/sizeof(int)) ); fprintf (stderr, "Aborting...\n"); (void) MPI_Abort (MPI_COMM_WORLD, -1); } /* fpmpi does mallocs. Instead used fixed array sizes and Abort if too many */ if ((int) *count > LOCAL_ARRAY_SIZE) { fprintf (stderr, "mpi_waitall: %d is too many requests: recompile f_wrappers_pmpi.c " "with LOCAL_ARRAY_SIZE > %d\n", (int)*count, LOCAL_ARRAY_SIZE); fprintf (stderr, "Aborting...\n"); (void) MPI_Abort (MPI_COMM_WORLD, -1); } if ((int) *count > 0) { for (i = 0; i < (int) *count; i++) { lrequest[i] = MPI_Request_f2c (array_of_requests[i]); } *__ierr = MPI_Waitall ((int)*count, lrequest, c_status); /* By checking for lrequest[i] = 0, we handle persistent requests */ for (i = 0; i < (int)*count; i++) { array_of_requests[i] = MPI_Request_c2f (lrequest[i]); } } else { *__ierr = MPI_Waitall ((int)*count, (MPI_Request *)0, c_status); } for (i = 0; i < (int)*count; i++) MPI_Status_c2f (&(c_status[i]), &(array_of_statuses[i][0])); }
EXPORT_MPI_API void FORTRAN_API mpi_request_free_( MPI_Fint *request, MPI_Fint *__ierr ) { MPI_Request lrequest = MPI_Request_f2c(*request); *__ierr = MPI_Request_free( &lrequest ); #ifdef OLD_POINTER /* We actually need to remove the pointer from the mapping if the ref count is zero. We do that by checking to see if lrequest was set to NULL. */ if (!lrequest) { MPIR_RmPointer( *(int*)request ); *(int*)request = 0; } #endif *request = MPI_Request_c2f(lrequest); }
void ompi_irsend_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { int c_ierr; MPI_Datatype c_type = MPI_Type_f2c(*datatype); MPI_Request c_req; MPI_Comm c_comm; c_comm = MPI_Comm_f2c (*comm); c_ierr = MPI_Irsend(OMPI_F2C_BOTTOM(buf), OMPI_FINT_2_INT(*count), c_type, OMPI_FINT_2_INT(*dest), OMPI_FINT_2_INT(*tag), c_comm, &c_req); if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); if (MPI_SUCCESS == c_ierr) { *request = MPI_Request_c2f(c_req); } }
void mpi_test (MPI_Fint *request, MPI_Fint *flag, MPI_Fint *status, MPI_Fint *__ierr ) { int l_flag; MPI_Status c_status; MPI_Request lrequest = MPI_Request_f2c (*request); *__ierr = MPI_Test (&lrequest, &l_flag, &c_status); *request = MPI_Request_c2f (lrequest); /* In case request is changed */ /* ** The following setting ASSUMES that the C value for l_flag (0=false, non-zero=true) ** maps properly to a Fortran logical. Have tested gfortran, Cray, Intel, PGI, ** Pathscale and found this to be valid in all cases. */ *flag = (MPI_Fint) l_flag; if (l_flag) { MPI_Status_c2f (&c_status, status); } }
void ompi_imrecv_f(char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *message, MPI_Fint *request, MPI_Fint *ierr) { int c_ierr; MPI_Datatype c_type = MPI_Type_f2c(*datatype); MPI_Request c_req; MPI_Message c_message; c_message = MPI_Message_f2c(*message); c_ierr = OMPI_INT_2_FINT(MPI_Imrecv(OMPI_F2C_BOTTOM(buf), OMPI_FINT_2_INT(*count), c_type, &c_message, &c_req)); if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); if (MPI_SUCCESS == c_ierr) { *request = MPI_Request_c2f(c_req); /* message is an INOUT, and may be updated by the recv */ *message = MPI_Message_c2f(c_message); } }
FRET FFNAME(FPARAMS) { #if HAVE_CREQ /* HAVE _CREQ */ MPI_Request creq; #endif #if HAVE_CSTAT /* HAVE _CSTAT */ MPI_Status cstat; #endif *info=CFNAME(F2CARGS); #if HAVE_CSTAT /* HAVE _CSTAT */ if (*info==MPI_SUCCESS) MPI_Status_c2f(&cstat, status); #endif #if HAVE_CREQ /* HAVE _CREQ */ if( *info==MPI_SUCCESS ) *req=MPI_Request_c2f(creq); #endif }
void mpi_startall_f(MPI_Fint *count, MPI_Fint *array_of_requests, MPI_Fint *ierr) { MPI_Request *c_req; int i; c_req = malloc(*count * sizeof(MPI_Request)); if (NULL == c_req) { *ierr = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM, FUNC_NAME); return; } for(i = 0; i < *count; i++ ) { c_req[i] = MPI_Request_f2c(array_of_requests[i]); } *ierr = OMPI_INT_2_FINT(MPI_Startall(OMPI_FINT_2_INT(*count), c_req)); for( i = 0; i < *count; i++ ) { array_of_requests[i] = MPI_Request_c2f(c_req[i]); } free(c_req); }
FORTRAN_API void FORT_CALL mpi_waitsome_( MPI_Fint *incount, MPI_Fint array_of_requests[], MPI_Fint *outcount, MPI_Fint array_of_indices[], MPI_Fint array_of_statuses[][MPI_STATUS_SIZE], MPI_Fint *__ierr ) { int i,j,found; int loutcount; int *l_indices = 0; int local_l_indices[MPIR_USE_LOCAL_ARRAY]; MPI_Request *lrequest = 0; MPI_Request local_lrequest[MPIR_USE_LOCAL_ARRAY]; MPI_Status * c_status = 0; MPI_Status local_c_status[MPIR_USE_LOCAL_ARRAY]; if ((int)*incount > 0) { if ((int)*incount > MPIR_USE_LOCAL_ARRAY) { MPIR_FALLOC(lrequest,(MPI_Request*)MALLOC(sizeof(MPI_Request)* (int)*incount), MPIR_COMM_WORLD, MPI_ERR_EXHAUSTED, "MPI_WAITSOME" ); MPIR_FALLOC(l_indices,(int*)MALLOC(sizeof(int)* (int)*incount), MPIR_COMM_WORLD, MPI_ERR_EXHAUSTED, "MPI_WAITSOME" ); MPIR_FALLOC(c_status,(MPI_Status*)MALLOC(sizeof(MPI_Status)* (int)*incount), MPIR_COMM_WORLD, MPI_ERR_EXHAUSTED, "MPI_WAITSOME" ); } else { lrequest = local_lrequest; l_indices = local_l_indices; c_status = local_c_status; } for (i=0; i<(int)*incount; i++) lrequest[i] = MPI_Request_f2c( array_of_requests[i] ); *__ierr = MPI_Waitsome((int)*incount,lrequest,&loutcount,l_indices, c_status); /* By checking for lrequest[l_indices[i]] = 0, we handle persistant requests */ for (i=0; i<(int)*incount; i++) { if ( i < loutcount) { if (l_indices[i] >= 0) { array_of_requests[l_indices[i]] = MPI_Request_c2f( lrequest[l_indices[i]] ); } } else { found = 0; j = 0; while ( (!found) && (j<loutcount) ) { if (l_indices[j++] == i) found = 1; } if (!found) array_of_requests[i] = MPI_Request_c2f( lrequest[i] ); } } } else *__ierr = MPI_Waitsome( (int)*incount, (MPI_Request *)0, &loutcount, l_indices, c_status ); if (*__ierr != MPI_SUCCESS) return; for (i=0; i<loutcount; i++) { MPI_Status_c2f( &c_status[i], &(array_of_statuses[i][0]) ); if (l_indices[i] >= 0) array_of_indices[i] = l_indices[i] + 1; } *outcount = (MPI_Fint)loutcount; if ((int)*incount > MPIR_USE_LOCAL_ARRAY) { FREE( l_indices ); FREE( lrequest ); FREE( c_status ); } }
va_start(ap, unknown); buf = unknown; if (_numargs() == NUMPARAMS+1) { buflen = va_arg(ap, int) /8; /* This is in bits. */ } count = va_arg (ap, int *); datatype = va_arg(ap, MPI_Datatype*); source = va_arg(ap, int *); tag = va_arg(ap, int *); comm = va_arg(ap, MPI_Comm*); request = va_arg(ap, MPI_Request *); __ierr = va_arg(ap, int *); *__ierr = MPI_Irecv(MPIR_F_PTR(buf),*count,*datatype,*source,*tag,*comm, &lrequest); *(int*)request = MPI_Request_c2f(lrequest); } #else void mpi_irecv_( buf, count, datatype, source, tag, comm, request, __ierr ) void *buf; int*count; MPI_Datatype * datatype; int*source; int*tag; MPI_Comm *comm; MPI_Request *request; int *__ierr; { MPI_Request lrequest; _fcd temp;
EXPORT_MPI_API void FORTRAN_API mpi_start_( MPI_Fint *request, MPI_Fint *__ierr ) { MPI_Request lrequest = MPI_Request_f2c(*request ); *__ierr = MPI_Start( &lrequest ); *request = MPI_Request_c2f(lrequest); }