void mpi_request_get_status_f(MPI_Fint *request, ompi_fortran_logical_t *flag,
                              MPI_Fint *status, MPI_Fint *ierr)
{
    MPI_Status c_status;
    MPI_Request c_req = MPI_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);
        *ierr = OMPI_INT_2_FINT(MPI_SUCCESS);
    } else {
        *ierr = OMPI_INT_2_FINT(MPI_Request_get_status(c_req, 
                                                       OMPI_LOGICAL_SINGLE_NAME_CONVERT(flag),
                                                       &c_status));
        OMPI_SINGLE_INT_2_LOGICAL(flag);
        MPI_Status_c2f( &c_status, status );
    }
}
Esempio n. 2
0
void ompi_test_cancelled_f(MPI_Fint *status, ompi_fortran_logical_t *flag, MPI_Fint *ierr)
{
    int c_ierr;
    MPI_Status c_status;
    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_Status_f2c( status, &c_status );

        if (MPI_SUCCESS == c_ierr) {
            c_ierr = PMPI_Test_cancelled(&c_status,
                                        OMPI_LOGICAL_SINGLE_NAME_CONVERT(flag));

            OMPI_SINGLE_INT_2_LOGICAL(flag);
        }
    }
    if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
}