OSHMEM: refactoring to reuse common functions from different components.
This is preparation for moving verbs dependent code out from memheap/base component Refs: #3763 This commit was SVN r30454.
Этот коммит содержится в:
родитель
0feddcd92b
Коммит
30e1e49a9e
@ -78,6 +78,7 @@ include request/Makefile.am
|
|||||||
include runtime/Makefile.am
|
include runtime/Makefile.am
|
||||||
include shmem/Makefile.am
|
include shmem/Makefile.am
|
||||||
include tools/Makefile.am
|
include tools/Makefile.am
|
||||||
|
include util/Makefile.am
|
||||||
|
|
||||||
# Ensure that the man page directory exists before we try to make man
|
# Ensure that the man page directory exists before we try to make man
|
||||||
# page files (because oshmem/shmem/man/man3 has no config.status-generated
|
# page files (because oshmem/shmem/man/man3 has no config.status-generated
|
||||||
|
@ -122,7 +122,5 @@ enum {
|
|||||||
#define MEMCHECKER(x)
|
#define MEMCHECKER(x)
|
||||||
#endif /* OMPI_WANT_MEMCHECKER */
|
#endif /* OMPI_WANT_MEMCHECKER */
|
||||||
|
|
||||||
void oshmem_output_verbose(int level, int output_id, const char* prefix, const char* file, int line, const char* function, const char* format, ...);
|
|
||||||
|
|
||||||
#endif /* OSHMEM_CONSTANTS_H */
|
#endif /* OSHMEM_CONSTANTS_H */
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include "opal/mca/mca.h"
|
#include "opal/mca/mca.h"
|
||||||
#include "oshmem/mca/atomic/atomic.h"
|
#include "oshmem/mca/atomic/atomic.h"
|
||||||
|
#include "oshmem/util/oshmem_util.h"
|
||||||
|
|
||||||
BEGIN_C_DECLS
|
BEGIN_C_DECLS
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include "opal/mca/mca.h"
|
#include "opal/mca/mca.h"
|
||||||
#include "oshmem/mca/atomic/atomic.h"
|
#include "oshmem/mca/atomic/atomic.h"
|
||||||
|
#include "oshmem/util/oshmem_util.h"
|
||||||
|
|
||||||
/* This component does uses SPML:IKRIT */
|
/* This component does uses SPML:IKRIT */
|
||||||
#include "oshmem/mca/spml/ikrit/spml_ikrit.h"
|
#include "oshmem/mca/spml/ikrit/spml_ikrit.h"
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "oshmem/mca/memheap/memheap.h"
|
#include "oshmem/mca/memheap/memheap.h"
|
||||||
#include "oshmem/mca/memheap/base/base.h"
|
#include "oshmem/mca/memheap/base/base.h"
|
||||||
#include "oshmem/mca/spml/spml.h"
|
#include "oshmem/mca/spml/spml.h"
|
||||||
|
#include "oshmem/util/oshmem_util.h"
|
||||||
#include "opal/class/opal_hash_table.h"
|
#include "opal/class/opal_hash_table.h"
|
||||||
#include "ompi/mca/btl/btl.h"
|
#include "ompi/mca/btl/btl.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "oshmem/mca/memheap/memheap.h"
|
#include "oshmem/mca/memheap/memheap.h"
|
||||||
#include "oshmem/mca/memheap/base/base.h"
|
#include "oshmem/mca/memheap/base/base.h"
|
||||||
#include "oshmem/mca/spml/spml.h"
|
#include "oshmem/mca/spml/spml.h"
|
||||||
|
#include "oshmem/util/oshmem_util.h"
|
||||||
#include "opal/class/opal_hash_table.h"
|
#include "opal/class/opal_hash_table.h"
|
||||||
#include "ompi/mca/btl/btl.h"
|
#include "ompi/mca/btl/btl.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include "opal/mca/mca.h"
|
#include "opal/mca/mca.h"
|
||||||
#include "oshmem/mca/scoll/scoll.h"
|
#include "oshmem/mca/scoll/scoll.h"
|
||||||
|
#include "oshmem/util/oshmem_util.h"
|
||||||
|
|
||||||
BEGIN_C_DECLS
|
BEGIN_C_DECLS
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include "shmem.h"
|
#include "shmem.h"
|
||||||
#include "opal/mca/mca.h"
|
#include "opal/mca/mca.h"
|
||||||
#include "oshmem/mca/scoll/scoll.h"
|
#include "oshmem/mca/scoll/scoll.h"
|
||||||
|
#include "oshmem/util/oshmem_util.h"
|
||||||
#include "scoll_fca_api.h"
|
#include "scoll_fca_api.h"
|
||||||
#include "scoll_fca_debug.h"
|
#include "scoll_fca_debug.h"
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "oshmem_config.h"
|
#include "oshmem_config.h"
|
||||||
#include "oshmem/request/request.h"
|
#include "oshmem/request/request.h"
|
||||||
#include "oshmem/mca/spml/spml.h"
|
#include "oshmem/mca/spml/spml.h"
|
||||||
|
#include "oshmem/util/oshmem_util.h"
|
||||||
#include "oshmem/mca/spml/base/spml_base_putreq.h"
|
#include "oshmem/mca/spml/base/spml_base_putreq.h"
|
||||||
#include "oshmem/proc/proc.h"
|
#include "oshmem/proc/proc.h"
|
||||||
#include "oshmem/mca/spml/base/spml_base_request.h"
|
#include "oshmem/mca/spml/base/spml_base_request.h"
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "oshmem_config.h"
|
#include "oshmem_config.h"
|
||||||
#include "oshmem/request/request.h"
|
#include "oshmem/request/request.h"
|
||||||
#include "oshmem/mca/spml/spml.h"
|
#include "oshmem/mca/spml/spml.h"
|
||||||
|
#include "oshmem/util/oshmem_util.h"
|
||||||
#include "oshmem/mca/spml/base/spml_base_putreq.h"
|
#include "oshmem/mca/spml/base/spml_base_putreq.h"
|
||||||
#include "oshmem/proc/proc.h"
|
#include "oshmem/proc/proc.h"
|
||||||
#include "oshmem/mca/spml/base/spml_base_request.h"
|
#include "oshmem/mca/spml/base/spml_base_request.h"
|
||||||
|
@ -124,26 +124,3 @@ int oshmem_shmem_abort(int errcode)
|
|||||||
return OSHMEM_SUCCESS;
|
return OSHMEM_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
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_verbose(level, output_id, buff, file, line, function);
|
|
||||||
|
|
||||||
va_end(args);
|
|
||||||
|
|
||||||
free(buff);
|
|
||||||
free(str);
|
|
||||||
}
|
|
||||||
|
@ -12,17 +12,20 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef SHMEM_API_LOGGER_H
|
#ifndef SHMEM_API_LOGGER_H
|
||||||
#define SHMEM_API_LOGGER_H
|
#define SHMEM_API_LOGGER_H
|
||||||
|
|
||||||
#include "oshmem_config.h"
|
#include "oshmem_config.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
|
|
||||||
|
#include "oshmem/util/oshmem_util.h"
|
||||||
|
|
||||||
OSHMEM_DECLSPEC extern int shmem_api_logger_output;
|
OSHMEM_DECLSPEC extern int shmem_api_logger_output;
|
||||||
|
|
||||||
#ifdef __BASE_FILE__
|
#ifdef __BASE_FILE__
|
||||||
#define __SPML_FILE__ __BASE_FILE__
|
#define __SPML_FILE__ __BASE_FILE__
|
||||||
#else
|
#else
|
||||||
#define __SPML_FILE__ __FILE__
|
#define __SPML_FILE__ __FILE__
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void oshmem_output_verbose(int level, int output_id, const char* prefix, const char* file, int line, const char* function, const char* format, ...);
|
|
||||||
|
|
||||||
#ifdef OPAL_ENABLE_DEBUG
|
#ifdef OPAL_ENABLE_DEBUG
|
||||||
#define SHMEM_API_VERBOSE(level, ...) \
|
#define SHMEM_API_VERBOSE(level, ...) \
|
||||||
oshmem_output_verbose(level, shmem_api_logger_output, \
|
oshmem_output_verbose(level, shmem_api_logger_output, \
|
||||||
|
19
oshmem/util/Makefile.am
Обычный файл
19
oshmem/util/Makefile.am
Обычный файл
@ -0,0 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2014 Mellanox Technologies, Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
# # $COPYRIGHT$
|
||||||
|
#
|
||||||
|
# Additional copyrights may follow
|
||||||
|
#
|
||||||
|
# $HEADER$
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# This makefile.am does not stand on its own - it is included from oshmem/Makefile.am
|
||||||
|
|
||||||
|
|
||||||
|
headers += \
|
||||||
|
util/oshmem_util.h
|
||||||
|
|
||||||
|
liboshmem_la_SOURCES += \
|
||||||
|
util/oshmem_util.c
|
||||||
|
|
42
oshmem/util/oshmem_util.c
Обычный файл
42
oshmem/util/oshmem_util.c
Обычный файл
@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014 Mellanox Technologies, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
* $COPYRIGHT$
|
||||||
|
*
|
||||||
|
* Additional copyrights may follow
|
||||||
|
*
|
||||||
|
* $HEADER$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "oshmem_config.h"
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "opal/util/output.h"
|
||||||
|
|
||||||
|
#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, ...)
|
||||||
|
{
|
||||||
|
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_verbose(level, output_id, buff, file, line, function);
|
||||||
|
|
||||||
|
va_end(args);
|
||||||
|
|
||||||
|
free(buff);
|
||||||
|
free(str);
|
||||||
|
}
|
16
oshmem/util/oshmem_util.h
Обычный файл
16
oshmem/util/oshmem_util.h
Обычный файл
@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014 Mellanox Technologies, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
* $COPYRIGHT$
|
||||||
|
*
|
||||||
|
* Additional copyrights may follow
|
||||||
|
*
|
||||||
|
* $HEADER$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef OSHMEM_UTIL_H
|
||||||
|
#define 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, ...);
|
||||||
|
|
||||||
|
#endif /* OSHMEM_UTIL_H */
|
Загрузка…
x
Ссылка в новой задаче
Block a user