revert previous commit
This commit was SVN r26206.
Этот коммит содержится в:
родитель
43a5775e8a
Коммит
ff1c84c53f
@ -121,18 +121,17 @@ lib_sources = $(sources)
|
||||
component =
|
||||
component_sources =
|
||||
endif
|
||||
|
||||
mcacomponentdir = $(pkglibdir)
|
||||
mcacomponent_LTLIBRARIES = $(component)
|
||||
mca_btl_openib_la_SOURCES = $(component_sources)
|
||||
mca_btl_openib_la_LDFLAGS = -module -avoid-version $(btl_openib_LDFLAGS) -lmca_memory_linux -L$(top_ompi_builddir)/opal/mca/memory/linux
|
||||
mca_btl_openib_la_LDFLAGS = -module -avoid-version $(btl_openib_LDFLAGS)
|
||||
mca_btl_openib_la_LIBADD = $(btl_openib_LIBS)
|
||||
|
||||
if MCA_ompi_cuda_support
|
||||
mca_btl_openib_la_LIBADD += \
|
||||
$(top_ompi_builddir)/ompi/mca/common/cuda/libmca_common_cuda.la
|
||||
endif
|
||||
|
||||
|
||||
noinst_LTLIBRARIES = $(lib)
|
||||
libmca_btl_openib_la_SOURCES = $(lib_sources)
|
||||
libmca_btl_openib_la_LDFLAGS= -module -avoid-version $(btl_openib_LDFLAGS)
|
||||
|
@ -98,7 +98,6 @@ const char *ibv_get_sysfs_path(void);
|
||||
#include "btl_openib_ip.h"
|
||||
#include "ompi/runtime/params.h"
|
||||
|
||||
#include "opal/mca/memory/linux/malloc.h"
|
||||
/*
|
||||
* Local functions
|
||||
*/
|
||||
@ -107,12 +106,11 @@ static int btl_openib_component_open(void);
|
||||
static int btl_openib_component_close(void);
|
||||
static mca_btl_base_module_t **btl_openib_component_init(int*, bool, bool);
|
||||
static int btl_openib_component_progress(void);
|
||||
|
||||
/*
|
||||
* Local variables
|
||||
*/
|
||||
static mca_btl_openib_device_t *receive_queues_device = NULL;
|
||||
static int btl_openib_use_memalign;
|
||||
void *__previous_malloc_hook;
|
||||
|
||||
mca_btl_openib_component_t mca_btl_openib_component = {
|
||||
{
|
||||
@ -170,30 +168,6 @@ static int btl_openib_component_register(void)
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/*This is a memory allocator hook from ptmalloc. The purpose of this is to make
|
||||
* every malloc aligned since this speeds up IB HCA work.
|
||||
* */
|
||||
|
||||
static void *btl_openib_malloc_hook(size_t sz, const __malloc_ptr_t caller)
|
||||
{
|
||||
return opal_memory_linux_memalign_hook(btl_openib_use_memalign,sz,caller);
|
||||
}
|
||||
|
||||
/*Set the malloc hook and save the previous malloc
|
||||
* */
|
||||
static void set_openib_malloc_hook()
|
||||
{
|
||||
__previous_malloc_hook = __malloc_hook;
|
||||
__malloc_hook = btl_openib_malloc_hook;
|
||||
}
|
||||
/*Restore the initial malloc hook
|
||||
* */
|
||||
static void unset_openib_malloc_hook()
|
||||
{
|
||||
__malloc_hook = __previous_malloc_hook;
|
||||
}
|
||||
|
||||
/*
|
||||
* Called by MCA framework to open the component
|
||||
*/
|
||||
@ -207,18 +181,6 @@ static int btl_openib_component_open(void)
|
||||
OBJ_CONSTRUCT(lock, opal_mutex_t);
|
||||
OBJ_CONSTRUCT(srq_addr_table, opal_hash_table_t);
|
||||
#endif
|
||||
mca_base_param_reg_int(&mca_btl_openib_component.super.btl_version,
|
||||
"memalign", "[64 | 32 | 0] - Enable (64bit or 32bit)/Disable(0) memory alignment for all malloc calls if btl openib is used (default 32)",
|
||||
false, false, 32, &btl_openib_use_memalign);
|
||||
|
||||
if (btl_openib_use_memalign == 32 || btl_openib_use_memalign == 64){
|
||||
set_openib_malloc_hook();
|
||||
}
|
||||
else if (btl_openib_use_memalign != 0){
|
||||
BTL_ERROR(("Wrong btl_openib_memalign parameter value: %i. Allowed values: 64, 32, 0. Default value (32) is used.", btl_openib_use_memalign));
|
||||
btl_openib_use_memalign = 32;
|
||||
set_openib_malloc_hook();
|
||||
}
|
||||
|
||||
/* initialize state */
|
||||
mca_btl_openib_component.ib_num_btls = 0;
|
||||
|
@ -693,7 +693,7 @@ static void *opal_memory_linux_realloc_hook(Void_t* ptr, size_t sz,
|
||||
return public_rEALLOc(ptr, sz);
|
||||
}
|
||||
|
||||
void *opal_memory_linux_memalign_hook(size_t alignment, size_t sz,
|
||||
static void *opal_memory_linux_memalign_hook(size_t alignment, size_t sz,
|
||||
const __malloc_ptr_t caller)
|
||||
{
|
||||
return public_mEMALIGn(alignment, sz);
|
||||
|
@ -167,10 +167,6 @@ OPAL_DECLSPEC extern __malloc_ptr_t (*__morecore) __MALLOC_PMT ((ptrdiff_t __siz
|
||||
OPAL_DECLSPEC extern __malloc_ptr_t __default_morecore __MALLOC_P ((ptrdiff_t __size))
|
||||
__attribute_malloc__;
|
||||
|
||||
|
||||
|
||||
OPAL_DECLSPEC extern void *opal_memory_linux_memalign_hook(size_t alignment, size_t sz,
|
||||
const __malloc_ptr_t caller);
|
||||
/* SVID2/XPG mallinfo structure */
|
||||
|
||||
struct mallinfo {
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user