Skip to content

Commit 477991b

Browse files
committed
btl/openib: fix abstraction violation and use opal_memory->memoryc_set_alignment
1 parent d8482ce commit 477991b

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

opal/mca/btl/openib/btl_openib_component.c

+3-19
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* Copyright (c) 2011-2015 NVIDIA Corporation. All rights reserved.
2020
* Copyright (c) 2012 Oak Ridge National Laboratory. All rights reserved
2121
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
22-
* Copyright (c) 2014-2015 Research Organization for Information Science
22+
* Copyright (c) 2014-2016 Research Organization for Information Science
2323
* and Technology (RIST). All rights reserved.
2424
* Copyright (c) 2014 Bull SAS. All rights reserved.
2525
* $COPYRIGHT$
@@ -42,22 +42,8 @@
4242
#include <fcntl.h>
4343
#include <stdlib.h>
4444
#include <stddef.h>
45-
#if MEMORY_LINUX_MALLOC_ALIGN_ENABLED
46-
/*
47-
* The include of malloc.h below breaks abstractions in OMPI (by
48-
* directly including a header file from another component), but has
49-
* been ruled "ok" because the openib component is only supported on
50-
* Linux.
51-
*
52-
* The malloc hooks in newer glibc were deprecated, including stock
53-
* malloc.h causes compilation warnings. Instead, we use the internal
54-
* linux component malloc.h which does not cause these warnings.
55-
* Internally, OMPI uses the built-in ptmalloc from the linux memory
56-
* component anyway.
57-
*/
58-
#include "opal/mca/memory/linux/memory_linux.h"
59-
#endif
6045

46+
#include "opal/mca/memory/memory.h"
6147
#include "opal/mca/event/event.h"
6248
#include "opal/align.h"
6349
#include "opal/util/output.h"
@@ -2512,14 +2498,12 @@ btl_openib_component_init(int *num_btl_modules,
25122498
*num_btl_modules = 0;
25132499
num_devs = 0;
25142500

2515-
#if MEMORY_LINUX_MALLOC_ALIGN_ENABLED
25162501
/* If we got this far, then setup the memory alloc hook (because
25172502
we're most likely going to be using this component). The hook
25182503
is to be set up as early as possible in this function since we
25192504
want most of the allocated resources be aligned.
25202505
*/
2521-
opal_memory_linux_malloc_set_alignment(32, mca_btl_openib_module.super.btl_eager_limit);
2522-
#endif /* MEMORY_LINUX_MALLOC_ALIGN_ENABLED */
2506+
opal_memory->memoryc_set_alignment(32, mca_btl_openib_module.super.btl_eager_limit);
25232507

25242508
/* Per https://svn.open-mpi.org/trac/ompi/ticket/1305, check to
25252509
see if $sysfsdir/class/infiniband exists. If it does not,

0 commit comments

Comments
 (0)