485 int num_ints, num_adds, num_dtypes, combiner;
487 MPI_Type_get_envelope(
488 mpi_ddt, &num_ints, &num_adds, &num_dtypes, &combiner), Xt_default_comm);
489 MPI_Datatype oldtype[1];
503 "ERROR(mpi_ddt_2_xt_ddt_tree): unsupported combiner type",
508 case MPI_COMBINER_NAMED:
513 case MPI_COMBINER_DUP: {
516 MPI_Type_get_contents(
517 mpi_ddt, num_ints, num_adds, num_dtypes,
518 NULL, NULL, oldtype), Xt_default_comm);
524 case MPI_COMBINER_CONTIGUOUS: {
526 int array_of_ints[1];
529 MPI_Type_get_contents(
530 mpi_ddt, num_ints, num_adds, num_dtypes,
531 array_of_ints, NULL, oldtype), Xt_default_comm);
535 array_of_ints[0], oldtype[0]);
539 case MPI_COMBINER_VECTOR: {
541 int array_of_ints[3];
544 MPI_Type_get_contents(
545 mpi_ddt, num_ints, num_adds, num_dtypes,
546 array_of_ints, NULL, oldtype), Xt_default_comm);
550 extent, array_of_ints[0], array_of_ints[1], array_of_ints[2],
555 case MPI_COMBINER_HVECTOR: {
557 int array_of_ints[2];
558 MPI_Aint array_of_adds[1];
561 MPI_Type_get_contents(
562 mpi_ddt, num_ints, num_adds, num_dtypes,
563 array_of_ints, array_of_adds, oldtype), Xt_default_comm);
567 extent, array_of_ints[0], array_of_ints[1], array_of_adds[0],
571 case MPI_COMBINER_INDEXED:{
573 int *array_of_ints =
xmalloc((
size_t)num_ints *
sizeof(*array_of_ints));
576 MPI_Type_get_contents(
577 mpi_ddt, num_ints, num_adds, num_dtypes,
578 array_of_ints, NULL, oldtype), Xt_default_comm);
583 array_of_ints + 1, array_of_ints + 1 + 1 * array_of_ints[0],
590 case MPI_COMBINER_HINDEXED:{
592 MPI_Aint *array_of_adds =
593 xmalloc((
size_t)num_adds *
sizeof(*array_of_adds)
594 + (
size_t)num_ints *
sizeof(
int));
595 int *array_of_ints = (
void *)(array_of_adds + num_adds);
598 MPI_Type_get_contents(
599 mpi_ddt, num_ints, num_adds, num_dtypes,
600 array_of_ints, array_of_adds, oldtype), Xt_default_comm);
604 extent, array_of_ints[0], array_of_ints + 1,
605 array_of_adds, oldtype[0]);
611 case MPI_COMBINER_INDEXED_BLOCK:{
613 int *array_of_ints =
xmalloc((
size_t)num_ints *
sizeof(*array_of_ints));
616 MPI_Type_get_contents(
617 mpi_ddt, num_ints, num_adds, num_dtypes,
618 array_of_ints, NULL, oldtype), Xt_default_comm);
622 extent, array_of_ints[0], array_of_ints[1], array_of_ints + 2,
632 int array_of_ints[2];
633 MPI_Aint *array_of_adds =
634 xmalloc((
size_t)num_adds *
sizeof(*array_of_adds));
637 MPI_Type_get_contents(
638 mpi_ddt, num_ints, num_adds, num_dtypes,
639 array_of_ints, array_of_adds, oldtype), Xt_default_comm);
643 extent, array_of_ints[0], array_of_ints[1], array_of_adds,
651 case MPI_COMBINER_STRUCT:{
653 MPI_Aint *array_of_adds =
654 xmalloc((
size_t)num_adds *
sizeof(*array_of_adds)
655 + (
size_t)num_dtypes *
sizeof(MPI_Datatype)
656 + (
size_t)num_ints *
sizeof(
int));
657 MPI_Datatype *array_of_dtypes = (
void *)(array_of_adds + num_adds);
658 int *array_of_ints = (
void *)(array_of_dtypes + num_dtypes);
661 MPI_Type_get_contents(
662 mpi_ddt, num_ints, num_adds, num_dtypes,
663 array_of_ints, array_of_adds, array_of_dtypes), Xt_default_comm);
667 extent, array_of_ints[0], array_of_ints + 1,
668 array_of_adds, array_of_dtypes);
674 case MPI_COMBINER_SUBARRAY:{
677 xmalloc((
size_t)num_ints *
sizeof(*array_of_ints));
680 MPI_Type_get_contents(
681 mpi_ddt, num_ints, num_adds, num_dtypes,
682 array_of_ints, NULL, oldtype), Xt_default_comm);
687 array_of_ints + 1 + 0 * array_of_ints[0],
688 array_of_ints + 1 + 1 * array_of_ints[0],
689 array_of_ints + 1 + 2 * array_of_ints[0],
690 array_of_ints[1 + 3 * array_of_ints[0]],
697 case MPI_COMBINER_RESIZED:{
699 MPI_Aint array_of_adds[2];
702 MPI_Type_get_contents(
703 mpi_ddt, num_ints, num_adds, num_dtypes,
704 NULL, array_of_adds, oldtype), Xt_default_comm);
711 if ((combiner != MPI_COMBINER_NAMED) && (free_mpi_ddt))