-: 0:Source:/home/MPI/testing/mpich2/mpich2/src/mpid/common/datatype/mpid_contents_support.c
-: 0:Graph:mpid_contents_support.gcno
-: 0:Data:mpid_contents_support.gcda
-: 0:Runs:4381
-: 0:Programs:1376
-: 1:/* -*- Mode: C; c-basic-offset:4 ; -*- */
-: 2:
-: 3:/*
-: 4: * (C) 2001 by Argonne National Laboratory.
-: 5: * See COPYRIGHT in top-level directory.
-: 6: */
-: 7:
-: 8:#include <mpi.h>
-: 9:#include <mpid_datatype.h>
-: 10:
-: 11:void MPID_Type_access_contents(MPI_Datatype type,
-: 12: int **ints_p,
-: 13: MPI_Aint **aints_p,
-: 14: MPI_Datatype **types_p)
124080: 15:{
-: 16: int nr_ints, nr_aints, nr_types, combiner;
124080: 17: int types_sz, struct_sz, ints_sz, epsilon, align_sz = 8;
-: 18: MPID_Datatype *dtp;
-: 19: MPID_Datatype_contents *cp;
-: 20:
124080: 21: NMPI_Type_get_envelope(type, &nr_ints, &nr_aints, &nr_types, &combiner);
124080: 22: DLOOP_Assert(combiner != MPI_COMBINER_NAMED);
-: 23:
-: 24: /* hardcoded handling of MPICH2 contents format... */
124080: 25: MPID_Datatype_get_ptr(type, dtp);
124080: 26: DLOOP_Assert(dtp != NULL);
-: 27:
124080: 28: cp = dtp->contents;
124080: 29: DLOOP_Assert(cp != NULL);
-: 30:
-: 31:#ifdef HAVE_MAX_STRUCT_ALIGNMENT
124080: 32: if (align_sz > HAVE_MAX_STRUCT_ALIGNMENT) {
124080: 33: align_sz = HAVE_MAX_STRUCT_ALIGNMENT;
-: 34: }
-: 35:#endif
-: 36:
124080: 37: struct_sz = sizeof(MPID_Datatype_contents);
124080: 38: types_sz = nr_types * sizeof(MPI_Datatype);
124080: 39: ints_sz = nr_ints * sizeof(int);
-: 40:
124080: 41: if ((epsilon = struct_sz % align_sz)) {
|
124080: 50: *types_p = (MPI_Datatype *) (((char *) cp) + struct_sz);
124080: 51: *ints_p = (int *) (((char *) (*types_p)) + types_sz);
124080: 52: *aints_p = (MPI_Aint *) (((char *) (*ints_p)) + ints_sz);
-: 53: /* end of hardcoded handling of MPICH2 contents format */
-: 54:
-: 55: return;
-: 56:}
-: 57:
-: 58:/* FIXME: Is this routine complete? Why is it needed? If it is needed, it
-: 59: must have a comment that describes why it is needed and the arguments
-: 60: must have ATTRIBUTE((unused)) */
-: 61:void MPID_Type_release_contents(MPI_Datatype type,
-: 62: int **ints_p,
-: 63: MPI_Aint **aints_p,
-: 64: MPI_Datatype **types_p)
124080: 65:{
-: 66: return;
-: 67:}
-: 68:
|