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$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
2013-02-16 02:14:23 +04:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
2012-08-16 23:11:35 +04:00
|
|
|
#include "opal/mca/base/mca_base_param.h"
|
|
|
|
#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
|
|
|
{
|
|
|
|
mca_base_param_reg_int_name("common",
|
|
|
|
"netpatterns_base_verbose",
|
|
|
|
"Verbosity level of the NETPATTERNS framework",
|
|
|
|
false, false,
|
|
|
|
0,
|
2013-02-06 01:52:55 +04:00
|
|
|
&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;
|
|
|
|
|
2013-02-06 01:52:55 +04:00
|
|
|
return netpatterns_register_mca_params();
|
2012-08-16 23:11:35 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|