Add a "dump" capability to the DSS so one can display a single data value to an output stream.
Add some comments to the map type def in prep for building its data type support. This commit was SVN r11947.
Этот коммит содержится в:
родитель
6f73504ef2
Коммит
4e39878944
@ -427,6 +427,18 @@ typedef int (*orte_dss_size_fn_t)(size_t *size, void *src, orte_data_type_t type
|
||||
typedef int (*orte_dss_print_fn_t)(char **output, char *prefix, void *src, orte_data_type_t type);
|
||||
|
||||
|
||||
/**
|
||||
* Print a data value to an output stream for debugging purposes
|
||||
*
|
||||
* Uses the dss.print command to obtain a string version of the data value
|
||||
* and prints it to the designated output stream.
|
||||
*
|
||||
* @retval ORTE_SUCCESS The value was successfully printed.
|
||||
*
|
||||
* @retval ORTE_ERROR(s) An appropriate error code.
|
||||
*/
|
||||
typedef int (*orte_dss_dump_fn_t)(int output_stream, void *src, orte_data_type_t type);
|
||||
|
||||
/**
|
||||
* Set a data value
|
||||
*
|
||||
@ -570,25 +582,26 @@ typedef void (*orte_dss_dump_data_types_fn_t)(int output);
|
||||
* pointers to the calling interface.
|
||||
*/
|
||||
struct orte_dss_t {
|
||||
orte_dss_set_fn_t set;
|
||||
orte_dss_get_fn_t get;
|
||||
orte_dss_arith_fn_t arith;
|
||||
orte_dss_increment_fn_t increment;
|
||||
orte_dss_decrement_fn_t decrement;
|
||||
orte_dss_set_buffer_type_fn_t set_buffer_type;
|
||||
orte_dss_pack_fn_t pack;
|
||||
orte_dss_unpack_fn_t unpack;
|
||||
orte_dss_copy_fn_t copy;
|
||||
orte_dss_compare_fn_t compare;
|
||||
orte_dss_size_fn_t size;
|
||||
orte_dss_print_fn_t print;
|
||||
orte_dss_release_fn_t release;
|
||||
orte_dss_peek_next_item_fn_t peek;
|
||||
orte_dss_unload_fn_t unload;
|
||||
orte_dss_load_fn_t load;
|
||||
orte_dss_register_fn_t register_type;
|
||||
orte_dss_lookup_data_type_fn_t lookup_data_type;
|
||||
orte_dss_dump_data_types_fn_t dump_data_types;
|
||||
orte_dss_set_fn_t set;
|
||||
orte_dss_get_fn_t get;
|
||||
orte_dss_arith_fn_t arith;
|
||||
orte_dss_increment_fn_t increment;
|
||||
orte_dss_decrement_fn_t decrement;
|
||||
orte_dss_set_buffer_type_fn_t set_buffer_type;
|
||||
orte_dss_pack_fn_t pack;
|
||||
orte_dss_unpack_fn_t unpack;
|
||||
orte_dss_copy_fn_t copy;
|
||||
orte_dss_compare_fn_t compare;
|
||||
orte_dss_size_fn_t size;
|
||||
orte_dss_print_fn_t print;
|
||||
orte_dss_release_fn_t release;
|
||||
orte_dss_peek_next_item_fn_t peek;
|
||||
orte_dss_unload_fn_t unload;
|
||||
orte_dss_load_fn_t load;
|
||||
orte_dss_register_fn_t register_type;
|
||||
orte_dss_lookup_data_type_fn_t lookup_data_type;
|
||||
orte_dss_dump_data_types_fn_t dump_data_types;
|
||||
orte_dss_dump_fn_t dump;
|
||||
};
|
||||
typedef struct orte_dss_t orte_dss_t;
|
||||
|
||||
|
@ -25,6 +25,23 @@
|
||||
#include "orte/dss/dss_internal.h"
|
||||
|
||||
|
||||
int orte_dss_dump(int output_stream, void *src, orte_data_type_t type)
|
||||
{
|
||||
char *sptr;
|
||||
int rc;
|
||||
|
||||
if (ORTE_SUCCESS != (rc = orte_dss.print(&sptr, NULL, src, type))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
opal_output(output_stream, "%s", sptr);
|
||||
free(sptr);
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void orte_dss_dump_data_types(int output)
|
||||
{
|
||||
orte_dss_type_info_t **ptr;
|
||||
|
@ -233,6 +233,8 @@ extern orte_data_type_t orte_dss_num_reg_types;
|
||||
|
||||
int orte_dss_print(char **output, char *prefix, void *src, orte_data_type_t type);
|
||||
|
||||
int orte_dss_dump(int output_stream, void *src, orte_data_type_t type);
|
||||
|
||||
int orte_dss_size(size_t *size, void *src, orte_data_type_t type);
|
||||
|
||||
int orte_dss_peek(orte_buffer_t *buffer, orte_data_type_t *type,
|
||||
|
@ -44,7 +44,7 @@ extern "C" {
|
||||
struct orte_rmaps_base_node_t {
|
||||
opal_list_item_t super;
|
||||
orte_ras_node_t* node;
|
||||
opal_list_t node_procs;
|
||||
opal_list_t node_procs; /* list of rmaps_base_proc_t */
|
||||
};
|
||||
typedef struct orte_rmaps_base_node_t orte_rmaps_base_node_t;
|
||||
|
||||
@ -79,7 +79,7 @@ struct orte_rmaps_base_map_t {
|
||||
orte_app_context_t *app;
|
||||
orte_rmaps_base_proc_t** procs;
|
||||
orte_std_cntr_t num_procs;
|
||||
opal_list_t nodes;
|
||||
opal_list_t nodes; /* list of rmaps_base_node_t */
|
||||
};
|
||||
typedef struct orte_rmaps_base_map_t orte_rmaps_base_map_t;
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user