From b51c4e27972acf38de93874e096f21689c2e5abf Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 16 Mar 2017 05:43:51 -0700 Subject: [PATCH 1/3] memory/patcher: fix a compiler warning Don't define the madvise intercept functions since we're not currently intercepting madvise. Signed-off-by: Jeff Squyres --- .../mca/memory/patcher/memory_patcher_component.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/opal/mca/memory/patcher/memory_patcher_component.c b/opal/mca/memory/patcher/memory_patcher_component.c index c49cb8ce51..991bc3c852 100644 --- a/opal/mca/memory/patcher/memory_patcher_component.c +++ b/opal/mca/memory/patcher/memory_patcher_component.c @@ -10,7 +10,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved * Copyright (c) 2013-2017 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2016 Research Organization for Information Science @@ -59,6 +59,11 @@ static int patcher_query (int *); static int mca_memory_patcher_priority; +/* NTH: we can't currently allow madvise to be intercepted due to a + * deadlock when running with glibc. In the future, we may re-enable + * this hook if the deadlock can be resolved. */ +#define WANT_INTERCEPT_MADVISE 0 + opal_memory_patcher_component_t mca_memory_patcher_component = { .super = { .memoryc_version = { @@ -244,6 +249,7 @@ static void *intercept_mremap (void *start, size_t oldlen, void *new_address, si #endif +#if WANT_INTERCEPT_MADVISE #if defined (SYS_madvise) static int (*original_madvise) (void *, size_t, int); @@ -278,6 +284,7 @@ static int intercept_madvise (void *start, size_t length, int advice) } #endif +#endif // WANT_INTERCEPT_MADVISE #if defined SYS_brk @@ -496,16 +503,14 @@ static int patcher_open (void) } #endif - /* NTH: we can't currently allow madvise to be intercepted due to a deadlock when running with glibc. in - * the future we may re-enable this hook if the deadlock can be resolved. */ -#if 0 +#if WANT_INTERCEPT_MADVISE #if defined (SYS_madvise) rc = opal_patcher->patch_symbol ("madvise", (uintptr_t)intercept_madvise, (uintptr_t *) &original_madvise); if (OPAL_SUCCESS != rc) { return rc; } #endif -#endif +#endif // WANT_INTERCEPT_MADVISE #if defined(SYS_shmdt) && defined(__linux__) rc = opal_patcher->patch_symbol ("shmdt", (uintptr_t) intercept_shmdt, (uintptr_t *) &original_shmdt); From 194728086588a24890c3e2d5543cde7e1d9e31b7 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 16 Mar 2017 05:44:26 -0700 Subject: [PATCH 2/3] topo/treematch: squash some compiler warnings Only define MIN/MAX if they are not already defined. Signed-off-by: Jeff Squyres --- ompi/mca/topo/treematch/treematch/tm_kpartitioning.c | 3 ++- ompi/mca/topo/treematch/treematch/tm_tree.c | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ompi/mca/topo/treematch/treematch/tm_kpartitioning.c b/ompi/mca/topo/treematch/treematch/tm_kpartitioning.c index 3aaed6a9fc..8f82b39da2 100644 --- a/ompi/mca/topo/treematch/treematch/tm_kpartitioning.c +++ b/ompi/mca/topo/treematch/treematch/tm_kpartitioning.c @@ -15,8 +15,9 @@ static int verbose_level = ERROR; #define MAX_TRIALS 10 #define USE_KL_STRATEGY 1 - +#if !defined(MIN) #define MIN(a,b) ((a)<(b)?(a):(b)) +#endif int fill_tab(int **,int *,int,int,int,int); diff --git a/ompi/mca/topo/treematch/treematch/tm_tree.c b/ompi/mca/topo/treematch/treematch/tm_tree.c index f9ec2a9a11..70c4ea58d6 100644 --- a/ompi/mca/topo/treematch/treematch/tm_tree.c +++ b/ompi/mca/topo/treematch/treematch/tm_tree.c @@ -12,8 +12,12 @@ #include "tm_thread_pool.h" +#if !defined(MIN) #define MIN(a,b) ((a)<(b)?(a):(b)) +#endif +#if !defined(MAX) #define MAX(a,b) ((a)>(b)?(a):(b)) +#endif #ifndef __CHARMC__ #define __CHARMC__ 0 From 760db0d5ce7ab2ea1a89b849003e3d13afb7d942 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 16 Mar 2017 05:46:11 -0700 Subject: [PATCH 3/3] osc/pt2pt: fix compiler warning Remove unused variable. Signed-off-by: Jeff Squyres --- ompi/mca/osc/pt2pt/osc_pt2pt_frag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt_frag.c b/ompi/mca/osc/pt2pt/osc_pt2pt_frag.c index 63208da877..e559e42b49 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt_frag.c +++ b/ompi/mca/osc/pt2pt/osc_pt2pt_frag.c @@ -5,6 +5,7 @@ * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2017 Cisco Systems, Inc. All rights reserved * $COPYRIGHT$ * * Additional copyrights may follow @@ -153,7 +154,6 @@ int ompi_osc_pt2pt_frag_flush_pending_all (ompi_osc_pt2pt_module_t *module) int ompi_osc_pt2pt_frag_flush_target (ompi_osc_pt2pt_module_t *module, int target) { ompi_osc_pt2pt_peer_t *peer = ompi_osc_pt2pt_peer_lookup (module, target); - ompi_osc_pt2pt_frag_t *frag; int ret = OMPI_SUCCESS; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output,