Exemplo n.º 1
0
void ompi_type_create_f90_real_f(MPI_Fint *p, MPI_Fint *r,
				MPI_Fint *newtype, MPI_Fint *ierr)
{
    int c_ierr;
    MPI_Datatype c_new = MPI_Type_f2c(*newtype);

    c_ierr = MPI_Type_create_f90_real(OMPI_FINT_2_INT(*p),
                                      OMPI_FINT_2_INT(*r),
                                      &c_new);
    if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);

    if (MPI_SUCCESS == c_ierr) {
        *newtype = MPI_Type_c2f(c_new);
    }
}
Exemplo n.º 2
0
int main(int argc, char *argv[])
{
    int p, r;
    int errs = 0;
    int err;
    int i, j, nLoop = 1;
    MPI_Datatype newtype;

    MTest_Init(0, 0);

    if (argc > 1) {
        nLoop = atoi(argv[1]);
    }
    /* Set the handler to errors return, since according to the
     * standard, it is invalid to provide p and/or r that are unsupported */

    MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);

    for (i = 0; i < nLoop; i++) {

        /* These should be a valid type similar to MPI_REAL and MPI_REAL8 */
        for (j = 0; j < 6; j++) {
            p = cases[j][0];
            r = cases[j][1];
            err = MPI_Type_create_f90_real(p, r, &newtype);
            errs += checkType("REAL", p, r, MPI_COMBINER_F90_REAL, err, newtype);
        }

        /* These should be a valid type similar to MPI_COMPLEX and MPI_COMPLEX8 */
        for (j = 0; j < 6; j++) {
            p = cases[j][0];
            r = cases[j][1];
            err = MPI_Type_create_f90_complex(p, r, &newtype);
            errs += checkType("COMPLEX", p, r, MPI_COMBINER_F90_COMPLEX, err, newtype);
        }

        /* This should be a valid type similar to MPI_INTEGER */
        p = 3;
        r = 10;
        err = MPI_Type_create_f90_integer(p, &newtype);
        errs += checkType("INTEGER", p, r, MPI_COMBINER_F90_INTEGER, err, newtype);
    }

    MTest_Finalize(errs);
    MPI_Finalize();
    return 0;
}
Exemplo n.º 3
0
FORT_DLL_SPEC void FORT_CALL mpi_type_create_f90_real_ ( MPI_Fint *v1, MPI_Fint *v2, MPI_Fint *v3, MPI_Fint *ierr ){
    *ierr = MPI_Type_create_f90_real( (int)*v1, (int)*v2, (MPI_Datatype *)(v3) );
}