2012-08-16 23:11:35 +04:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
|
|
|
|
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2012-08-16 23:11:35 +04:00
|
|
|
* Additional copyrights may follow
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2012-08-16 23:11:35 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
2013-02-16 02:14:23 +04:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
2012-08-16 23:11:35 +04:00
|
|
|
#include "ompi/include/ompi/constants.h"
|
2013-02-06 01:52:55 +04:00
|
|
|
#include "netpatterns.h"
|
2012-08-16 23:11:35 +04:00
|
|
|
|
2013-02-06 01:52:55 +04:00
|
|
|
int netpatterns_base_verbose = 0; /* disabled by default */
|
2012-08-16 23:11:35 +04:00
|
|
|
|
2013-02-06 01:52:55 +04:00
|
|
|
int netpatterns_register_mca_params(void)
|
2012-08-16 23:11:35 +04:00
|
|
|
{
|
2013-03-28 01:09:41 +04:00
|
|
|
netpatterns_base_verbose = 0;
|
|
|
|
mca_base_var_register("ompi", "common", "netpatterns", "base_verbose",
|
|
|
|
"Verbosity level of the NETPATTERNS framework",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_READONLY,
|
|
|
|
&netpatterns_base_verbose);
|
2012-08-16 23:11:35 +04:00
|
|
|
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2013-02-06 01:52:55 +04:00
|
|
|
int netpatterns_base_err(const char* fmt, ...)
|
2012-08-16 23:11:35 +04:00
|
|
|
{
|
|
|
|
va_list list;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
va_start(list, fmt);
|
|
|
|
ret = vfprintf(stderr, fmt, list);
|
|
|
|
va_end(list);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-02-06 01:52:55 +04:00
|
|
|
int netpatterns_init(void)
|
2012-08-16 23:11:35 +04:00
|
|
|
{
|
|
|
|
/* There is no component for common_netpatterns so every component that uses it
|
2013-02-06 01:52:55 +04:00
|
|
|
should call netpatterns_init, still we want to run it only once */
|
2012-08-16 23:11:35 +04:00
|
|
|
static int was_called = 0;
|
|
|
|
|
|
|
|
if (0 == was_called) {
|
|
|
|
was_called = 1;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2013-02-06 01:52:55 +04:00
|
|
|
return netpatterns_register_mca_params();
|
2012-08-16 23:11:35 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|