1
1
Made a couple vars static if they didn't look like they were used
more than one place, and added prefixes to a few.

Signed-off-by: Mark Allen <markalle@us.ibm.com>
Этот коммит содержится в:
Mark Allen 2020-10-02 17:47:53 -04:00
родитель 6c46da3245
Коммит 34b42b1b09
4 изменённых файлов: 30 добавлений и 29 удалений

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2018 IBM Corporation. All rights reserved.
* Copyright (c) 2016-2020 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -22,11 +22,11 @@ OMPI_MODULE_DECLSPEC extern const ompi_hook_base_component_1_0_0_t mca_hook_comm
extern int mca_hook_comm_method_verbose;
extern int mca_hook_comm_method_output;
extern bool hook_comm_method_enable_mpi_init;
extern bool hook_comm_method_enable_mpi_finalize;
extern int hook_comm_method_max;
extern int hook_comm_method_brief;
extern char *hook_comm_method_fakefile;
extern bool mca_hook_comm_method_enable_mpi_init;
extern bool mca_hook_comm_method_enable_mpi_finalize;
extern int mca_hook_comm_method_max;
extern int mca_hook_comm_method_brief;
extern char *mca_hook_comm_method_fakefile;
void ompi_hook_comm_method_mpi_init_bottom(int argc, char **argv, int requested, int *provided);

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2018 IBM Corporation. All rights reserved.
* Copyright (c) 2016-2020 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -68,11 +68,11 @@ const ompi_hook_base_component_1_0_0_t mca_hook_comm_method_component = {
int mca_hook_comm_method_verbose = 0;
int mca_hook_comm_method_output = -1;
bool hook_comm_method_enable_mpi_init = false;
bool hook_comm_method_enable_mpi_finalize = false;
int hook_comm_method_max = 12;
int hook_comm_method_brief = 0;
char *hook_comm_method_fakefile = NULL;
bool mca_hook_comm_method_enable_mpi_init = false;
bool mca_hook_comm_method_enable_mpi_finalize = false;
int mca_hook_comm_method_max = 12;
int mca_hook_comm_method_brief = 0;
char *mca_hook_comm_method_fakefile = NULL;
static int ompi_hook_comm_method_component_open(void)
{
@ -113,23 +113,23 @@ static int ompi_hook_comm_method_component_register(void)
/*
* If the component is active for mpi_init / mpi_finalize
*/
hook_comm_method_enable_mpi_init = false;
mca_hook_comm_method_enable_mpi_init = false;
(void) mca_base_component_var_register(&mca_hook_comm_method_component.hookm_version, "enable_mpi_init",
"Enable comm_method behavior on mpi_init",
MCA_BASE_VAR_TYPE_BOOL, NULL,
0, 0,
OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_READONLY,
&hook_comm_method_enable_mpi_init);
&mca_hook_comm_method_enable_mpi_init);
hook_comm_method_enable_mpi_finalize = false;
mca_hook_comm_method_enable_mpi_finalize = false;
(void) mca_base_component_var_register(&mca_hook_comm_method_component.hookm_version, "enable_mpi_finalize",
"Enable comm_method behavior on mpi_finalize",
MCA_BASE_VAR_TYPE_BOOL, NULL,
0, 0,
OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_READONLY,
&hook_comm_method_enable_mpi_finalize);
&mca_hook_comm_method_enable_mpi_finalize);
// User can set the comm_method mca variable too
int hook_comm_method = -1;
@ -142,10 +142,10 @@ static int ompi_hook_comm_method_component_register(void)
&hook_comm_method);
if( 1 == hook_comm_method ) {
hook_comm_method_enable_mpi_init = true;
mca_hook_comm_method_enable_mpi_init = true;
}
else if( 2 == hook_comm_method ) {
hook_comm_method_enable_mpi_finalize = true;
mca_hook_comm_method_enable_mpi_finalize = true;
}
// comm_method_max
@ -155,7 +155,7 @@ static int ompi_hook_comm_method_component_register(void)
0, 0,
OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_READONLY,
&hook_comm_method_max);
&mca_hook_comm_method_max);
// comm_method_brief
(void) mca_base_var_register("ompi", NULL, NULL, "comm_method_brief",
"Only print the comm method summary, skip the 2d table.",
@ -163,7 +163,7 @@ static int ompi_hook_comm_method_component_register(void)
0, 0,
OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_READONLY,
&hook_comm_method_brief);
&mca_hook_comm_method_brief);
// comm_method_fakefile is just for debugging, allows complete override of all the
// comm method in the table
@ -173,7 +173,7 @@ static int ompi_hook_comm_method_component_register(void)
0, 0,
OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_READONLY,
&hook_comm_method_fakefile);
&mca_hook_comm_method_fakefile);
return OMPI_SUCCESS;
}

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2018 IBM Corporation. All rights reserved.
* Copyright (c) 2016-2020 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -219,14 +219,14 @@ static void ompi_report_comm_methods(int called_from_location);
void ompi_hook_comm_method_mpi_init_bottom(int argc, char **argv, int requested, int *provided)
{
if( hook_comm_method_enable_mpi_init ) {
if( mca_hook_comm_method_enable_mpi_init ) {
ompi_report_comm_methods( 1 );
}
}
void ompi_hook_comm_method_mpi_finalize_top(void)
{
if( hook_comm_method_enable_mpi_finalize ) {
if( mca_hook_comm_method_enable_mpi_finalize ) {
ompi_report_comm_methods( 2 );
}
}
@ -339,9 +339,9 @@ ompi_report_comm_methods(int called_from_location) // 1 = from init, 2 = from fi
hpmp_myrank = ompi_comm_rank(MPI_COMM_WORLD);
// hpmp_nprocs = ompi_comm_size(MPI_COMM_WORLD);
max2Dprottable = hook_comm_method_max;
max2Dprottable = mca_hook_comm_method_max;
max2D1Cprottable = 3 * max2Dprottable;
if (hook_comm_method_brief) {
if (mca_hook_comm_method_brief) {
// force only the short summary output to be printed with no 2d table:
max2Dprottable = 0;
max2D1Cprottable = 0;
@ -545,10 +545,10 @@ ompi_report_comm_methods(int called_from_location) // 1 = from init, 2 = from fi
// settings, this is only for testing, eg to make sure the printing comes out
// right.
if (myleaderrank == 0) {
if (hook_comm_method_fakefile) {
if (mca_hook_comm_method_fakefile) {
FILE *fp;
int setting;
fp = fopen(hook_comm_method_fakefile, "r");
fp = fopen(mca_hook_comm_method_fakefile, "r");
for (i=0; i<nleaderranks; ++i) {
for (k=0; k<nleaderranks; ++k) {
fscanf(fp, "%d", &setting);

Просмотреть файл

@ -8,6 +8,7 @@
* and Technology (RIST). All rights reserved.
* Copyright (c) 2019 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2020 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -17,7 +18,7 @@
#include "ompi_spc.h"
opal_timer_t sys_clock_freq_mhz = 0;
static opal_timer_t sys_clock_freq_mhz = 0;
static void ompi_spc_dump(void);