Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit cc69baf

Browse files
ggouaillardetigor-ivanov
authored andcommitted
btl/openib: fix abstraction violation and use opal_memory->memoryc_set_alignment
1 parent 0c98102 commit cc69baf

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

opal/mca/btl/openib/btl_openib_component.c

Lines changed: 3 additions & 19 deletions
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"
@@ -2503,14 +2489,12 @@ btl_openib_component_init(int *num_btl_modules,
25032489
*num_btl_modules = 0;
25042490
num_devs = 0;
25052491

2506-
#if MEMORY_LINUX_MALLOC_ALIGN_ENABLED
25072492
/* If we got this far, then setup the memory alloc hook (because
25082493
we're most likely going to be using this component). The hook
25092494
is to be set up as early as possible in this function since we
25102495
want most of the allocated resources be aligned.
25112496
*/
2512-
opal_memory_linux_malloc_set_alignment(32, mca_btl_openib_module.super.btl_eager_limit);
2513-
#endif /* MEMORY_LINUX_MALLOC_ALIGN_ENABLED */
2497+
opal_memory->memoryc_set_alignment(32, mca_btl_openib_module.super.btl_eager_limit);
25142498

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

0 commit comments

Comments
 (0)