2006-02-07 06:32:36 +03:00
|
|
|
/*
|
2007-03-17 02:11:45 +03:00
|
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
2006-02-07 06:32:36 +03:00
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2006-08-23 07:32:36 +04:00
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
2006-02-07 06:32:36 +03:00
|
|
|
* 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$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/** @file:
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#include "orte_config.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/orte_types.h"
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
#include "opal/mca/base/mca_base_param.h"
|
|
|
|
|
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
|
|
|
#include "orte/mca/ns/ns.h"
|
|
|
|
|
|
|
|
#include "orte/dss/dss_internal.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* globals
|
|
|
|
*/
|
|
|
|
bool orte_dss_initialized = false;
|
|
|
|
bool orte_dss_debug = false;
|
|
|
|
int orte_dss_verbose = -1; /* by default disabled */
|
2007-04-06 23:40:29 +04:00
|
|
|
int orte_dss_initial_size;
|
|
|
|
int orte_dss_threshold_size;
|
2006-02-07 06:32:36 +03:00
|
|
|
orte_pointer_array_t *orte_dss_types;
|
|
|
|
orte_data_type_t orte_dss_num_reg_types;
|
Bring over the ORTE 2.0 DSS. This introduces a few changes, almost all of which are transparent to the user:
1. Introduces a flag for the type of buffer that now allows a user to either have a fully described or a completely non-described buffer. In the latter case, no data type descriptions are included in the buffer. This obviously limits what we can do for debugging purposes, but the intent here was to provide an optimized communications capability for those wanting it.
Note that individual buffers can be designated for either type using the orte_dss.set_buffer_type command. In other words, the buffer type can be set dynamically - it isn't a configuration setting at all. The type will default to fully described. A buffer MUST be empty to set its type - this is checked by the set_buffer_type command, and you will receive an error if you violate that rule.
IMPORTANT NOTE: ORTE 1.x actually will NOT work with non-described buffers. This capability should therefore NOT be used until we tell you it is okay. For now, it is here simply so we can begin bringing over parts of ORTE 2.0. The problem is that ORTE 1.x depends upon the transmission of non-hard-cast data types such as size_t. These "soft" types currently utilize a "peek" function to see their actual type in the buffer - obviously, without description, the system has no idea how to unpack these "soft" types. We will deal with this later - for now, please don't use the non-described buffer option.
2. Introduces the orte_std_cntr_t type. This will become the replacement for the size_t's used throughout ORTE 1.x. At the moment, it is actually typedef'd to size_t for backward compatibility.
3. Introduces the orte_dss.arith API that supports arbitrary arithmetic functions on numeric data types. Calling the function with any other data type will generate an error.
This commit was SVN r11075.
2006-08-01 22:42:25 +04:00
|
|
|
orte_dss_buffer_type_t default_buf_type;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
2006-08-20 19:54:04 +04:00
|
|
|
orte_dss_t orte_dss = {
|
2006-02-07 06:32:36 +03:00
|
|
|
orte_dss_set,
|
|
|
|
orte_dss_get,
|
|
|
|
orte_dss_arith,
|
|
|
|
orte_dss_increment,
|
|
|
|
orte_dss_decrement,
|
Bring over the ORTE 2.0 DSS. This introduces a few changes, almost all of which are transparent to the user:
1. Introduces a flag for the type of buffer that now allows a user to either have a fully described or a completely non-described buffer. In the latter case, no data type descriptions are included in the buffer. This obviously limits what we can do for debugging purposes, but the intent here was to provide an optimized communications capability for those wanting it.
Note that individual buffers can be designated for either type using the orte_dss.set_buffer_type command. In other words, the buffer type can be set dynamically - it isn't a configuration setting at all. The type will default to fully described. A buffer MUST be empty to set its type - this is checked by the set_buffer_type command, and you will receive an error if you violate that rule.
IMPORTANT NOTE: ORTE 1.x actually will NOT work with non-described buffers. This capability should therefore NOT be used until we tell you it is okay. For now, it is here simply so we can begin bringing over parts of ORTE 2.0. The problem is that ORTE 1.x depends upon the transmission of non-hard-cast data types such as size_t. These "soft" types currently utilize a "peek" function to see their actual type in the buffer - obviously, without description, the system has no idea how to unpack these "soft" types. We will deal with this later - for now, please don't use the non-described buffer option.
2. Introduces the orte_std_cntr_t type. This will become the replacement for the size_t's used throughout ORTE 1.x. At the moment, it is actually typedef'd to size_t for backward compatibility.
3. Introduces the orte_dss.arith API that supports arbitrary arithmetic functions on numeric data types. Calling the function with any other data type will generate an error.
This commit was SVN r11075.
2006-08-01 22:42:25 +04:00
|
|
|
orte_dss_set_buffer_type,
|
2006-02-07 06:32:36 +03:00
|
|
|
orte_dss_pack,
|
|
|
|
orte_dss_unpack,
|
|
|
|
orte_dss_copy,
|
|
|
|
orte_dss_compare,
|
|
|
|
orte_dss_size,
|
|
|
|
orte_dss_print,
|
|
|
|
orte_dss_release,
|
|
|
|
orte_dss_peek,
|
|
|
|
orte_dss_unload,
|
|
|
|
orte_dss_load,
|
Commit the orted-failed-to-start code. This correctly causes the system to detect the failure of an orted to start and allows the system to terminate all procs/orteds that *did* start.
The primary change that underlies all this is in the OOB. Specifically, the problem in the code until now has been that the OOB attempts to resolve an address when we call the "send" to an unknown recipient. The OOB would then wait forever if that recipient never actually started (and hence, never reported back its OOB contact info). In the case of an orted that failed to start, we would correctly detect that the orted hadn't started, but then we would attempt to order all orteds (including the one that failed to start) to die. This would cause the OOB to "hang" the system.
Unfortunately, revising how the OOB resolves addresses introduced a number of additional problems. Specifically, and most troublesome, was the fact that comm_spawn involved the immediate transmission of the rendezvous point from parent-to-child after the child was spawned. The current code used the OOB address resolution as a "barrier" - basically, the parent would attempt to send the info to the child, and then "hold" there until the child's contact info had arrived (meaning the child had started) and the send could be completed.
Note that this also caused comm_spawn to "hang" the entire system if the child never started... The app-failed-to-start helped improve that behavior - this code provides additional relief.
With this change, the OOB will return an ADDRESSEE_UNKNOWN error if you attempt to send to a recipient whose contact info isn't already in the OOB's hash tables. To resolve comm_spawn issues, we also now force the cross-sharing of connection info between parent and child jobs during spawn.
Finally, to aid in setting triggers to the right values, we introduce the "arith" API for the GPR. This function allows you to atomically change the value in a registry location (either divide, multiply, add, or subtract) by the provided operand. It is equivalent to first fetching the value using a "get", then modifying it, and then putting the result back into the registry via a "put".
This commit was SVN r14711.
2007-05-21 22:31:28 +04:00
|
|
|
orte_dss_xfer_payload,
|
|
|
|
orte_dss_copy_payload,
|
2006-02-07 06:32:36 +03:00
|
|
|
orte_dss_register,
|
Bring over the ORTE 2.0 DSS. This introduces a few changes, almost all of which are transparent to the user:
1. Introduces a flag for the type of buffer that now allows a user to either have a fully described or a completely non-described buffer. In the latter case, no data type descriptions are included in the buffer. This obviously limits what we can do for debugging purposes, but the intent here was to provide an optimized communications capability for those wanting it.
Note that individual buffers can be designated for either type using the orte_dss.set_buffer_type command. In other words, the buffer type can be set dynamically - it isn't a configuration setting at all. The type will default to fully described. A buffer MUST be empty to set its type - this is checked by the set_buffer_type command, and you will receive an error if you violate that rule.
IMPORTANT NOTE: ORTE 1.x actually will NOT work with non-described buffers. This capability should therefore NOT be used until we tell you it is okay. For now, it is here simply so we can begin bringing over parts of ORTE 2.0. The problem is that ORTE 1.x depends upon the transmission of non-hard-cast data types such as size_t. These "soft" types currently utilize a "peek" function to see their actual type in the buffer - obviously, without description, the system has no idea how to unpack these "soft" types. We will deal with this later - for now, please don't use the non-described buffer option.
2. Introduces the orte_std_cntr_t type. This will become the replacement for the size_t's used throughout ORTE 1.x. At the moment, it is actually typedef'd to size_t for backward compatibility.
3. Introduces the orte_dss.arith API that supports arbitrary arithmetic functions on numeric data types. Calling the function with any other data type will generate an error.
This commit was SVN r11075.
2006-08-01 22:42:25 +04:00
|
|
|
orte_dss_lookup_data_type,
|
2006-10-03 21:40:00 +04:00
|
|
|
orte_dss_dump_data_types,
|
|
|
|
orte_dss_dump
|
2006-02-07 06:32:36 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Object constructors, destructors, and instantiations
|
|
|
|
*/
|
|
|
|
/** Data Value **/
|
|
|
|
/* constructor - used to initialize state of data value instance */
|
|
|
|
static void orte_data_value_construct(orte_data_value_t* ptr)
|
|
|
|
{
|
|
|
|
ptr->type = ORTE_UNDEF;
|
|
|
|
ptr->data = NULL;
|
|
|
|
}
|
|
|
|
/* destructor - used to release data value instance */
|
|
|
|
static void orte_data_value_destruct(orte_data_value_t* ptr)
|
|
|
|
{
|
|
|
|
if (NULL != ptr->data) {
|
|
|
|
orte_dss.release(ptr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* define instance of opal_class_t */
|
|
|
|
OBJ_CLASS_INSTANCE(
|
|
|
|
orte_data_value_t, /* type name */
|
|
|
|
opal_object_t, /* parent "class" name */
|
|
|
|
orte_data_value_construct, /* constructor */
|
|
|
|
orte_data_value_destruct); /* destructor */
|
|
|
|
|
|
|
|
|
|
|
|
static void orte_buffer_construct (orte_buffer_t* buffer)
|
|
|
|
{
|
Bring over the ORTE 2.0 DSS. This introduces a few changes, almost all of which are transparent to the user:
1. Introduces a flag for the type of buffer that now allows a user to either have a fully described or a completely non-described buffer. In the latter case, no data type descriptions are included in the buffer. This obviously limits what we can do for debugging purposes, but the intent here was to provide an optimized communications capability for those wanting it.
Note that individual buffers can be designated for either type using the orte_dss.set_buffer_type command. In other words, the buffer type can be set dynamically - it isn't a configuration setting at all. The type will default to fully described. A buffer MUST be empty to set its type - this is checked by the set_buffer_type command, and you will receive an error if you violate that rule.
IMPORTANT NOTE: ORTE 1.x actually will NOT work with non-described buffers. This capability should therefore NOT be used until we tell you it is okay. For now, it is here simply so we can begin bringing over parts of ORTE 2.0. The problem is that ORTE 1.x depends upon the transmission of non-hard-cast data types such as size_t. These "soft" types currently utilize a "peek" function to see their actual type in the buffer - obviously, without description, the system has no idea how to unpack these "soft" types. We will deal with this later - for now, please don't use the non-described buffer option.
2. Introduces the orte_std_cntr_t type. This will become the replacement for the size_t's used throughout ORTE 1.x. At the moment, it is actually typedef'd to size_t for backward compatibility.
3. Introduces the orte_dss.arith API that supports arbitrary arithmetic functions on numeric data types. Calling the function with any other data type will generate an error.
This commit was SVN r11075.
2006-08-01 22:42:25 +04:00
|
|
|
/** set the default buffer type */
|
|
|
|
buffer->type = default_buf_type;
|
|
|
|
|
2006-02-07 06:32:36 +03:00
|
|
|
/* Make everything NULL to begin with */
|
|
|
|
|
|
|
|
buffer->base_ptr = buffer->pack_ptr = buffer->unpack_ptr = NULL;
|
2007-04-06 23:40:29 +04:00
|
|
|
buffer->bytes_allocated = buffer->bytes_used = 0;
|
2006-02-07 06:32:36 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void orte_buffer_destruct (orte_buffer_t* buffer)
|
|
|
|
{
|
|
|
|
if (NULL != buffer) {
|
|
|
|
if (NULL != buffer->base_ptr) {
|
|
|
|
free (buffer->base_ptr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(orte_buffer_t,
|
|
|
|
opal_object_t,
|
|
|
|
orte_buffer_construct,
|
|
|
|
orte_buffer_destruct);
|
|
|
|
|
|
|
|
|
|
|
|
static void orte_dss_type_info_construct(orte_dss_type_info_t *obj)
|
|
|
|
{
|
|
|
|
obj->odti_name = NULL;
|
|
|
|
obj->odti_pack_fn = NULL;
|
|
|
|
obj->odti_unpack_fn = NULL;
|
|
|
|
obj->odti_copy_fn = NULL;
|
|
|
|
obj->odti_compare_fn = NULL;
|
|
|
|
obj->odti_size_fn = NULL;
|
|
|
|
obj->odti_print_fn = NULL;
|
|
|
|
obj->odti_release_fn = NULL;
|
|
|
|
obj->odti_structured = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void orte_dss_type_info_destruct(orte_dss_type_info_t *obj)
|
|
|
|
{
|
|
|
|
if (NULL != obj->odti_name) {
|
|
|
|
free(obj->odti_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(orte_dss_type_info_t, opal_object_t,
|
|
|
|
orte_dss_type_info_construct,
|
|
|
|
orte_dss_type_info_destruct);
|
|
|
|
|
|
|
|
|
|
|
|
int orte_dss_open(void)
|
|
|
|
{
|
|
|
|
char *enviro_val;
|
2007-04-06 23:40:29 +04:00
|
|
|
int id, rc;
|
2006-02-07 06:32:36 +03:00
|
|
|
orte_data_type_t tmp;
|
2006-12-02 16:32:16 +03:00
|
|
|
int def_type;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
if (orte_dss_initialized) {
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
enviro_val = getenv("ORTE_dss_debug");
|
|
|
|
if (NULL != enviro_val) { /* debug requested */
|
|
|
|
orte_dss_debug = true;
|
|
|
|
} else {
|
|
|
|
orte_dss_debug = false;
|
|
|
|
}
|
|
|
|
|
2006-12-02 16:32:16 +03:00
|
|
|
/** set the default buffer type. If we are in debug mode, then we default
|
|
|
|
* to fully described buffers. Otherwise, we default to non-described for brevity
|
|
|
|
* and performance
|
2006-12-02 01:30:39 +03:00
|
|
|
*/
|
2006-12-02 16:32:16 +03:00
|
|
|
#if OMPI_ENABLE_DEBUG
|
|
|
|
def_type = ORTE_DSS_BUFFER_FULLY_DESC;
|
|
|
|
#else
|
2006-12-07 02:19:06 +03:00
|
|
|
def_type = ORTE_DSS_BUFFER_NON_DESC;
|
2006-12-02 16:32:16 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
id = mca_base_param_register_int("dss", "buffer", "type",
|
2007-04-12 08:53:30 +04:00
|
|
|
"Set the default mode for OpenRTE buffers (0=non-described, 1=described)",
|
2006-12-02 16:32:16 +03:00
|
|
|
def_type);
|
2006-12-02 01:30:39 +03:00
|
|
|
mca_base_param_lookup_int(id, &rc);
|
2006-12-02 16:32:16 +03:00
|
|
|
default_buf_type = rc;
|
Bring over the ORTE 2.0 DSS. This introduces a few changes, almost all of which are transparent to the user:
1. Introduces a flag for the type of buffer that now allows a user to either have a fully described or a completely non-described buffer. In the latter case, no data type descriptions are included in the buffer. This obviously limits what we can do for debugging purposes, but the intent here was to provide an optimized communications capability for those wanting it.
Note that individual buffers can be designated for either type using the orte_dss.set_buffer_type command. In other words, the buffer type can be set dynamically - it isn't a configuration setting at all. The type will default to fully described. A buffer MUST be empty to set its type - this is checked by the set_buffer_type command, and you will receive an error if you violate that rule.
IMPORTANT NOTE: ORTE 1.x actually will NOT work with non-described buffers. This capability should therefore NOT be used until we tell you it is okay. For now, it is here simply so we can begin bringing over parts of ORTE 2.0. The problem is that ORTE 1.x depends upon the transmission of non-hard-cast data types such as size_t. These "soft" types currently utilize a "peek" function to see their actual type in the buffer - obviously, without description, the system has no idea how to unpack these "soft" types. We will deal with this later - for now, please don't use the non-described buffer option.
2. Introduces the orte_std_cntr_t type. This will become the replacement for the size_t's used throughout ORTE 1.x. At the moment, it is actually typedef'd to size_t for backward compatibility.
3. Introduces the orte_dss.arith API that supports arbitrary arithmetic functions on numeric data types. Calling the function with any other data type will generate an error.
This commit was SVN r11075.
2006-08-01 22:42:25 +04:00
|
|
|
|
2007-04-06 23:40:29 +04:00
|
|
|
/* setup the initial size of the buffer. */
|
|
|
|
id = mca_base_param_register_int("dss", "buffer_initial", "size", NULL,
|
|
|
|
ORTE_DSS_DEFAULT_INITIAL_SIZE);
|
|
|
|
mca_base_param_lookup_int(id, &orte_dss_initial_size);
|
|
|
|
|
|
|
|
/* the threshold as to where to stop doubling the size of the buffer
|
|
|
|
* allocated memory and start doing additive increases */
|
|
|
|
id = mca_base_param_register_int("dss", "buffer_threshold", "size", NULL,
|
|
|
|
ORTE_DSS_DEFAULT_THRESHOLD_SIZE);
|
|
|
|
mca_base_param_lookup_int(id, &orte_dss_threshold_size);
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
/* Setup the types array */
|
|
|
|
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_pointer_array_init(&orte_dss_types,
|
|
|
|
ORTE_DSS_ID_DYNAMIC,
|
|
|
|
ORTE_DSS_ID_MAX,
|
|
|
|
ORTE_DSS_ID_MAX))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
orte_dss_num_reg_types = 0;
|
|
|
|
|
|
|
|
/* Register all the intrinsic types */
|
|
|
|
|
|
|
|
tmp = ORTE_NULL;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_null,
|
|
|
|
orte_dss_unpack_null,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_copy_null,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_null,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_null,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_NULL", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
tmp = ORTE_BYTE;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_byte,
|
|
|
|
orte_dss_unpack_byte,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_byte,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_byte,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_BYTE", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
tmp = ORTE_BOOL;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_bool,
|
|
|
|
orte_dss_unpack_bool,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_bool,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_bool,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_BOOL", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
tmp = ORTE_INT;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_int,
|
|
|
|
orte_dss_unpack_int,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_int,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_int,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_INT", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
tmp = ORTE_UINT;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_int,
|
|
|
|
orte_dss_unpack_int,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_uint,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_uint,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_UINT", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
tmp = ORTE_INT8;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_byte,
|
|
|
|
orte_dss_unpack_byte,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_int8,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_int8,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_INT8", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
tmp = ORTE_UINT8;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_byte,
|
|
|
|
orte_dss_unpack_byte,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_uint8,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_uint8,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_UINT8", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
tmp = ORTE_INT16;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_int16,
|
|
|
|
orte_dss_unpack_int16,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_int16,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_int16,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_INT16", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
tmp = ORTE_UINT16;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_int16,
|
|
|
|
orte_dss_unpack_int16,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_uint16,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_uint16,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_UINT16", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
tmp = ORTE_INT32;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_int32,
|
|
|
|
orte_dss_unpack_int32,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_int32,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_int32,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_INT32", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
tmp = ORTE_UINT32;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_int32,
|
|
|
|
orte_dss_unpack_int32,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_uint32,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_uint32,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_UINT32", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
tmp = ORTE_INT64;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_int64,
|
|
|
|
orte_dss_unpack_int64,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_int64,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_int64,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_INT64", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
tmp = ORTE_UINT64;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_int64,
|
|
|
|
orte_dss_unpack_int64,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_uint64,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_uint64,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_UINT64", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
tmp = ORTE_SIZE;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_sizet,
|
|
|
|
orte_dss_unpack_sizet,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_size,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_size,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_SIZE", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
tmp = ORTE_PID;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_pid,
|
|
|
|
orte_dss_unpack_pid,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_pid,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_pid,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_PID", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
tmp = ORTE_STRING;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_string,
|
|
|
|
orte_dss_unpack_string,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_copy_string,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_string,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_size_string,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_string,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_STRUCTURED,
|
|
|
|
"ORTE_STRING", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
Bring over the ORTE 2.0 DSS. This introduces a few changes, almost all of which are transparent to the user:
1. Introduces a flag for the type of buffer that now allows a user to either have a fully described or a completely non-described buffer. In the latter case, no data type descriptions are included in the buffer. This obviously limits what we can do for debugging purposes, but the intent here was to provide an optimized communications capability for those wanting it.
Note that individual buffers can be designated for either type using the orte_dss.set_buffer_type command. In other words, the buffer type can be set dynamically - it isn't a configuration setting at all. The type will default to fully described. A buffer MUST be empty to set its type - this is checked by the set_buffer_type command, and you will receive an error if you violate that rule.
IMPORTANT NOTE: ORTE 1.x actually will NOT work with non-described buffers. This capability should therefore NOT be used until we tell you it is okay. For now, it is here simply so we can begin bringing over parts of ORTE 2.0. The problem is that ORTE 1.x depends upon the transmission of non-hard-cast data types such as size_t. These "soft" types currently utilize a "peek" function to see their actual type in the buffer - obviously, without description, the system has no idea how to unpack these "soft" types. We will deal with this later - for now, please don't use the non-described buffer option.
2. Introduces the orte_std_cntr_t type. This will become the replacement for the size_t's used throughout ORTE 1.x. At the moment, it is actually typedef'd to size_t for backward compatibility.
3. Introduces the orte_dss.arith API that supports arbitrary arithmetic functions on numeric data types. Calling the function with any other data type will generate an error.
This commit was SVN r11075.
2006-08-01 22:42:25 +04:00
|
|
|
tmp = ORTE_STD_CNTR;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_std_cntr,
|
|
|
|
orte_dss_unpack_std_cntr,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_std_cntr,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_std_cntr,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_STD_CNTR", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
2006-02-07 06:32:36 +03:00
|
|
|
tmp = ORTE_DATA_TYPE;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_data_type,
|
|
|
|
orte_dss_unpack_data_type,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_dt,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_data_type,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_DATA_TYPE", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
tmp = ORTE_DATA_VALUE;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_data_value,
|
|
|
|
orte_dss_unpack_data_value,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_copy_data_value,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_data_value,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_size_data_value,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_data_value,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_obj_release,
|
|
|
|
ORTE_DSS_STRUCTURED,
|
|
|
|
"ORTE_DATA_VALUE", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
2007-03-17 02:11:45 +03:00
|
|
|
|
|
|
|
#if OPAL_ENABLE_FT == 1
|
|
|
|
tmp = ORTE_CKPT_CMD;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_ckpt_cmd,
|
|
|
|
orte_dss_unpack_ckpt_cmd,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_std_copy,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_ckpt_cmd,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_std_size,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_ckpt_cmd,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_std_release,
|
|
|
|
ORTE_DSS_UNSTRUCTURED,
|
|
|
|
"ORTE_DATA_TYPE", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2006-02-07 06:32:36 +03:00
|
|
|
tmp = ORTE_BYTE_OBJECT;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.register_type(orte_dss_pack_byte_object,
|
|
|
|
orte_dss_unpack_byte_object,
|
|
|
|
(orte_dss_copy_fn_t)orte_dss_copy_byte_object,
|
|
|
|
(orte_dss_compare_fn_t)orte_dss_compare_byte_object,
|
|
|
|
(orte_dss_size_fn_t)orte_dss_size_byte_object,
|
|
|
|
(orte_dss_print_fn_t)orte_dss_print_byte_object,
|
|
|
|
(orte_dss_release_fn_t)orte_dss_release_byte_object,
|
|
|
|
ORTE_DSS_STRUCTURED,
|
|
|
|
"ORTE_BYTE_OBJECT", &tmp))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* All done */
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int orte_dss_close(void)
|
|
|
|
{
|
2006-08-15 23:54:10 +04:00
|
|
|
orte_std_cntr_t i;
|
2006-02-07 06:32:36 +03:00
|
|
|
|
|
|
|
orte_dss_initialized = false;
|
|
|
|
|
|
|
|
for (i = 0 ; i < orte_pointer_array_get_size(orte_dss_types) ; ++i) {
|
2006-08-23 07:32:36 +04:00
|
|
|
orte_dss_type_info_t *info = (orte_dss_type_info_t*)orte_pointer_array_get_item(orte_dss_types, i);
|
2006-02-07 06:32:36 +03:00
|
|
|
if (NULL != info) {
|
|
|
|
OBJ_RELEASE(info);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
OBJ_RELEASE(orte_dss_types);
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|