コード例 #1
0
ファイル: grequest_complete_f.c プロジェクト: 00datman/ompi
void ompi_grequest_complete_f(MPI_Fint *request, MPI_Fint *ierr)
{
    int c_ierr;
    MPI_Request c_req = PMPI_Request_f2c(*request);

    c_ierr = PMPI_Grequest_complete(c_req);
    if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
}
コード例 #2
0
ファイル: request_free_f.c プロジェクト: 00datman/ompi
void ompi_request_free_f(MPI_Fint *request, MPI_Fint *ierr)
{
    int c_ierr;

    MPI_Request c_req = PMPI_Request_f2c( *request );
    c_ierr = PMPI_Request_free(&c_req);
    if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);

    if (MPI_SUCCESS == c_ierr) {
        *request = OMPI_INT_2_FINT(MPI_REQUEST_NULL->req_f_to_c_index);
    }
}
コード例 #3
0
ファイル: waitany_f.c プロジェクト: 00datman/ompi
void ompi_waitany_f(MPI_Fint *count, MPI_Fint *array_of_requests,
		   MPI_Fint *indx, MPI_Fint *status, MPI_Fint *ierr)
{
    MPI_Request *c_req;
    MPI_Status c_status;
    int i, c_ierr;
    OMPI_SINGLE_NAME_DECL(indx);

    /* Shortcut to avoid malloc(0) if *count==0.  We're intentionally
       skipping other parameter error checks. */
    if (OPAL_UNLIKELY(0 == OMPI_FINT_2_INT(*count))) {
        *indx = OMPI_INT_2_FINT(MPI_UNDEFINED);
        PMPI_Status_c2f(&ompi_status_empty, status);
        *ierr = OMPI_INT_2_FINT(MPI_SUCCESS);
        return;
    }

    c_req = (MPI_Request *) malloc(OMPI_FINT_2_INT(*count) * sizeof(MPI_Request));
    if (NULL == c_req) {
        c_ierr = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM,
                                        FUNC_NAME);
        if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
        return;
    }

    for (i = 0; i < OMPI_FINT_2_INT(*count); ++i) {
        c_req[i] = PMPI_Request_f2c(array_of_requests[i]);
    }

    c_ierr = PMPI_Waitany(OMPI_FINT_2_INT(*count), c_req,
                         OMPI_SINGLE_NAME_CONVERT(indx),
                         &c_status);
    if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);

    if (MPI_SUCCESS == c_ierr) {

        /* Increment index by one for fortran conventions */

        OMPI_SINGLE_INT_2_FINT(indx);
        if (MPI_UNDEFINED != *(OMPI_SINGLE_NAME_CONVERT(indx))) {
            array_of_requests[OMPI_INT_2_FINT(*indx)] =
                c_req[OMPI_INT_2_FINT(*indx)]->req_f_to_c_index;
            ++(*indx);
        }
        if (!OMPI_IS_FORTRAN_STATUS_IGNORE(status)) {
            PMPI_Status_c2f(&c_status, status);
        }
    }
    free(c_req);
}
コード例 #4
0
ファイル: request_get_status_f.c プロジェクト: 00datman/ompi
void ompi_request_get_status_f(MPI_Fint *request, ompi_fortran_logical_t *flag,
                              MPI_Fint *status, MPI_Fint *ierr)
{
    int c_ierr;
    MPI_Status c_status;
    MPI_Request c_req = PMPI_Request_f2c( *request );
    OMPI_LOGICAL_NAME_DECL(flag);

    /* This seems silly, but someone will do it */

    if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) {
        *flag = OMPI_INT_2_LOGICAL(0);
        c_ierr = MPI_SUCCESS;
    } else {
        c_ierr = PMPI_Request_get_status(c_req,
                                        OMPI_LOGICAL_SINGLE_NAME_CONVERT(flag),
                                        &c_status);
        OMPI_SINGLE_INT_2_LOGICAL(flag);
        PMPI_Status_c2f( &c_status, status );
    }
    if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
}
コード例 #5
0
ファイル: smpi_mpi.c プロジェクト: FlorianPO/simgrid
MPI_Request MPI_Request_f2c(MPI_Fint request){
  return PMPI_Request_f2c(request);
}