Merge pull request #8207 from ggouaillardet/topic/retain_datatypes_w
coll/base: do not drop const qualifier
Этот коммит содержится в:
Коммит
67421c5d23
@ -7,8 +7,8 @@
|
||||
* Copyright (c) 2010-2017 Cisco Systems, Inc. All rights reserved
|
||||
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2015-2018 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2015-2020 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -408,5 +408,15 @@ OMPI_DECLSPEC int ompi_datatype_pack_external_size( const char datarep[], int in
|
||||
} \
|
||||
}
|
||||
|
||||
#define OMPI_DATATYPE_RELEASE_NO_NULLIFY(ddt) \
|
||||
{ \
|
||||
if( !ompi_datatype_is_predefined((ddt)) ) { \
|
||||
OPAL_OUTPUT_VERBOSE((0, 100, "Datatype %p [%s] refcount %d in file %s:%d\n", \
|
||||
(void*)(ddt), (ddt)->name, (ddt)->super.super.obj_reference_count, \
|
||||
__func__, __LINE__)); \
|
||||
OBJ_RELEASE_NO_NULLIFY((ddt)); \
|
||||
} \
|
||||
}
|
||||
|
||||
END_C_DECLS
|
||||
#endif /* OMPI_DATATYPE_H_HAS_BEEN_INCLUDED */
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2014-2019 Research Organization for Information Science
|
||||
* Copyright (c) 2014-2020 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -220,7 +220,7 @@ static void release_vecs_callback(ompi_coll_base_nbc_request_t *request) {
|
||||
if (NULL != request->data.vecs.stypes) {
|
||||
for (int i=0; i<scount; i++) {
|
||||
if (NULL != request->data.vecs.stypes[i]) {
|
||||
OMPI_DATATYPE_RELEASE(request->data.vecs.stypes[i]);
|
||||
OMPI_DATATYPE_RELEASE_NO_NULLIFY(request->data.vecs.stypes[i]);
|
||||
}
|
||||
}
|
||||
request->data.vecs.stypes = NULL;
|
||||
@ -228,7 +228,7 @@ static void release_vecs_callback(ompi_coll_base_nbc_request_t *request) {
|
||||
if (NULL != request->data.vecs.rtypes) {
|
||||
for (int i=0; i<rcount; i++) {
|
||||
if (NULL != request->data.vecs.rtypes[i]) {
|
||||
OMPI_DATATYPE_RELEASE(request->data.vecs.rtypes[i]);
|
||||
OMPI_DATATYPE_RELEASE_NO_NULLIFY(request->data.vecs.rtypes[i]);
|
||||
}
|
||||
}
|
||||
request->data.vecs.rtypes = NULL;
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2014-2019 Research Organization for Information Science
|
||||
* Copyright (c) 2014-2020 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -58,8 +58,8 @@ struct ompi_coll_base_nbc_request_t {
|
||||
opal_object_t *objs[2];
|
||||
} objs;
|
||||
struct {
|
||||
ompi_datatype_t **stypes;
|
||||
ompi_datatype_t **rtypes;
|
||||
ompi_datatype_t * const *stypes;
|
||||
ompi_datatype_t * const *rtypes;
|
||||
} vecs;
|
||||
} data;
|
||||
};
|
||||
|
@ -11,8 +11,8 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007-2014 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2014-2020 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -345,6 +345,27 @@ static inline opal_object_t *opal_obj_new_debug(opal_class_t* type, const char*
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#if OPAL_ENABLE_DEBUG
|
||||
#define OBJ_RELEASE_NO_NULLIFY(object) \
|
||||
do { \
|
||||
assert(OPAL_OBJ_MAGIC_ID == ((opal_object_t *) (object))->obj_magic_id); \
|
||||
assert(NULL != ((opal_object_t *) (object))->obj_class); \
|
||||
if (0 == opal_obj_update((opal_object_t *) (object), -1)) { \
|
||||
OBJ_SET_MAGIC_ID((object), 0); \
|
||||
opal_obj_run_destructors((opal_object_t *) (object)); \
|
||||
OBJ_REMEMBER_FILE_AND_LINENO( object, __FILE__, __LINE__ ); \
|
||||
free((void *) object); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
#define OBJ_RELEASE_NO_NULLIFY(object) \
|
||||
do { \
|
||||
if (0 == opal_obj_update((opal_object_t *) (object), -1)) { \
|
||||
opal_obj_run_destructors((opal_object_t *) (object)); \
|
||||
free((void *) object); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Construct (initialize) objects that are not dynamically allocated.
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user