From c2e9075d29d182e2730e9293c1ac5ac7128b0f1a Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Sun, 21 Jan 2007 15:52:06 +0000 Subject: [PATCH] - Define a OPAL_CLASS_EMPTY to be used for initialization. Similar within the dt_module for the predefined datatypes. This commit was SVN r13228. --- ompi/datatype/dt_module.c | 7 ++++++- opal/class/opal_object.h | 12 ++++++++++++ orte/dss/dss_types.h | 2 +- orte/mca/gpr/gpr_types.h | 6 +++--- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/ompi/datatype/dt_module.c b/ompi/datatype/dt_module.c index 1a714fac8c..63781aaf81 100644 --- a/ompi/datatype/dt_module.c +++ b/ompi/datatype/dt_module.c @@ -40,7 +40,12 @@ int ompi_ddt_dfd = -1; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0 } #define EMPTY_DATA(NAME) NULL, 0, "MPI_" # NAME, {0, 0, NULL}, {0, 0, NULL}, NULL, NULL, ZERO_DDT_ARRAY -#define BASEOBJ_DATA { OBJ_CLASS(ompi_datatype_t), 1 } + +#ifdef OMPI_ENABLE_DEBUG +# define BASEOBJ_DATA { OBJ_CLASS(ompi_datatype_t), 1, __FILE__, __LINE__ } +#else +# define BASEOBJ_DATA { OBJ_CLASS(ompi_datatype_t), 1 } +#endif /* Using this macro implies that at this point not all informations needed * to fill up the datatype are known. We fill them with zeros and then later diff --git a/opal/class/opal_object.h b/opal/class/opal_object.h index a6cdab774d..22414dfef3 100644 --- a/opal/class/opal_object.h +++ b/opal/class/opal_object.h @@ -226,6 +226,18 @@ struct opal_object_t { extern opal_class_t NAME ## _class +/** + * Referring to the OBJ_CLASS, when initializing + * + * @param NAME Name of class + */ +#ifdef OMPI_ENABLE_DEBUG +# define OBJ_CLASS_EMPTY(NAME) {OBJ_CLASS(NAME), 0, __FILE__, __LINE__} +#else +# define OBJ_CLASS_EMPTY(NAME) {OBJ_CLASS(NAME), 0} +#endif + + /** * Create an object: dynamically allocate storage and run the class * constructor. diff --git a/orte/dss/dss_types.h b/orte/dss/dss_types.h index a7be643ae2..60b159e074 100644 --- a/orte/dss/dss_types.h +++ b/orte/dss/dss_types.h @@ -51,7 +51,7 @@ typedef struct { } orte_data_value_t; ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_data_value_t); -#define ORTE_DATA_VALUE_EMPTY {{OBJ_CLASS(orte_data_value_t),0}, ORTE_UNDEF, NULL} +#define ORTE_DATA_VALUE_EMPTY {OBJ_CLASS_EMPTY(orte_data_value_t), ORTE_UNDEF, NULL} /* structured-unstructured data flags */ #define ORTE_DSS_STRUCTURED true diff --git a/orte/mca/gpr/gpr_types.h b/orte/mca/gpr/gpr_types.h index 10bad5f453..57e94473cd 100644 --- a/orte/mca/gpr/gpr_types.h +++ b/orte/mca/gpr/gpr_types.h @@ -151,7 +151,7 @@ typedef struct { } orte_gpr_value_t; ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_gpr_value_t); -#define ORTE_GPR_VALUE_EMPTY {{OBJ_CLASS(orte_gpr_value_t),0}, 0, NULL, 0, NULL, 0, NULL} +#define ORTE_GPR_VALUE_EMPTY {OBJ_CLASS_EMPTY(orte_gpr_value_t), 0, NULL, 0, NULL, 0, NULL} /** Return structure for notification messages * A notification message contains data from each registered subscription structure. @@ -227,7 +227,7 @@ typedef struct { } orte_gpr_subscription_t; ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_gpr_subscription_t); -#define ORTE_GPR_SUBSCRIPTION_EMPTY {{OBJ_CLASS(orte_gpr_subscription_t),0}, NULL, ORTE_GPR_SUBSCRIPTION_ID_MAX, 0, 0, NULL, 0, NULL} +#define ORTE_GPR_SUBSCRIPTION_EMPTY {OBJ_CLASS_EMPTY(orte_gpr_subscription_t), NULL, ORTE_GPR_SUBSCRIPTION_ID_MAX, 0, 0, NULL, 0, NULL} /** Structure for registering triggers * A trigger causes the associated subscriptions to be executed at a specified event, @@ -248,7 +248,7 @@ typedef struct { } orte_gpr_trigger_t; ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_gpr_trigger_t); -#define ORTE_GPR_TRIGGER_EMPTY {{OBJ_CLASS(orte_gpr_trigger_t),0}, NULL, ORTE_GPR_TRIGGER_ID_MAX, 0, 0, NULL, 0, NULL} +#define ORTE_GPR_TRIGGER_EMPTY {OBJ_CLASS_EMPTY(orte_gpr_trigger_t), NULL, ORTE_GPR_TRIGGER_ID_MAX, 0, 0, NULL, 0, NULL} #if defined(c_plusplus) || defined(__cplusplus) }