Skip to content

Minor cleanup in the monitoring PML. #7284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions ompi/mca/common/monitoring/common_monitoring.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ void mca_common_monitoring_finalize( void )
{
if( ! mca_common_monitoring_enabled || /* Don't release if not last */
0 < opal_atomic_sub_fetch_32(&mca_common_monitoring_hold, 1) ) return;

OPAL_MONITORING_PRINT_INFO("common_component_finish");
/* Dump monitoring informations */
mca_common_monitoring_flush(mca_common_monitoring_output_enabled,
Expand All @@ -253,7 +253,7 @@ void mca_common_monitoring_finalize( void )
}
}

void mca_common_monitoring_register(void*pml_monitoring_component)
int mca_common_monitoring_register(void)
{
/* Because we are playing tricks with the component close, we should not
* use mca_base_component_var_register but instead stay with the basic
Expand Down Expand Up @@ -282,7 +282,6 @@ void mca_common_monitoring_register(void*pml_monitoring_component)
&mca_common_monitoring_output_enabled);

(void)mca_base_var_register("ompi", "pml", "monitoring", "filename",
/*&mca_common_monitoring_component.pmlm_version, "filename",*/
"The name of the file where the monitoring information "
"should be saved (the filename will be extended with the "
"process rank and the \".prof\" extension). If this field "
Expand All @@ -299,10 +298,9 @@ void mca_common_monitoring_register(void*pml_monitoring_component)
* filename to be handled by the framework. It's easier to deal
* with the string lifetime.
*/
if( NULL != mca_common_monitoring_initial_filename )
if( NULL != mca_common_monitoring_initial_filename ) {
mca_common_monitoring_current_filename = strdup(mca_common_monitoring_initial_filename);

/* Register PVARs */
}

/* PML PVARs */
(void)mca_base_pvar_register("ompi", "pml", "monitoring", "flush", "Flush the monitoring "
Expand Down Expand Up @@ -338,7 +336,7 @@ void mca_common_monitoring_register(void*pml_monitoring_component)
MCA_BASE_PVAR_FLAG_READONLY | MCA_BASE_PVAR_FLAG_IWG,
mca_common_monitoring_get_osc_sent_count, NULL,
mca_common_monitoring_comm_size_notify, NULL);

(void)mca_base_pvar_register("ompi", "osc", "monitoring", "messages_sent_size", "Size of "
"messages sent through the OSC framework with each peer.",
OPAL_INFO_LVL_4, MPI_T_PVAR_CLASS_SIZE,
Expand Down Expand Up @@ -387,7 +385,7 @@ void mca_common_monitoring_register(void*pml_monitoring_component)
MCA_BASE_PVAR_FLAG_READONLY | MCA_BASE_PVAR_FLAG_IWG,
mca_common_monitoring_coll_get_o2a_count, NULL,
mca_common_monitoring_coll_messages_notify, NULL);

(void)mca_base_pvar_register("ompi", "coll", "monitoring", "o2a_size", "Size of messages "
"exchanged as one-to-all operations in a communicator.",
OPAL_INFO_LVL_4, MPI_T_PVAR_CLASS_AGGREGATE,
Expand All @@ -403,7 +401,7 @@ void mca_common_monitoring_register(void*pml_monitoring_component)
MCA_BASE_PVAR_FLAG_READONLY | MCA_BASE_PVAR_FLAG_IWG,
mca_common_monitoring_coll_get_a2o_count, NULL,
mca_common_monitoring_coll_messages_notify, NULL);

(void)mca_base_pvar_register("ompi", "coll", "monitoring", "a2o_size", "Size of messages "
"exchanged as all-to-one operations in a communicator.",
OPAL_INFO_LVL_4, MPI_T_PVAR_CLASS_AGGREGATE,
Expand All @@ -419,14 +417,16 @@ void mca_common_monitoring_register(void*pml_monitoring_component)
MCA_BASE_PVAR_FLAG_READONLY | MCA_BASE_PVAR_FLAG_IWG,
mca_common_monitoring_coll_get_a2a_count, NULL,
mca_common_monitoring_coll_messages_notify, NULL);

(void)mca_base_pvar_register("ompi", "coll", "monitoring", "a2a_size", "Size of messages "
"exchanged as all-to-all operations in a communicator.",
OPAL_INFO_LVL_4, MPI_T_PVAR_CLASS_AGGREGATE,
MCA_MONITORING_VAR_TYPE, NULL, MPI_T_BIND_MPI_COMM,
MCA_BASE_PVAR_FLAG_READONLY | MCA_BASE_PVAR_FLAG_IWG,
mca_common_monitoring_coll_get_a2a_size, NULL,
mca_common_monitoring_coll_messages_notify, NULL);

return OMPI_SUCCESS;
}

/**
Expand Down Expand Up @@ -512,7 +512,7 @@ void mca_common_monitoring_record_pml(int world_rank, size_t data_size, int tag)
log2_size = max_size_histogram - 2;
opal_atomic_add_fetch_size_t(&size_histogram[world_rank * max_size_histogram + log2_size + 1], 1);
}

/* distinguishses positive and negative tags if requested */
if( (tag < 0) && (mca_common_monitoring_filter()) ) {
opal_atomic_add_fetch_size_t(&filtered_pml_data[world_rank], data_size);
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/common/monitoring/common_monitoring.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ extern int mca_common_monitoring_enabled;
extern int mca_common_monitoring_current_state;
extern opal_hash_table_t *common_monitoring_translation_ht;

OMPI_DECLSPEC void mca_common_monitoring_register(void*pml_monitoring_component);
OMPI_DECLSPEC int mca_common_monitoring_init( void );
OMPI_DECLSPEC void mca_common_monitoring_finalize( void );
OMPI_DECLSPEC int mca_common_monitoring_add_procs(struct ompi_proc_t **procs, size_t nprocs);
OMPI_DECLSPEC int mca_common_monitoring_register(void);

/* Records PML communication */
OMPI_DECLSPEC void mca_common_monitoring_record_pml(int world_rank, size_t data_size, int tag);
Expand Down
10 changes: 2 additions & 8 deletions ompi/mca/pml/monitoring/pml_monitoring_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static int mca_pml_monitoring_component_finish(void)
mca_base_component_list_item_t *cli = NULL;
OPAL_LIST_FOREACH(cli, &ompi_pml_base_framework.framework_components, mca_base_component_list_item_t) {
component = (mca_pml_base_component_t *) cli->cli_component;

if( component == &mca_pml_monitoring_component ) {
opal_list_remove_item(&ompi_pml_base_framework.framework_components, (opal_list_item_t*)cli);
OBJ_RELEASE(cli);
Expand Down Expand Up @@ -182,12 +182,6 @@ static int mca_pml_monitoring_component_finish(void)
return OMPI_SUCCESS;
}

static int mca_pml_monitoring_component_register(void)
{
mca_common_monitoring_register(&mca_pml_monitoring_component);
return OMPI_SUCCESS;
}

mca_pml_base_component_2_0_0_t mca_pml_monitoring_component = {

/* First, the mca_base_component_t struct containing meta
Expand All @@ -200,7 +194,7 @@ mca_pml_base_component_2_0_0_t mca_pml_monitoring_component = {
MCA_MONITORING_MAKE_VERSION,
.mca_open_component = mca_pml_monitoring_component_open, /* component open */
.mca_close_component = NULL, /* component close */
.mca_register_component_params = mca_pml_monitoring_component_register
.mca_register_component_params = mca_common_monitoring_register
},
.pmlm_data = {
/* The component is checkpoint ready */
Expand Down