From 1c1921ffadd71f3e400d007077d5a188f24b4fdd Mon Sep 17 00:00:00 2001 From: Howard Pritchard Date: Wed, 23 Jun 2021 13:15:18 -0600 Subject: [PATCH] sessions: make ompi_datatype_finalize global to get make check to compile, and other fixes to handle the fact that some ompi the make check tests for datatypes now initialize less of ompi than before. Signed-off-by: Howard Pritchard --- ompi/datatype/ompi_datatype.h | 1 + ompi/datatype/ompi_datatype_external32.c | 8 ++++++-- ompi/datatype/ompi_datatype_module.c | 4 +--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ompi/datatype/ompi_datatype.h b/ompi/datatype/ompi_datatype.h index 97f87d53bdf..26978d0867e 100644 --- a/ompi/datatype/ompi_datatype.h +++ b/ompi/datatype/ompi_datatype.h @@ -118,6 +118,7 @@ OMPI_DECLSPEC extern opal_convertor_t* ompi_mpi_local_convertor; extern struct opal_pointer_array_t ompi_datatype_f_to_c_table; OMPI_DECLSPEC int32_t ompi_datatype_init( void ); +OMPI_DECLSPEC int32_t ompi_datatype_finalize( void ); OMPI_DECLSPEC int32_t ompi_datatype_default_convertors_init( void ); OMPI_DECLSPEC int32_t ompi_datatype_default_convertors_fini( void ); diff --git a/ompi/datatype/ompi_datatype_external32.c b/ompi/datatype/ompi_datatype_external32.c index 9f1e6242412..d8eb81dc897 100644 --- a/ompi/datatype/ompi_datatype_external32.c +++ b/ompi/datatype/ompi_datatype_external32.c @@ -125,8 +125,12 @@ int32_t ompi_datatype_default_convertors_init( void ) int32_t ompi_datatype_default_convertors_fini( void ) { - OBJ_RELEASE( ompi_mpi_external32_convertor ); - OBJ_RELEASE( ompi_mpi_local_convertor ); + if (NULL != ompi_mpi_external32_convertor) { + OBJ_RELEASE( ompi_mpi_external32_convertor ); + } + if (NULL != ompi_mpi_local_convertor) { + OBJ_RELEASE( ompi_mpi_local_convertor ); + } return OMPI_SUCCESS; } diff --git a/ompi/datatype/ompi_datatype_module.c b/ompi/datatype/ompi_datatype_module.c index 6ab1da0712b..c519d376970 100644 --- a/ompi/datatype/ompi_datatype_module.c +++ b/ompi/datatype/ompi_datatype_module.c @@ -43,8 +43,6 @@ #include "mpi.h" -static int ompi_datatype_finalize (void); - /** * This is the number of predefined datatypes. It is different than the MAX_PREDEFINED * as it include all the optional datatypes (such as MPI_INTEGER?, MPI_REAL?). @@ -689,7 +687,7 @@ int32_t ompi_datatype_init( void ) } -static int ompi_datatype_finalize (void) +int ompi_datatype_finalize (void) { int ret = OMPI_SUCCESS;