From 968fcd83c64f4973dad183ccb89c2a84bd760e11 Mon Sep 17 00:00:00 2001 From: Howard Pritchard Date: Fri, 27 Sep 2024 10:44:28 -0600 Subject: [PATCH] mpif08: add big count get_contents/get_envelope some cleanup for get_extent Signed-off-by: Howard Pritchard --- ompi/include/mpi.h.in | 16 ++- ompi/mpi/fortran/mpif-h/type_get_contents_f.c | 97 +++++++++++++++++++ ompi/mpi/fortran/mpif-h/type_get_envelope_f.c | 39 ++++++++ .../fortran/mpif-h/type_get_envelope_f_c.c | 53 ++++++++++ ompi/mpi/fortran/mpif-h/type_get_extent_f.c | 16 +++ ompi/mpi/fortran/use-mpi-f08/Makefile.am | 3 + .../bindings/mpi-f-interfaces-bind.h | 26 +++++ .../use-mpi-f08/mod/mpi-f08-interfaces.h.in | 19 +++- .../fortran/use-mpi-f08/mod/mpi-f08-rename.h | 2 + .../use-mpi-f08/type_get_contents_f08_c.F90 | 33 +++++++ .../use-mpi-f08/type_get_envelope_f08_c.F90 | 28 ++++++ .../fortran/use-mpi-f08/type_indexed_f08.F90 | 28 ------ .../mpi/fortran/use-mpi-f08/type_size_f08.F90 | 24 ----- 13 files changed, 328 insertions(+), 56 deletions(-) create mode 100644 ompi/mpi/fortran/mpif-h/type_get_envelope_f_c.c create mode 100644 ompi/mpi/fortran/use-mpi-f08/type_get_contents_f08_c.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/type_get_envelope_f08_c.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/type_indexed_f08.F90 delete mode 100644 ompi/mpi/fortran/use-mpi-f08/type_size_f08.F90 diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index 71e133fa072..c3227ca34be 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -2415,7 +2415,13 @@ OMPI_DECLSPEC int MPI_Type_get_contents(MPI_Datatype mtype, int max_integers, int array_of_integers[], MPI_Aint array_of_addresses[], MPI_Datatype array_of_datatypes[]); -/* TODO: MPI_Type_get_contents_c */ +OMPI_DECLSPEC int MPI_Type_get_contents_c(MPI_Datatype mtype, MPI_Count max_integers, + MPI_Count max_addresses, MPI_Count max_large_counts, + MPI_Count max_datatypes, + int array_of_integers[], + MPI_Aint array_of_addresses[], + MPI_Count array_of_large_counts[], + MPI_Datatype array_of_datatypes[]); OMPI_DECLSPEC int MPI_Type_get_envelope(MPI_Datatype type, int *num_integers, int *num_addresses, int *num_datatypes, int *combiner); @@ -3555,7 +3561,13 @@ OMPI_DECLSPEC int PMPI_Type_get_contents(MPI_Datatype mtype, int max_integers, int array_of_integers[], MPI_Aint array_of_addresses[], MPI_Datatype array_of_datatypes[]); - /* TODO: MPI_Type_get_contents_c */ +OMPI_DECLSPEC int PMPI_Type_get_contents_c(MPI_Datatype mtype, MPI_Count max_integers, + MPI_Count max_addresses, MPI_Count max_large_counts, + MPI_Count max_datatypes, + int array_of_integers[], + MPI_Aint array_of_addresses[], + MPI_Count array_of_large_counts[], + MPI_Datatype array_of_datatypes[]); OMPI_DECLSPEC int PMPI_Type_get_envelope(MPI_Datatype type, int *num_integers, int *num_addresses, int *num_datatypes, int *combiner); diff --git a/ompi/mpi/fortran/mpif-h/type_get_contents_f.c b/ompi/mpi/fortran/mpif-h/type_get_contents_f.c index b66323070d9..baf5920331b 100644 --- a/ompi/mpi/fortran/mpif-h/type_get_contents_f.c +++ b/ompi/mpi/fortran/mpif-h/type_get_contents_f.c @@ -129,3 +129,100 @@ void ompi_type_get_contents_f(MPI_Fint *mtype, MPI_Fint *max_integers, free(c_datatype_array); OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_integers); } + +/* + * big count entry point, only needed by F08 bindings. + */ + +void ompi_type_get_contents_f_c(MPI_Fint *mtype, MPI_Count *max_integers, + MPI_Count *max_addresses, MPI_Count *max_large_counts, + MPI_Count *max_datatypes, + MPI_Fint *array_of_integers, + MPI_Aint *array_of_addresses, + MPI_Count *array_of_large_counts, + MPI_Fint *array_of_datatypes, MPI_Fint *ierr); +void ompi_type_get_contents_f_c(MPI_Fint *mtype, MPI_Count *max_integers, + MPI_Count *max_addresses, MPI_Count *max_large_counts, + MPI_Count *max_datatypes, + MPI_Fint *array_of_integers, + MPI_Aint *array_of_addresses, + MPI_Count *array_of_large_counts, + MPI_Fint *array_of_datatypes, MPI_Fint *ierr) +{ + MPI_Aint *c_address_array = NULL; + MPI_Count *c_large_counts_array = NULL; + MPI_Datatype *c_datatype_array = NULL; + MPI_Datatype c_mtype = PMPI_Type_f2c(*mtype); + int i, c_ierr; + OMPI_ARRAY_NAME_DECL(array_of_integers); + + if (*max_datatypes) { + c_datatype_array = (MPI_Datatype *) malloc(*max_datatypes * sizeof(MPI_Datatype)); + if (NULL == c_datatype_array) { + c_ierr = OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM, + FUNC_NAME); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + return; + } + } + + if (*max_addresses) { + c_address_array = (MPI_Aint *) malloc(*max_addresses * sizeof(MPI_Aint)); + if (NULL == c_address_array) { + if (NULL != c_datatype_array) { + free(c_datatype_array); + } + + c_ierr = OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM, + FUNC_NAME); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + return; + } + } + + if (*max_large_counts) { + c_large_counts_array = (MPI_Count *) malloc(*max_large_counts * sizeof(MPI_Count)); + if (NULL == c_large_counts_array) { + if (NULL != c_datatype_array) { + free(c_datatype_array); + } + if (NULL != c_address_array) { + free(c_address_array); + } + + c_ierr = OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_NO_MEM, + FUNC_NAME); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + return; + } + } + + OMPI_ARRAY_FINT_2_INT(array_of_integers, *max_integers); + + c_ierr = PMPI_Type_get_contents_c(c_mtype, + OMPI_FINT_2_INT(*max_integers), + OMPI_FINT_2_INT(*max_addresses), + OMPI_FINT_2_INT(*max_datatypes), + OMPI_FINT_2_INT(*max_large_counts), + OMPI_ARRAY_NAME_CONVERT(array_of_integers), + c_address_array, c_large_counts_array, + c_datatype_array); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + for (i = 0; i < *max_addresses; i++) { + array_of_addresses[i] = c_address_array[i]; + } + for (i = 0; i < *max_large_counts; i++) { + array_of_large_counts[i] = c_large_counts_array[i]; + } + for (i = 0; i < *max_datatypes; i++) { + array_of_datatypes[i] = PMPI_Type_c2f(c_datatype_array[i]); + } + } + free(c_address_array); + free(c_datatype_array); + free(c_large_counts_array); + OMPI_ARRAY_FINT_2_INT_CLEANUP(array_of_integers); +} + diff --git a/ompi/mpi/fortran/mpif-h/type_get_envelope_f.c b/ompi/mpi/fortran/mpif-h/type_get_envelope_f.c index 23a2246dab4..cdb7ab0bb09 100644 --- a/ompi/mpi/fortran/mpif-h/type_get_envelope_f.c +++ b/ompi/mpi/fortran/mpif-h/type_get_envelope_f.c @@ -92,3 +92,42 @@ void ompi_type_get_envelope_f(MPI_Fint *type, MPI_Fint *num_integers, OMPI_SINGLE_INT_2_FINT(combiner); } } + + +/* + * big count entry point, only needed by F08 bindings. + */ + +void ompi_type_get_envelope_f_c(MPI_Fint *type, MPI_Count *num_integers, + MPI_Count *num_addresses, + MPI_Count *num_large_counts, + MPI_Count *num_datatypes, MPI_Fint *combiner, + MPI_Fint *ierr); +void ompi_type_get_envelope_f_c(MPI_Fint *type, MPI_Count *num_integers, + MPI_Count *num_addresses, + MPI_Count *num_large_counts, + MPI_Count *num_datatypes, MPI_Fint *combiner, + MPI_Fint *ierr) +{ + int c_ierr; + MPI_Datatype c_type = PMPI_Type_f2c(*type); + OMPI_SINGLE_NAME_DECL(num_integers); + OMPI_SINGLE_NAME_DECL(num_addresses); + OMPI_SINGLE_NAME_DECL(num_datatypes); + OMPI_SINGLE_NAME_DECL(combiner); + + c_ierr = PMPI_Type_get_envelope_c(c_type, + OMPI_SINGLE_NAME_CONVERT(num_integers), + OMPI_SINGLE_NAME_CONVERT(num_addresses), + OMPI_SINGLE_NAME_CONVERT(num_large_counts), + OMPI_SINGLE_NAME_CONVERT(num_datatypes), + OMPI_SINGLE_NAME_CONVERT(combiner)); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + OMPI_SINGLE_INT_2_FINT(num_integers); + OMPI_SINGLE_INT_2_FINT(num_addresses); + OMPI_SINGLE_INT_2_FINT(num_datatypes); + OMPI_SINGLE_INT_2_FINT(combiner); + } +} diff --git a/ompi/mpi/fortran/mpif-h/type_get_envelope_f_c.c b/ompi/mpi/fortran/mpif-h/type_get_envelope_f_c.c new file mode 100644 index 00000000000..ba088345f57 --- /dev/null +++ b/ompi/mpi/fortran/mpif-h/type_get_envelope_f_c.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/fortran/mpif-h/bindings.h" + +void ompi_type_get_envelope_f_c(MPI_Fint *type, MPI_Count *num_integers, + MPI_Count *num_addresses, + MPI_Count *num_large_counts, + MPI_Count *num_datatypes, MPI_Fint *combiner, + MPI_Fint *ierr) +{ + int c_ierr; + MPI_Datatype c_type = PMPI_Type_f2c(*type); + OMPI_SINGLE_NAME_DECL(num_integers); + OMPI_SINGLE_NAME_DECL(num_addresses); + OMPI_SINGLE_NAME_DECL(num_datatypes); + OMPI_SINGLE_NAME_DECL(combiner); + + c_ierr = PMPI_Type_get_envelope_c(c_type, + OMPI_SINGLE_NAME_CONVERT(num_integers), + OMPI_SINGLE_NAME_CONVERT(num_addresses), + OMPI_SINGLE_NAME_CONVERT(num_large_counts), + OMPI_SINGLE_NAME_CONVERT(num_datatypes), + OMPI_SINGLE_NAME_CONVERT(combiner)); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); + + if (MPI_SUCCESS == c_ierr) { + OMPI_SINGLE_INT_2_FINT(num_integers); + OMPI_SINGLE_INT_2_FINT(num_addresses); + OMPI_SINGLE_INT_2_FINT(num_datatypes); + OMPI_SINGLE_INT_2_FINT(combiner); + } +} diff --git a/ompi/mpi/fortran/mpif-h/type_get_extent_f.c b/ompi/mpi/fortran/mpif-h/type_get_extent_f.c index 24cd75f5da1..3aa38bb7df0 100644 --- a/ompi/mpi/fortran/mpif-h/type_get_extent_f.c +++ b/ompi/mpi/fortran/mpif-h/type_get_extent_f.c @@ -75,3 +75,19 @@ void ompi_type_get_extent_f(MPI_Fint *type, MPI_Aint *lb, c_ierr = PMPI_Type_get_extent(c_type, lb, extent); if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); } + + +/* + * big count entry point, only needed by F08 bindings. + */ +void ompi_type_get_extent_f_c(MPI_Fint *type, MPI_Count *lb, + MPI_Count *extent, MPI_Fint *ierr); +void ompi_type_get_extent_f_c(MPI_Fint *type, MPI_Count *lb, + MPI_Count *extent, MPI_Fint *ierr) +{ + int c_ierr; + MPI_Datatype c_type = PMPI_Type_f2c(*type); + + c_ierr = PMPI_Type_get_extent_c(c_type, lb, extent); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} diff --git a/ompi/mpi/fortran/use-mpi-f08/Makefile.am b/ompi/mpi/fortran/use-mpi-f08/Makefile.am index 8b8701b7b1c..dacc25f26fe 100644 --- a/ompi/mpi/fortran/use-mpi-f08/Makefile.am +++ b/ompi/mpi/fortran/use-mpi-f08/Makefile.am @@ -343,10 +343,13 @@ mpi_api_files = \ type_free_keyval_f08.F90 \ type_get_attr_f08.F90 \ type_get_contents_f08.F90 \ + type_get_contents_f08_c.F90 \ type_get_extent_f08.F90 \ type_get_extent_x_f08.F90 \ type_get_name_f08.F90 \ type_get_true_extent_x_f08.F90 \ + type_get_envelope_f08.F90 \ + type_get_envelope_f08_c.F90 \ type_match_size_f08.F90 \ type_set_attr_f08.F90 \ type_set_name_f08.F90 \ diff --git a/ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h b/ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h index 2de875ade72..f88264f8805 100644 --- a/ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h +++ b/ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h @@ -771,6 +771,21 @@ subroutine ompi_type_get_contents_f(datatype,max_integers,max_addresses, & INTEGER, INTENT(OUT) :: ierror end subroutine ompi_type_get_contents_f +subroutine ompi_type_get_contents_f_c(datatype,max_integers,max_addresses, & + max_large_counts, max_datatypes,array_of_integers,array_of_addresses, & + array_of_large_counts, array_of_datatypes,ierror) & + BIND(C, name="ompi_type_get_contents_f_c") + use :: mpi_f08_types, only : MPI_ADDRESS_KIND, MPI_COUNT_KIND + implicit none + INTEGER, INTENT(IN) :: datatype + INTEGER(KIND=MPI_COUNT_KIND), INTENT(IN) :: max_integers, max_addresses, max_large_counts, max_datatypes + INTEGER, INTENT(OUT) :: array_of_integers(max_integers) + INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: array_of_addresses(max_addresses) + INTEGER(KIND=MPI_COUNT_KIND), INTENT(OUT) :: array_of_large_counts(max_large_counts) + INTEGER, INTENT(OUT) :: array_of_datatypes(max_datatypes) + INTEGER, INTENT(OUT) :: ierror +end subroutine ompi_type_get_contents_f_c + subroutine ompi_type_get_envelope_f(datatype,num_integers, & num_addresses,num_datatypes,combiner,ierror) & BIND(C, name="ompi_type_get_envelope_f") @@ -780,6 +795,17 @@ subroutine ompi_type_get_envelope_f(datatype,num_integers, & INTEGER, INTENT(OUT) :: ierror end subroutine ompi_type_get_envelope_f +subroutine ompi_type_get_envelope_f_c(datatype,num_integers, num_addresses, & + num_large_counts, num_datatypes,combiner,ierror) & + BIND(C, name="ompi_type_get_envelope_f_c") + use :: mpi_f08_types, only : MPI_COUNT_KIND + implicit none + INTEGER, INTENT(IN) :: datatype + INTEGER(KIND=MPI_COUNT_KIND), INTENT(OUT) :: num_integers, num_large_counts, num_addresses, & + num_datatypes, combiner + INTEGER, INTENT(OUT) :: ierror +end subroutine ompi_type_get_envelope_f_c + subroutine ompi_type_get_extent_f(datatype,lb,extent,ierror) & BIND(C, name="ompi_type_get_extent_f") use :: mpi_f08_types, only : MPI_ADDRESS_KIND diff --git a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in index d27a0bad938..40a8a6daa8e 100644 --- a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in +++ b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in @@ -595,6 +595,20 @@ subroutine MPI_Type_get_contents_f08(datatype,max_integers,max_addresses,max_dat TYPE(MPI_Datatype), INTENT(OUT) :: array_of_datatypes(max_datatypes) INTEGER, OPTIONAL, INTENT(OUT) :: ierror end subroutine MPI_Type_get_contents_f08 +subroutine MPI_Type_get_contents_f08_c(datatype, max_integers, max_addresses, max_large_counts, & + max_datatypes, array_of_integers, array_of_addresses, & + array_of_large_counts, array_of_datatypes, ierror) + use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND, MPI_COUNT_KIND + implicit none + TYPE(MPI_Datatype), INTENT(IN) :: datatype + INTEGER(KIND=MPI_COUNT_KIND), INTENT(IN) :: max_integers, max_addresses, & + max_large_counts, max_datatypes + INTEGER, INTENT(OUT) :: array_of_integers(max_integers) + INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: array_of_addresses(max_addresses) + INTEGER(KIND=MPI_COUNT_KIND), INTENT(OUT) :: array_of_large_counts(max_large_counts) + TYPE(MPI_Datatype), INTENT(OUT) :: array_of_datatypes(max_datatypes) + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine MPI_Type_get_contents_f08_c end interface MPI_Type_get_contents interface MPI_Type_get_envelope @@ -606,12 +620,13 @@ subroutine MPI_Type_get_envelope_f08(datatype,num_integers,num_addresses,num_dat INTEGER, INTENT(OUT) :: num_integers, num_addresses, num_datatypes, combiner INTEGER, OPTIONAL, INTENT(OUT) :: ierror end subroutine MPI_Type_get_envelope_f08 -subroutine MPI_Type_get_envelope_f08_c(datatype,num_integers,num_addresses,num_datatypes, & +subroutine MPI_Type_get_envelope_f08_c(datatype,num_integers,num_addresses,num_large_counts,num_datatypes, & combiner,ierror) use :: mpi_f08_types, only : MPI_Datatype, MPI_COUNT_KIND implicit none TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER(MPI_COUNT_KIND), INTENT(OUT) :: num_integers, num_addresses, num_datatypes, combiner + INTEGER(MPI_COUNT_KIND), INTENT(OUT) :: num_integers, num_addresses, num_large_counts, num_datatypes + INTEGER, INTENT(OUT) :: combiner INTEGER, OPTIONAL, INTENT(OUT) :: ierror end subroutine MPI_Type_get_envelope_f08_c end interface MPI_Type_get_envelope diff --git a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h index 14b396bcbb5..4d8cc00f7db 100644 --- a/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h +++ b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h @@ -158,8 +158,10 @@ #define MPI_Type_free_f08 PMPI_Type_free_f08 #define MPI_Type_get_contents PMPI_Type_get_contents #define MPI_Type_get_contents_f08 PMPI_Type_get_contents_f08 +#define MPI_Type_get_contents_f08_c PMPI_Type_get_contents_f08_c #define MPI_Type_get_envelope PMPI_Type_get_envelope #define MPI_Type_get_envelope_f08 PMPI_Type_get_envelope_f08 +#define MPI_Type_get_envelope_f08_c PMPI_Type_get_envelope_f08_c #define MPI_Type_get_extent PMPI_Type_get_extent #define MPI_Type_get_extent_f08 PMPI_Type_get_extent_f08 #define MPI_Type_get_extent_x PMPI_Type_get_extent_x diff --git a/ompi/mpi/fortran/use-mpi-f08/type_get_contents_f08_c.F90 b/ompi/mpi/fortran/use-mpi-f08/type_get_contents_f08_c.F90 new file mode 100644 index 00000000000..5b089fb9ca9 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_get_contents_f08_c.F90 @@ -0,0 +1,33 @@ +! -*- f90 -*- +! +! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All rights reserved. +! Copyright (c) 2018-2020 Research Organization for Information Science +! and Technology (RIST). All rights reserved. +! $COPYRIGHT$ + +#include "mpi-f08-rename.h" + +subroutine MPI_Type_get_contents_f08_c(datatype, max_integers, max_addresses, max_large_counts, & + max_datatypes, array_of_integers, array_of_addresses, & + array_of_large_counts, array_of_datatypes, ierror) + use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND, MPI_COUNT_KIND + use :: ompi_mpifh_bindings, only : ompi_type_get_contents_f_c + implicit none + TYPE(MPI_Datatype), INTENT(IN) :: datatype + INTEGER(KIND=MPI_COUNT_KIND), INTENT(IN) :: max_integers, max_addresses, & + max_large_counts, max_datatypes + INTEGER, INTENT(OUT) :: array_of_integers(max_integers) + INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: array_of_addresses(max_addresses) + INTEGER(KIND=MPI_COUNT_KIND), INTENT(OUT) :: array_of_large_counts(max_large_counts) + TYPE(MPI_Datatype), INTENT(OUT) :: array_of_datatypes(max_datatypes) + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_type_get_contents_f_c(datatype%MPI_VAL,max_integers,max_addresses, & + max_large_counts, max_datatypes,array_of_integers,array_of_addresses, & + array_of_large_counts, array_of_datatypes(:)%MPI_VAL,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine MPI_Type_get_contents_f08_c diff --git a/ompi/mpi/fortran/use-mpi-f08/type_get_envelope_f08_c.F90 b/ompi/mpi/fortran/use-mpi-f08/type_get_envelope_f08_c.F90 new file mode 100644 index 00000000000..cefa541ba8b --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/type_get_envelope_f08_c.F90 @@ -0,0 +1,28 @@ +! -*- f90 -*- +! +! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All rights reserved. +! Copyright (c) 2018-2020 Research Organization for Information Science +! and Technology (RIST). All rights reserved. +! $COPYRIGHT$ + +#include "mpi-f08-rename.h" + +subroutine MPI_Type_get_envelope_f08_c(datatype,num_integers,num_addresses, & + num_large_counts, num_datatypes,combiner,ierror) + use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND, MPI_COUNT_KIND + use :: ompi_mpifh_bindings, only : ompi_type_get_envelope_f_c + implicit none + TYPE(MPI_Datatype), INTENT(IN) :: datatype + INTEGER(KIND=MPI_COUNT_KIND), INTENT(OUT) :: num_integers, num_addresses, num_large_counts, & + num_datatypes, combiner + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_type_get_envelope_f_c(datatype%MPI_VAL,num_integers,num_addresses, & + num_large_counts, num_datatypes,combiner,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine MPI_Type_get_envelope_f08_c + diff --git a/ompi/mpi/fortran/use-mpi-f08/type_indexed_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/type_indexed_f08.F90 deleted file mode 100644 index 813665ce6c1..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/type_indexed_f08.F90 +++ /dev/null @@ -1,28 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Type_indexed_f08(count,array_of_blocklengths, & - array_of_displacements,oldtype,newtype,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_type_indexed_f - implicit none - INTEGER, INTENT(IN) :: count - INTEGER, INTENT(IN) :: array_of_blocklengths(count), array_of_displacements(count) - TYPE(MPI_Datatype), INTENT(IN) :: oldtype - TYPE(MPI_Datatype), INTENT(OUT) :: newtype - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_type_indexed_f(count,array_of_blocklengths,array_of_displacements, & - oldtype%MPI_VAL,newtype%MPI_VAL,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Type_indexed_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/type_size_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/type_size_f08.F90 deleted file mode 100644 index 244a6e2378b..00000000000 --- a/ompi/mpi/fortran/use-mpi-f08/type_size_f08.F90 +++ /dev/null @@ -1,24 +0,0 @@ -! -*- f90 -*- -! -! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. -! Copyright (c) 2009-2012 Los Alamos National Security, LLC. -! All rights reserved. -! Copyright (c) 2018-2020 Research Organization for Information Science -! and Technology (RIST). All rights reserved. -! $COPYRIGHT$ - -#include "mpi-f08-rename.h" - -subroutine MPI_Type_size_f08(datatype,size,ierror) - use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND - use :: ompi_mpifh_bindings, only : ompi_type_size_f - implicit none - TYPE(MPI_Datatype), INTENT(IN) :: datatype - INTEGER, INTENT(OUT) :: size - INTEGER, OPTIONAL, INTENT(OUT) :: ierror - integer :: c_ierror - - call ompi_type_size_f(datatype%MPI_VAL,size,c_ierror) - if (present(ierror)) ierror = c_ierror - -end subroutine MPI_Type_size_f08