OSHMEM: fix use of opal_verbose
fixed by Roman, reviewed by Igor/Mike cmr=v1.7.5:reviewer=ompi-rm1.7 This commit was SVN r30943.
Этот коммит содержится в:
родитель
c9465d97b4
Коммит
361f15d5d7
@ -48,7 +48,7 @@ OSHMEM_DECLSPEC extern mca_base_framework_t oshmem_atomic_base_framework;
|
||||
#endif
|
||||
|
||||
#define ATOMIC_ERROR(...) \
|
||||
oshmem_output_verbose(0, oshmem_atomic_base_framework.framework_output, \
|
||||
oshmem_output(oshmem_atomic_base_framework.framework_output, \
|
||||
"Error %s:%d - %s()", __ATOMIC_FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
|
||||
|
||||
END_C_DECLS
|
||||
|
@ -139,7 +139,7 @@ OSHMEM_DECLSPEC extern mca_base_framework_t oshmem_memheap_base_framework;
|
||||
#endif
|
||||
|
||||
#define MEMHEAP_ERROR(...) \
|
||||
oshmem_output_verbose(0, oshmem_memheap_base_framework.framework_output, \
|
||||
oshmem_output(oshmem_memheap_base_framework.framework_output, \
|
||||
"Error %s:%d - %s()", __SPML_FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
|
||||
|
||||
#define MEMHEAP_WARN(...) \
|
||||
|
@ -60,7 +60,7 @@ OSHMEM_DECLSPEC extern mca_base_framework_t oshmem_scoll_base_framework;
|
||||
#endif
|
||||
|
||||
#define SCOLL_ERROR(...) \
|
||||
oshmem_output_verbose(0, oshmem_scoll_base_framework.framework_output, \
|
||||
oshmem_output(oshmem_scoll_base_framework.framework_output, \
|
||||
"Error %s:%d - %s()", __SCOLL_FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
|
||||
|
||||
END_C_DECLS
|
||||
|
@ -89,7 +89,7 @@ OSHMEM_DECLSPEC extern mca_base_framework_t oshmem_spml_base_framework;
|
||||
#endif
|
||||
|
||||
#define SPML_ERROR(...) \
|
||||
oshmem_output_verbose(0, oshmem_spml_base_framework.framework_output, \
|
||||
oshmem_output(oshmem_spml_base_framework.framework_output, \
|
||||
"Error %s:%d - %s()", __SPML_FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
|
||||
|
||||
#define SPML_WARNING(...) \
|
||||
|
@ -137,7 +137,7 @@ OSHMEM_DECLSPEC extern mca_base_framework_t oshmem_sshmem_base_framework;
|
||||
#endif
|
||||
|
||||
#define SSHMEM_ERROR(...) \
|
||||
oshmem_output_verbose(0, oshmem_sshmem_base_framework.framework_output, \
|
||||
oshmem_output(oshmem_sshmem_base_framework.framework_output, \
|
||||
"Error %s:%d - %s()", __SSHMEM_FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
|
||||
|
||||
#define SSHMEM_WARN(...) \
|
||||
|
@ -17,11 +17,12 @@
|
||||
#include "oshmem/constants.h"
|
||||
#include "oshmem/util/oshmem_util.h"
|
||||
|
||||
void oshmem_output_verbose(int level, int output_id, const char* prefix, const char* file, int line, const char* function, const char* format, ...)
|
||||
void oshmem_output_verbose(int level, int output_id, const char* prefix,
|
||||
const char* file, int line, const char* function, const char* format, ...)
|
||||
{
|
||||
va_list args;
|
||||
char *buff, *str;
|
||||
int ret = 0;
|
||||
int ret;
|
||||
|
||||
UNREFERENCED_PARAMETER(ret);
|
||||
|
||||
@ -40,3 +41,28 @@ void oshmem_output_verbose(int level, int output_id, const char* prefix, const c
|
||||
free(buff);
|
||||
free(str);
|
||||
}
|
||||
|
||||
void oshmem_output(int output_id, const char* prefix, const char* file,
|
||||
int line, const char* function, const char* format, ...)
|
||||
{
|
||||
va_list args;
|
||||
char *buff, *str;
|
||||
int ret = 0;
|
||||
|
||||
UNREFERENCED_PARAMETER(ret);
|
||||
|
||||
va_start(args, format);
|
||||
|
||||
ret = vasprintf(&str, format, args);
|
||||
assert(-1 != ret);
|
||||
|
||||
ret = asprintf(&buff, "%s %s", prefix, str);
|
||||
assert(-1 != ret);
|
||||
|
||||
opal_output(output_id, buff, file, line, function);
|
||||
|
||||
va_end(args);
|
||||
|
||||
free(buff);
|
||||
free(str);
|
||||
}
|
||||
|
@ -13,6 +13,14 @@
|
||||
|
||||
#include "oshmem_config.h"
|
||||
|
||||
void oshmem_output_verbose(int level, int output_id, const char* prefix, const char* file, int line, const char* function, const char* format, ...);
|
||||
void oshmem_output_verbose(int level, int output_id, const char* prefix,
|
||||
const char* file, int line, const char* function, const char* format, ...);
|
||||
|
||||
/*
|
||||
* Temporary wrapper which ingores output verbosity level
|
||||
* to ensure error messages are seeing by user
|
||||
*/
|
||||
void oshmem_output(int output_id, const char* prefix, const char* file,
|
||||
int line, const char* function, const char* format, ...);
|
||||
|
||||
#endif /* OSHMEM_UTIL_H */
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user