Ejemplo n.º 1
0
int testtype(MPI_Datatype type, MPI_Offset expected) {
    MPI_Count size, lb, extent;
    int nerrors=0;
    MPI_Type_size_x(type, &size);

    if (size < 0)  {
	printf("ERROR: type size apparently overflowed integer\n");
	nerrors++;
    }

    if (size != expected) {
	printf("reported type size %lld does not match expected %lld\n",
		size, expected);
	nerrors++;
    }

    MPI_Type_get_true_extent_x(type, &lb, &extent);
    if (lb != 0) {
	printf("ERROR: type should have lb of 0, reported %lld\n", lb);
	nerrors ++;
    }

    if (extent != size) { 
	printf("ERROR: extent should match size, not %lld\n", extent);
	nerrors ++;
    }
    return nerrors;
}
void ompi_type_get_true_extent_x_f(MPI_Fint *datatype, MPI_Count *true_lb, MPI_Count *true_extent, MPI_Fint *ierr)
{
    int c_ierr;
    MPI_Datatype c_type = MPI_Type_f2c(*datatype);

    c_ierr = MPI_Type_get_true_extent_x(c_type, true_lb, true_extent);
    if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
}