diff --git a/ompi/datatype/ompi_datatype.h b/ompi/datatype/ompi_datatype.h index f589c874b64..b73cc213ff3 100644 --- a/ompi/datatype/ompi_datatype.h +++ b/ompi/datatype/ompi_datatype.h @@ -7,7 +7,7 @@ * Copyright (c) 2010-2017 Cisco Systems, Inc. All rights reserved * Copyright (c) 2013 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015-2018 Research Organization for Information Science + * Copyright (c) 2015-2020 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -407,5 +407,15 @@ OMPI_DECLSPEC int ompi_datatype_pack_external_size( const char datarep[], int in } \ } +#define OMPI_DATATYPE_RELEASE_NO_NULLIFY(ddt) \ + { \ + if( !ompi_datatype_is_predefined((ddt)) ) { \ + OPAL_OUTPUT_VERBOSE((0, 100, "Datatype %p [%s] refcount %d in file %s:%d\n", \ + (void*)(ddt), (ddt)->name, (ddt)->super.super.obj_reference_count, \ + __func__, __LINE__)); \ + OBJ_RELEASE_NO_NULLIFY((ddt)); \ + } \ + } + END_C_DECLS #endif /* OMPI_DATATYPE_H_HAS_BEEN_INCLUDED */ diff --git a/ompi/mca/coll/base/coll_base_util.c b/ompi/mca/coll/base/coll_base_util.c index 5736c0946ff..60df9f75b49 100644 --- a/ompi/mca/coll/base/coll_base_util.c +++ b/ompi/mca/coll/base/coll_base_util.c @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2014-2019 Research Organization for Information Science + * Copyright (c) 2014-2020 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -218,7 +218,7 @@ static void release_vecs_callback(ompi_coll_base_nbc_request_t *request) { if (NULL != request->data.vecs.stypes) { for (int i=0; idata.vecs.stypes[i]) { - OMPI_DATATYPE_RELEASE(request->data.vecs.stypes[i]); + OMPI_DATATYPE_RELEASE_NO_NULLIFY(request->data.vecs.stypes[i]); } } request->data.vecs.stypes = NULL; @@ -226,7 +226,7 @@ static void release_vecs_callback(ompi_coll_base_nbc_request_t *request) { if (NULL != request->data.vecs.rtypes) { for (int i=0; idata.vecs.rtypes[i]) { - OMPI_DATATYPE_RELEASE(request->data.vecs.rtypes[i]); + OMPI_DATATYPE_RELEASE_NO_NULLIFY(request->data.vecs.rtypes[i]); } } request->data.vecs.rtypes = NULL; @@ -255,7 +255,7 @@ static int free_vecs_callback(struct ompi_request_t **rptr) { } int ompi_coll_base_retain_datatypes_w( ompi_request_t *req, - ompi_datatype_t *stypes[], ompi_datatype_t *rtypes[]) { + ompi_datatype_t *const stypes[], ompi_datatype_t *const rtypes[]) { ompi_coll_base_nbc_request_t *request = (ompi_coll_base_nbc_request_t *)req; bool retain = false; ompi_communicator_t *comm = request->super.req_mpi_object.comm; diff --git a/ompi/mca/coll/base/coll_base_util.h b/ompi/mca/coll/base/coll_base_util.h index a5b80161240..705e84d72b0 100644 --- a/ompi/mca/coll/base/coll_base_util.h +++ b/ompi/mca/coll/base/coll_base_util.h @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2014-2019 Research Organization for Information Science + * Copyright (c) 2014-2020 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -52,8 +52,8 @@ struct ompi_coll_base_nbc_request_t { opal_object_t *objs[2]; } objs; struct { - ompi_datatype_t **stypes; - ompi_datatype_t **rtypes; + ompi_datatype_t * const *stypes; + ompi_datatype_t * const *rtypes; } vecs; } data; }; @@ -124,8 +124,8 @@ int ompi_coll_base_retain_datatypes( ompi_request_t *request, ompi_datatype_t *rtype); int ompi_coll_base_retain_datatypes_w( ompi_request_t *request, - ompi_datatype_t *stypes[], - ompi_datatype_t *rtypes[]); + ompi_datatype_t * const stypes[], + ompi_datatype_t * const rtypes[]); END_C_DECLS #endif /* MCA_COLL_BASE_UTIL_EXPORT_H */ diff --git a/ompi/mca/coll/libnbc/nbc_internal.h b/ompi/mca/coll/libnbc/nbc_internal.h index da9786dbb66..735beaa06e2 100644 --- a/ompi/mca/coll/libnbc/nbc_internal.h +++ b/ompi/mca/coll/libnbc/nbc_internal.h @@ -516,6 +516,11 @@ static inline int NBC_Unpack(void *src, int srccount, MPI_Datatype srctype, void int res; ptrdiff_t ext, lb; + res = ompi_datatype_pack_external_size("external32", srccount, srctype, &size); + if (OMPI_SUCCESS != res) { + NBC_Error ("MPI Error in ompi_datatype_pack_external_size() (%i)", res); + return res; + } #if OPAL_CUDA_SUPPORT if(NBC_Type_intrinsic(srctype) && !(opal_cuda_check_bufs((char *)tgt, (char *)src))) { #else @@ -523,7 +528,6 @@ static inline int NBC_Unpack(void *src, int srccount, MPI_Datatype srctype, void #endif /* OPAL_CUDA_SUPPORT */ /* if we have the same types and they are contiguous (intrinsic * types are contiguous), we can just use a single memcpy */ - res = ompi_datatype_pack_external_size("external32", srccount, srctype, &size); res = ompi_datatype_get_extent (srctype, &lb, &ext); if (OMPI_SUCCESS != res) { NBC_Error ("MPI Error in MPI_Type_extent() (%i)", res); diff --git a/ompi/mca/common/monitoring/Makefile.am b/ompi/mca/common/monitoring/Makefile.am index 1812245cdeb..60201f6dab3 100644 --- a/ompi/mca/common/monitoring/Makefile.am +++ b/ompi/mca/common/monitoring/Makefile.am @@ -28,6 +28,9 @@ lib_LTLIBRARIES += $(component_install) lib_LTLIBRARIES += ompi_monitoring_prof.la ompi_monitoring_prof_la_SOURCES = monitoring_prof.c +if OMPI_BUILD_FORTRAN_MPIFH_BINDINGS +ompi_monitoring_prof_la_SOURCES += monitoring_prof_f.c +endif ompi_monitoring_prof_la_LDFLAGS= \ -module -avoid-version -shared $(WRAPPER_EXTRA_LDFLAGS) ompi_monitoring_prof_la_LIBADD = \ diff --git a/ompi/mca/common/monitoring/monitoring_prof.c b/ompi/mca/common/monitoring/monitoring_prof.c index 3585c4927cf..3d5bd442ecd 100644 --- a/ompi/mca/common/monitoring/monitoring_prof.c +++ b/ompi/mca/common/monitoring/monitoring_prof.c @@ -378,67 +378,3 @@ int write_mat(char * filename, size_t * mat, unsigned int dim) return 0; } - -/** - * MPI binding for fortran - */ - -#include -#include "ompi_config.h" -#include "opal/threads/thread_usage.h" -#include "ompi/mpi/fortran/base/constants.h" -#include "ompi/mpi/fortran/base/fint_2_int.h" - -void monitoring_prof_mpi_init_f2c( MPI_Fint * ); -void monitoring_prof_mpi_finalize_f2c( MPI_Fint * ); - -void monitoring_prof_mpi_init_f2c( MPI_Fint *ierr ) { - int c_ierr; - int argc = 0; - char ** argv = NULL; - - c_ierr = MPI_Init(&argc, &argv); - if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); -} - -void monitoring_prof_mpi_finalize_f2c( MPI_Fint *ierr ) { - int c_ierr; - - c_ierr = MPI_Finalize(); - if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); -} - -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_INIT = monitoring_prof_mpi_init_f2c -#pragma weak mpi_init = monitoring_prof_mpi_init_f2c -#pragma weak mpi_init_ = monitoring_prof_mpi_init_f2c -#pragma weak mpi_init__ = monitoring_prof_mpi_init_f2c -#pragma weak MPI_Init_f = monitoring_prof_mpi_init_f2c -#pragma weak MPI_Init_f08 = monitoring_prof_mpi_init_f2c - -#pragma weak MPI_FINALIZE = monitoring_prof_mpi_finalize_f2c -#pragma weak mpi_finalize = monitoring_prof_mpi_finalize_f2c -#pragma weak mpi_finalize_ = monitoring_prof_mpi_finalize_f2c -#pragma weak mpi_finalize__ = monitoring_prof_mpi_finalize_f2c -#pragma weak MPI_Finalize_f = monitoring_prof_mpi_finalize_f2c -#pragma weak MPI_Finalize_f08 = monitoring_prof_mpi_finalize_f2c -#elif OMPI_BUILD_FORTRAN_BINDINGS -#define OMPI_F77_PROTOTYPES_MPI_H -#include "ompi/mpi/fortran/mpif-h/bindings.h" - -OMPI_GENERATE_F77_BINDINGS (MPI_INIT, - mpi_init, - mpi_init_, - mpi_init__, - monitoring_prof_mpi_init_f2c, - (MPI_Fint *ierr), - (ierr) ) - -OMPI_GENERATE_F77_BINDINGS (MPI_FINALIZE, - mpi_finalize, - mpi_finalize_, - mpi_finalize__, - monitoring_prof_mpi_finalize_f2c, - (MPI_Fint *ierr), - (ierr) ) -#endif diff --git a/ompi/mca/common/monitoring/monitoring_prof_f.c b/ompi/mca/common/monitoring/monitoring_prof_f.c new file mode 100644 index 00000000000..4e193a9b510 --- /dev/null +++ b/ompi/mca/common/monitoring/monitoring_prof_f.c @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2013-2017 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2013-2017 Inria. All rights reserved. + * Copyright (c) 2013-2015 Bull SAS. All rights reserved. + * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +/* + * MPI binding for fortran + */ + +#define OMPI_BUILD_MPI_PROFILING 0 +#define OMPI_COMPILING_FORTRAN_WRAPPERS 1 + +#include + +#include "ompi_config.h" + +#include "ompi/mpi/fortran/mpif-h/bindings.h" +#include "ompi/mpi/fortran/base/constants.h" + + +void monitoring_prof_mpi_init_f2c( MPI_Fint * ); +void monitoring_prof_mpi_finalize_f2c( MPI_Fint * ); + +void monitoring_prof_mpi_init_f2c( MPI_Fint *ierr ) { + int c_ierr; + int argc = 0; + char ** argv = NULL; + + c_ierr = PMPI_Init(&argc, &argv); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} + +void monitoring_prof_mpi_finalize_f2c( MPI_Fint *ierr ) { + int c_ierr; + + c_ierr = PMPI_Finalize(); + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); +} + +#if OPAL_HAVE_WEAK_SYMBOLS +#pragma weak MPI_INIT = monitoring_prof_mpi_init_f2c +#pragma weak mpi_init = monitoring_prof_mpi_init_f2c +#pragma weak mpi_init_ = monitoring_prof_mpi_init_f2c +#pragma weak mpi_init__ = monitoring_prof_mpi_init_f2c +#pragma weak MPI_Init_f = monitoring_prof_mpi_init_f2c +#pragma weak MPI_Init_f08 = monitoring_prof_mpi_init_f2c + +#pragma weak MPI_FINALIZE = monitoring_prof_mpi_finalize_f2c +#pragma weak mpi_finalize = monitoring_prof_mpi_finalize_f2c +#pragma weak mpi_finalize_ = monitoring_prof_mpi_finalize_f2c +#pragma weak mpi_finalize__ = monitoring_prof_mpi_finalize_f2c +#pragma weak MPI_Finalize_f = monitoring_prof_mpi_finalize_f2c +#pragma weak MPI_Finalize_f08 = monitoring_prof_mpi_finalize_f2c +#else + +OMPI_GENERATE_F77_BINDINGS (MPI_INIT, + mpi_init, + mpi_init_, + mpi_init__, + monitoring_prof_mpi_init_f2c, + (MPI_Fint *ierr), + (ierr) ) + +OMPI_GENERATE_F77_BINDINGS (MPI_FINALIZE, + mpi_finalize, + mpi_finalize_, + mpi_finalize__, + monitoring_prof_mpi_finalize_f2c, + (MPI_Fint *ierr), + (ierr) ) +#endif diff --git a/ompi/mca/osc/rdma/osc_rdma_dynamic.c b/ompi/mca/osc/rdma/osc_rdma_dynamic.c index a8c8116c64c..b5cde23d215 100644 --- a/ompi/mca/osc/rdma/osc_rdma_dynamic.c +++ b/ompi/mca/osc/rdma/osc_rdma_dynamic.c @@ -113,8 +113,8 @@ static bool ompi_osc_rdma_find_conflicting_attachment (ompi_osc_rdma_handle_t *h OPAL_LIST_FOREACH(attachment, &handle->attachments, ompi_osc_rdma_attachment_t) { intptr_t region_bound = attachment->base + attachment->len; - if (base >= attachment->base && base < region_bound || - bound > attachment->base && bound <= region_bound) { + if ((base >= attachment->base && base < region_bound) || + (bound > attachment->base && bound <= region_bound)) { OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "existing region {%p, %p} overlaps region {%p, %p}", (void *) attachment->base, (void *) region_bound, (void *) base, (void *) bound); return true; @@ -295,8 +295,7 @@ int ompi_osc_rdma_detach (struct ompi_win_t *win, const void *base) ompi_osc_rdma_handle_t *rdma_region_handle; osc_rdma_counter_t region_count, region_id; ompi_osc_rdma_region_t *region; - void *bound; - int start_index = INT_MAX, region_index; + int region_index; if (module->flavor != MPI_WIN_FLAVOR_DYNAMIC) { return OMPI_ERR_WIN; @@ -313,9 +312,10 @@ int ompi_osc_rdma_detach (struct ompi_win_t *win, const void *base) rdma_region_handle = module->dynamic_handles[region_index]; region = (ompi_osc_rdma_region_t *) ((intptr_t) module->state->regions + region_index * module->region_size); OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_INFO, "checking attachments at index %d {.base=%p, len=%lu} for attachment %p" - ", region handle=%p", region_index, (void *) region->base, region->len, base, rdma_region_handle); + ", region handle=%p", region_index, (void *) region->base, + (unsigned long) region->len, base, (void *) rdma_region_handle); - if (region->base > (uintptr_t) base || (region->base + region->len) < (uintptr_t) base) { + if (region->base > (intptr_t) base || (region->base + region->len) < (uintptr_t) base) { continue; } diff --git a/ompi/mca/osc/rdma/osc_rdma_types.h b/ompi/mca/osc/rdma/osc_rdma_types.h index f4f96b8ff38..bb3f500b99a 100644 --- a/ompi/mca/osc/rdma/osc_rdma_types.h +++ b/ompi/mca/osc/rdma/osc_rdma_types.h @@ -23,7 +23,7 @@ struct ompi_osc_rdma_peer_t; #if OPAL_HAVE_ATOMIC_MATH_64 typedef int64_t osc_rdma_base_t; -typedef int64_t osc_rdma_size_t; +typedef uint64_t osc_rdma_size_t; typedef int64_t osc_rdma_counter_t; #define ompi_osc_rdma_counter_add opal_atomic_add_fetch_64 @@ -31,7 +31,7 @@ typedef int64_t osc_rdma_counter_t; #else typedef int32_t osc_rdma_base_t; -typedef int32_t osc_rdma_size_t; +typedef uint32_t osc_rdma_size_t; typedef int32_t osc_rdma_counter_t; #define ompi_osc_rdma_counter_add opal_atomic_add_fetch_32 diff --git a/ompi/tools/mpisync/Makefile.am b/ompi/tools/mpisync/Makefile.am index e4e85b6f930..34e3f249f20 100644 --- a/ompi/tools/mpisync/Makefile.am +++ b/ompi/tools/mpisync/Makefile.am @@ -32,7 +32,7 @@ AM_CFLAGS = \ -DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" \ -DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \ -DOMPI_BUILD_USER="\"$$USER\"" \ - -DOMPI_BUILD_HOST="\"`$${HOSTNAME:-(hostname || uname -n) | sed 1q`\"" \ + -DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) | sed 1q`}\"" \ -DOMPI_BUILD_DATE="\"`$(top_srcdir)/config/getdate.sh`\"" \ -DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \ -DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \ diff --git a/ompi/tools/ompi_info/Makefile.am b/ompi/tools/ompi_info/Makefile.am index 9875701a6ea..d009ec8e7e1 100644 --- a/ompi/tools/ompi_info/Makefile.am +++ b/ompi/tools/ompi_info/Makefile.am @@ -28,7 +28,7 @@ AM_CFLAGS = \ -DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" \ -DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \ -DOMPI_BUILD_USER="\"$$USER\"" \ - -DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}\"" \ + -DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) | sed 1q`}\"" \ -DOMPI_BUILD_DATE="\"`$(top_srcdir)/config/getdate.sh`\"" \ -DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \ -DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \ diff --git a/opal/class/opal_object.h b/opal/class/opal_object.h index 4e2da95c204..45cb4ac0608 100644 --- a/opal/class/opal_object.h +++ b/opal/class/opal_object.h @@ -11,8 +11,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2007-2014 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2014 Research Organization for Information Science - * and Technology (RIST). All rights reserved. + * Copyright (c) 2014-2020 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ @@ -345,6 +345,27 @@ static inline opal_object_t *opal_obj_new_debug(opal_class_t* type, const char* } while (0) #endif +#if OPAL_ENABLE_DEBUG +#define OBJ_RELEASE_NO_NULLIFY(object) \ + do { \ + assert(OPAL_OBJ_MAGIC_ID == ((opal_object_t *) (object))->obj_magic_id); \ + assert(NULL != ((opal_object_t *) (object))->obj_class); \ + if (0 == opal_obj_update((opal_object_t *) (object), -1)) { \ + OBJ_SET_MAGIC_ID((object), 0); \ + opal_obj_run_destructors((opal_object_t *) (object)); \ + OBJ_REMEMBER_FILE_AND_LINENO( object, __FILE__, __LINE__ ); \ + free((void *) object); \ + } \ + } while (0) +#else +#define OBJ_RELEASE_NO_NULLIFY(object) \ + do { \ + if (0 == opal_obj_update((opal_object_t *) (object), -1)) { \ + opal_obj_run_destructors((opal_object_t *) (object)); \ + free((void *) object); \ + } \ + } while (0) +#endif /** * Construct (initialize) objects that are not dynamically allocated. diff --git a/opal/datatype/opal_convertor_raw.c b/opal/datatype/opal_convertor_raw.c index c00bf5ff4d3..9787df06663 100644 --- a/opal/datatype/opal_convertor_raw.c +++ b/opal/datatype/opal_convertor_raw.c @@ -41,7 +41,7 @@ opal_convertor_merge_iov( struct iovec* iov, uint32_t* iov_count, uint32_t* idx ) { if( 0 != iov[*idx].iov_len ) { - if( (base == ((char*)iov[*idx].iov_base + iov[*idx].iov_len)) ) { + if (base == ((char*)iov[*idx].iov_base + iov[*idx].iov_len)) { iov[*idx].iov_len += len; /* merge with previous iovec */ return 0; } /* cannot merge, move to the next position */ diff --git a/opal/datatype/opal_datatype_pack.h b/opal/datatype/opal_datatype_pack.h index cbe488b7b7e..2a2e79180dd 100644 --- a/opal/datatype/opal_datatype_pack.h +++ b/opal/datatype/opal_datatype_pack.h @@ -68,7 +68,7 @@ pack_partial_blocklen( opal_convertor_t* CONVERTOR, OPAL_DATATYPE_SAFEGUARD_POINTER( _memory, do_now_bytes, (CONVERTOR)->pBaseBuf, (CONVERTOR)->pDesc, (CONVERTOR)->count ); DO_DEBUG( opal_output( 0, "pack memcpy( %p, %p, %lu ) => space %lu [partial]\n", - _packed, (void*)_memory, (unsigned long)do_now_bytes, (unsigned long)(*(SPACE)) ); ); + (void*) _packed, (void*)_memory, (unsigned long)do_now_bytes, (unsigned long)(*(SPACE)) ); ); MEMCPY_CSUM( _packed, _memory, do_now_bytes, (CONVERTOR) ); *(memory) += (ptrdiff_t)do_now_bytes; if( do_now == left_in_block ) /* compensate if completed a blocklen */ diff --git a/opal/mca/btl/usnic/btl_usnic_cagent.c b/opal/mca/btl/usnic/btl_usnic_cagent.c index 386aec0a260..c1f8382af7c 100644 --- a/opal/mca/btl/usnic/btl_usnic_cagent.c +++ b/opal/mca/btl/usnic/btl_usnic_cagent.c @@ -44,7 +44,7 @@ static opal_event_t ipc_event; static struct timeval ack_timeout; static opal_list_t udp_port_listeners; static opal_list_t ipc_listeners; -static volatile int ipc_accepts = 0; +static volatile uint32_t ipc_accepts = 0; /* JMS The pings_pending and ping_results should probably both be hash tables for more efficient lookups */ static opal_list_t pings_pending; diff --git a/opal/mca/if/bsdx_ipv6/if_bsdx_ipv6.c b/opal/mca/if/bsdx_ipv6/if_bsdx_ipv6.c index d6cf3d6861f..2874a8e2c2c 100644 --- a/opal/mca/if/bsdx_ipv6/if_bsdx_ipv6.c +++ b/opal/mca/if/bsdx_ipv6/if_bsdx_ipv6.c @@ -1,6 +1,8 @@ /* * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -36,23 +38,7 @@ #include #endif #ifdef HAVE_NET_IF_H -#if defined(__APPLE__) && defined(_LP64) -/* Apple engineering suggested using options align=power as a - workaround for a bug in OS X 10.4 (Tiger) that prevented ioctl(..., - SIOCGIFCONF, ...) from working properly in 64 bit mode on Power PC. - It turns out that the underlying issue is the size of struct - ifconf, which the kernel expects to be 12 and natural 64 bit - alignment would make 16. The same bug appears in 64 bit mode on - Intel macs, but align=power is a no-op there, so instead, use the - pack pragma to instruct the compiler to pack on 4 byte words, which - has the same effect as align=power for our needs and works on both - Intel and Power PC Macs. */ -#pragma pack(push,4) -#endif #include -#if defined(__APPLE__) && defined(_LP64) -#pragma pack(pop) -#endif #endif #ifdef HAVE_NETDB_H #include diff --git a/opal/mca/if/if.h b/opal/mca/if/if.h index 5b3ae793c1b..4ce62b57dc3 100644 --- a/opal/mca/if/if.h +++ b/opal/mca/if/if.h @@ -3,6 +3,8 @@ * Copyright (c) 2010-2013 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -39,23 +41,7 @@ #include #endif #ifdef HAVE_NET_IF_H -#if defined(__APPLE__) && defined(_LP64) -/* Apple engineering suggested using options align=power as a - workaround for a bug in OS X 10.4 (Tiger) that prevented ioctl(..., - SIOCGIFCONF, ...) from working properly in 64 bit mode on Power PC. - It turns out that the underlying issue is the size of struct - ifconf, which the kernel expects to be 12 and natural 64 bit - alignment would make 16. The same bug appears in 64 bit mode on - Intel macs, but align=power is a no-op there, so instead, use the - pack pragma to instruct the compiler to pack on 4 byte words, which - has the same effect as align=power for our needs and works on both - Intel and Power PC Macs. */ -#pragma pack(push,4) -#endif #include -#if defined(__APPLE__) && defined(_LP64) -#pragma pack(pop) -#endif #endif #ifdef HAVE_NETDB_H #include diff --git a/opal/mca/if/linux_ipv6/if_linux_ipv6.c b/opal/mca/if/linux_ipv6/if_linux_ipv6.c index d566eb87b06..29b551de8f7 100644 --- a/opal/mca/if/linux_ipv6/if_linux_ipv6.c +++ b/opal/mca/if/linux_ipv6/if_linux_ipv6.c @@ -1,6 +1,8 @@ /* * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,23 +36,7 @@ #include #endif #ifdef HAVE_NET_IF_H -#if defined(__APPLE__) && defined(_LP64) -/* Apple engineering suggested using options align=power as a - workaround for a bug in OS X 10.4 (Tiger) that prevented ioctl(..., - SIOCGIFCONF, ...) from working properly in 64 bit mode on Power PC. - It turns out that the underlying issue is the size of struct - ifconf, which the kernel expects to be 12 and natural 64 bit - alignment would make 16. The same bug appears in 64 bit mode on - Intel macs, but align=power is a no-op there, so instead, use the - pack pragma to instruct the compiler to pack on 4 byte words, which - has the same effect as align=power for our needs and works on both - Intel and Power PC Macs. */ -#pragma pack(push,4) -#endif #include -#if defined(__APPLE__) && defined(_LP64) -#pragma pack(pop) -#endif #endif #ifdef HAVE_NETDB_H #include diff --git a/opal/mca/memory/patcher/configure.m4 b/opal/mca/memory/patcher/configure.m4 index 0c5d8553259..b80f8f3c69d 100644 --- a/opal/mca/memory/patcher/configure.m4 +++ b/opal/mca/memory/patcher/configure.m4 @@ -34,15 +34,27 @@ AC_DEFUN([MCA_opal_memory_patcher_COMPILE_MODE], [ # [action-if-cant-compile]) # ------------------------------------------------ AC_DEFUN([MCA_opal_memory_patcher_CONFIG],[ - AC_CONFIG_FILES([opal/mca/memory/patcher/Makefile]) - - AC_CHECK_FUNCS([__curbrk]) - - AC_CHECK_HEADERS([linux/mman.h sys/syscall.h]) + # disable on MacOS/Darwin where it isn't used and the deprecated + # syscall interface causes compiler warnings. + AC_MSG_CHECKING([if memory patcher supports $host_os]) + case $host_os in + darwin*) + opal_memory_patcher_happy=no + ;; + *) + opal_memory_patcher_happy=yes + ;; + esac + AC_MSG_RESULT([$opal_memory_patcher_happy]) + + AS_IF([test "$opal_memory_patcher_happy" == "yes"], [ + AC_CHECK_FUNCS([__curbrk]) + AC_CHECK_HEADERS([linux/mman.h sys/syscall.h]) + AC_CHECK_DECLS([__mmap], [], [], [#include ]) + AC_CHECK_FUNCS([__mmap]) + AC_CHECK_DECLS([__syscall], [], [], [#include ]) + AC_CHECK_FUNCS([__syscall]) + $1], [$2]) - AC_CHECK_DECLS([__syscall], [], [], [#include ]) - - AC_CHECK_FUNCS([__syscall]) - - [$1] + AC_CONFIG_FILES([opal/mca/memory/patcher/Makefile]) ]) diff --git a/opal/mca/memory/patcher/memory_patcher_component.c b/opal/mca/memory/patcher/memory_patcher_component.c index bb77b4175b7..f6405e9159c 100644 --- a/opal/mca/memory/patcher/memory_patcher_component.c +++ b/opal/mca/memory/patcher/memory_patcher_component.c @@ -55,6 +55,11 @@ #include "memory_patcher.h" #undef opal_memory_changed +#define HAS_SHMDT (defined(SYS_shmdt) || \ + (defined(IPCOP_shmdt) && defined(SYS_ipc))) +#define HAS_SHMAT (defined(SYS_shmat) || \ + (defined(IPCOP_shmat) && defined(SYS_ipc))) + static int patcher_open(void); static int patcher_close(void); static int patcher_register(void); @@ -113,15 +118,25 @@ opal_memory_patcher_component_t mca_memory_patcher_component = { */ static void *_intercept_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) __opal_attribute_noinline__; static int _intercept_munmap(void *start, size_t length) __opal_attribute_noinline__; +#if defined (SYS_mremap) #if defined(__linux__) static void *_intercept_mremap (void *start, size_t oldlen, size_t newlen, int flags, void *new_address) __opal_attribute_noinline__; #else static void *_intercept_mremap (void *start, size_t oldlen, void *new_address, size_t newlen, int flags) __opal_attribute_noinline__; -#endif +#endif // defined(__linux__) +#endif // defined(SYS_mremap) static int _intercept_madvise (void *start, size_t length, int advice) __opal_attribute_noinline__; +#if defined SYS_brk static int _intercept_brk (void *addr) __opal_attribute_noinline__; +#endif +#if defined(__linux__) +#if HAS_SHMAT static void *_intercept_shmat(int shmid, const void *shmaddr, int shmflg) __opal_attribute_noinline__; +#endif // HAS_SHMAT +#if HAS_SHMDT static int _intercept_shmdt (const void *shmaddr) __opal_attribute_noinline__; +#endif // HAS_SHMDT +#endif // defined(__linux__) #if defined (SYS_mmap) @@ -362,12 +377,8 @@ static int intercept_brk (void *addr) #define IPCOP_shmdt 22 #endif -#define HAS_SHMDT (defined(SYS_shmdt) || \ - (defined(IPCOP_shmdt) && defined(SYS_ipc))) -#define HAS_SHMAT (defined(SYS_shmat) || \ - (defined(IPCOP_shmat) && defined(SYS_ipc))) - -#if (HAS_SHMDT || HAS_SHMAT) && defined(__linux__) +#if defined(__linux__) +#if (HAS_SHMDT || HAS_SHMAT) #include #include @@ -443,8 +454,10 @@ static size_t get_shm_size(int shmid) return ds.shm_segsz; } #endif +#endif // defined(__linux__) -#if HAS_SHMAT && defined(__linux__) +#if defined(__linux__) +#if HAS_SHMAT static void *(*original_shmat)(int shmid, const void *shmaddr, int shmflg); static void *_intercept_shmat(int shmid, const void *shmaddr, int shmflg) @@ -490,8 +503,10 @@ static void* intercept_shmat (int shmid, const void * shmaddr, int shmflg) return result; } #endif +#endif // defined(__linux__) -#if HAS_SHMDT && defined(__linux__) +#if defined(__linux__) +#if HAS_SHMDT static int (*original_shmdt) (const void *); static int _intercept_shmdt (const void *shmaddr) @@ -523,6 +538,7 @@ static int intercept_shmdt (const void *shmaddr) return result; } #endif +#endif // defined(__linux__) static int patcher_register (void) { @@ -598,19 +614,21 @@ static int patcher_open (void) } #endif -#if HAS_SHMAT && defined(__linux__) +#if defined(__linux__) +#if HAS_SHMAT rc = opal_patcher->patch_symbol ("shmat", (uintptr_t) intercept_shmat, (uintptr_t *) &original_shmat); if (OPAL_SUCCESS != rc) { return rc; } -#endif +#endif // HAS_SHMAT -#if HAS_SHMDT && defined(__linux__) +#if HAS_SHMDT rc = opal_patcher->patch_symbol ("shmdt", (uintptr_t) intercept_shmdt, (uintptr_t *) &original_shmdt); if (OPAL_SUCCESS != rc) { return rc; } -#endif +#endif // HAS_SHMDT +#endif // defined(__linux__) #if defined (SYS_brk) rc = opal_patcher->patch_symbol ("brk", (uintptr_t)intercept_brk, (uintptr_t *) &original_brk); diff --git a/opal/mca/patcher/base/patcher_base_patch.c b/opal/mca/patcher/base/patcher_base_patch.c index 07e2c1ea345..9e949763f87 100644 --- a/opal/mca/patcher/base/patcher_base_patch.c +++ b/opal/mca/patcher/base/patcher_base_patch.c @@ -77,6 +77,7 @@ static int PatchLoadImm (uintptr_t addr, unsigned int reg, size_t value) #endif +#if !HAVE___CLEAR_CACHE static void flush_and_invalidate_cache (unsigned long a) { #if OPAL_ASSEMBLY_ARCH == OPAL_IA32 @@ -114,6 +115,7 @@ static void flush_and_invalidate_cache (unsigned long a) "isb":: "r" (a)); #endif } +#endif // !HAVE___CLEAR_CACHE // modify protection of memory range static void ModifyMemoryProtection (uintptr_t addr, size_t length, int prot) diff --git a/opal/mca/pmix/pmix3x/pmix3x.c b/opal/mca/pmix/pmix3x/pmix3x.c index 5e0e91342b0..90670f6adb6 100644 --- a/opal/mca/pmix/pmix3x/pmix3x.c +++ b/opal/mca/pmix/pmix3x/pmix3x.c @@ -1191,9 +1191,7 @@ int pmix3x_value_unload(opal_value_t *kv, /* handle the various types */ if (PMIX_INFO == v->data.darray->type) { pmix_info_t *iptr = (pmix_info_t*)v->data.darray->array; - if (NULL != iptr[n].key) { - ival->key = strdup(iptr[n].key); - } + ival->key = strdup(iptr[n].key); rc = pmix3x_value_unload(ival, &iptr[n].value); if (OPAL_SUCCESS != rc) { OPAL_LIST_RELEASE(lt); diff --git a/opal/util/if.c b/opal/util/if.c index caa549db9bb..70cfa7cf7a3 100644 --- a/opal/util/if.c +++ b/opal/util/if.c @@ -16,6 +16,8 @@ * reserved. * Copyright (c) 2015-2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -49,23 +51,7 @@ #include #endif #ifdef HAVE_NET_IF_H -#if defined(__APPLE__) && defined(_LP64) -/* Apple engineering suggested using options align=power as a - workaround for a bug in OS X 10.4 (Tiger) that prevented ioctl(..., - SIOCGIFCONF, ...) from working properly in 64 bit mode on Power PC. - It turns out that the underlying issue is the size of struct - ifconf, which the kernel expects to be 12 and natural 64 bit - alignment would make 16. The same bug appears in 64 bit mode on - Intel macs, but align=power is a no-op there, so instead, use the - pack pragma to instruct the compiler to pack on 4 byte words, which - has the same effect as align=power for our needs and works on both - Intel and Power PC Macs. */ -#pragma pack(push,4) -#endif #include -#if defined(__APPLE__) && defined(_LP64) -#pragma pack(pop) -#endif #endif #ifdef HAVE_NETDB_H #include diff --git a/opal/util/net.c b/opal/util/net.c index 77fcf25ff4b..c17e570404f 100644 --- a/opal/util/net.c +++ b/opal/util/net.c @@ -15,6 +15,8 @@ * Copyright (c) 2013 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -49,23 +51,7 @@ #include #endif #ifdef HAVE_NET_IF_H -#if defined(__APPLE__) && defined(_LP64) -/* Apple engineering suggested using options align=power as a - workaround for a bug in OS X 10.4 (Tiger) that prevented ioctl(..., - SIOCGIFCONF, ...) from working properly in 64 bit mode on Power PC. - It turns out that the underlying issue is the size of struct - ifconf, which the kernel expects to be 12 and natural 64 bit - alignment would make 16. The same bug appears in 64 bit mode on - Intel macs, but align=power is a no-op there, so instead, use the - pack pragma to instruct the compiler to pack on 4 byte words, which - has the same effect as align=power for our needs and works on both - Intel and Power PC Macs. */ -#pragma pack(push,4) -#endif #include -#if defined(__APPLE__) && defined(_LP64) -#pragma pack(pop) -#endif #endif #ifdef HAVE_NETDB_H #include diff --git a/opal/util/os_path.c b/opal/util/os_path.c index 251a6107fcf..e84ae87a461 100644 --- a/opal/util/os_path.c +++ b/opal/util/os_path.c @@ -32,7 +32,7 @@ static const char *path_sep = OPAL_PATH_SEP; -char *opal_os_path(bool relative, ...) +char *opal_os_path(int relative, ...) { va_list ap; char *element, *path; diff --git a/opal/util/os_path.h b/opal/util/os_path.h index 4c2db908f4a..d13cdd84110 100644 --- a/opal/util/os_path.h +++ b/opal/util/os_path.h @@ -62,8 +62,12 @@ BEGIN_C_DECLS * provided path elements, separated by the path separator character * appropriate to the local operating system. The path_name string has been malloc'd * and therefore the user is responsible for free'ing the field. -*/ -OPAL_DECLSPEC char *opal_os_path(bool relative, ...) __opal_attribute_malloc__ __opal_attribute_sentinel__ __opal_attribute_warn_unused_result__; + * + * NOTE: Since this is a varargs function, the last known parameter + * can't undergo a default promotion (e.g., from bool to int), because + * that is undefined behavior. Hence, the type of "relative" is int. + */ +OPAL_DECLSPEC char *opal_os_path(int relative, ...) __opal_attribute_malloc__ __opal_attribute_sentinel__ __opal_attribute_warn_unused_result__; /** * Convert the path to be OS friendly. On UNIX this function will diff --git a/opal/util/show_help.c b/opal/util/show_help.c index 18c82ccbffe..8d39e91de56 100644 --- a/opal/util/show_help.c +++ b/opal/util/show_help.c @@ -50,7 +50,7 @@ static char **search_dirs = NULL; static int opal_show_vhelp_internal(const char *filename, const char *topic, bool want_error_header, va_list arglist); static int opal_show_help_internal(const char *filename, const char *topic, - bool want_error_header, ...); + int want_error_header, ...); opal_show_help_fn_t opal_show_help = opal_show_help_internal; opal_show_vhelp_fn_t opal_show_vhelp = opal_show_vhelp_internal; @@ -317,7 +317,7 @@ char *opal_show_help_vstring(const char *filename, const char *topic, } char *opal_show_help_string(const char *filename, const char *topic, - bool want_error_handler, ...) + int want_error_handler, ...) { char *output; va_list arglist; @@ -349,7 +349,7 @@ static int opal_show_vhelp_internal(const char *filename, const char *topic, } static int opal_show_help_internal(const char *filename, const char *topic, - bool want_error_header, ...) + int want_error_header, ...) { va_list arglist; int rc; diff --git a/opal/util/show_help.h b/opal/util/show_help.h index 8806f059060..8d1967df9ca 100644 --- a/opal/util/show_help.h +++ b/opal/util/show_help.h @@ -127,9 +127,14 @@ OPAL_DECLSPEC int opal_show_help_finalize(void); * (typically $prefix/share/openmpi), and looks up the message * based on the topic, and displays it. If want_error_header is * true, a header and footer of asterisks are also displayed. + * + * NOTE: Since this is a varargs function, the last known parameter + * can't undergo a default promotion (e.g., from bool to int), because + * that is undefined behavior. Hence, the type of "want_error_header" + * is int. */ typedef int (*opal_show_help_fn_t)(const char *filename, const char *topic, - bool want_error_header, ...); + int want_error_header, ...); OPAL_DECLSPEC extern opal_show_help_fn_t opal_show_help; /** @@ -143,10 +148,15 @@ OPAL_DECLSPEC extern opal_show_vhelp_fn_t opal_show_vhelp; /** * This function does the same thing as opal_show_help(), but returns * its output in a string (that must be freed by the caller). + * + * NOTE: Since this is a varargs function, the last known parameter + * can't undergo a default promotion (e.g., from bool to int), because + * that is undefined behavior. Hence, the type of "want_error_header" + * is int. */ OPAL_DECLSPEC char* opal_show_help_string(const char *filename, const char *topic, - bool want_error_header, ...); + int want_error_header, ...); /** * This function does the same thing as opal_show_help_string(), but diff --git a/orte/mca/ess/base/ess_base_fns.c b/orte/mca/ess/base/ess_base_fns.c index fc97a4b4992..f87caad199f 100644 --- a/orte/mca/ess/base/ess_base_fns.c +++ b/orte/mca/ess/base/ess_base_fns.c @@ -74,19 +74,43 @@ int orte_ess_base_proc_binding(void) } OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_CPUSET, ORTE_PROC_MY_NAME, &orte_process_info.cpuset, OPAL_STRING); - /* try to get our locality as well */ - map = NULL; - OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_LOCALITY_STRING, - ORTE_PROC_MY_NAME, &map, OPAL_STRING); - if (OPAL_SUCCESS == ret && NULL != map) { - /* we were - no need to pull in the topology */ - if (opal_hwloc_report_bindings || 4 < opal_output_get_verbosity(orte_ess_base_framework.framework_output)) { - opal_output(0, "MCW rank %s bound to %s", - ORTE_VPID_PRINT(ORTE_PROC_MY_NAME->vpid), map); + + if (opal_hwloc_report_bindings || 4 < opal_output_get_verbosity(orte_ess_base_framework.framework_output)) { + /* try to get our locality as well so we avoid pulling in the hwloc topology tree */ + map = NULL; + OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_LOCALITY_STRING, + ORTE_PROC_MY_NAME, &map, OPAL_STRING); + if (OPAL_SUCCESS == ret && NULL != map) { + /* we were - no need to pull in the topology */ + opal_output(0, "MCW rank %s bound to %s", + ORTE_VPID_PRINT(ORTE_PROC_MY_NAME->vpid), map); + free(map); + } else if (OPAL_SUCCESS == ret && NULL == map) { + opal_output(0, "MCW rank %s not bound", ORTE_VPID_PRINT(ORTE_PROC_MY_NAME->vpid)); + } else { + /* they want the binding report, so we will have to obtain the + * topology since locality wasn't given to us */ + if (OPAL_SUCCESS != opal_hwloc_base_get_topology()) { + /* there is nothing we can do, so just return */ + return ORTE_SUCCESS; + } + mycpus = hwloc_bitmap_alloc(); + if (hwloc_get_cpubind(opal_hwloc_topology, + mycpus, HWLOC_CPUBIND_PROCESS) < 0) { + opal_output(0, "MCW rank %d is not bound", + ORTE_PROC_MY_NAME->vpid); + } else { + char tmp1[1024], tmp2[1024]; + if (OPAL_ERR_NOT_BOUND == opal_hwloc_base_cset2str(tmp1, sizeof(tmp1), opal_hwloc_topology, mycpus)) { + opal_output(0, "MCW rank %d is not bound (or bound to all available processors)", ORTE_PROC_MY_NAME->vpid); + } else { + opal_hwloc_base_cset2mapstr(tmp2, sizeof(tmp2), opal_hwloc_topology, mycpus); + opal_output(0, "MCW rank %d bound to %s: %s", + ORTE_PROC_MY_NAME->vpid, tmp1, tmp2); + } + } + hwloc_bitmap_free(mycpus); } - free(map); - } else { - opal_output(0, "MCW rank %s not bound", ORTE_VPID_PRINT(ORTE_PROC_MY_NAME->vpid)); } return ORTE_SUCCESS; } else if (NULL != getenv(OPAL_MCA_PREFIX"orte_externally_bound")) { @@ -99,18 +123,43 @@ int orte_ess_base_proc_binding(void) OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_CPUSET, ORTE_PROC_MY_NAME, &orte_process_info.cpuset, OPAL_STRING); - /* see if we also have our locality - this is the one we require */ - map = NULL; - OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_LOCALITY_STRING, - ORTE_PROC_MY_NAME, &map, OPAL_STRING); - if (OPAL_SUCCESS == ret && NULL != map) { - /* we were - no need to pull in the topology */ - if (opal_hwloc_report_bindings || 4 < opal_output_get_verbosity(orte_ess_base_framework.framework_output)) { - opal_output(0, "MCW rank %s bound to %s", - ORTE_VPID_PRINT(ORTE_PROC_MY_NAME->vpid), map); + + if (opal_hwloc_report_bindings || 4 < opal_output_get_verbosity(orte_ess_base_framework.framework_output)) { + /* try to get our locality as well so we avoid pulling in the hwloc topology tree */ + map = NULL; + OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_LOCALITY_STRING, + ORTE_PROC_MY_NAME, &map, OPAL_STRING); + if (OPAL_SUCCESS == ret && NULL != map) { + /* we were - no need to pull in the topology */ + opal_output(0, "MCW rank %s bound to %s", + ORTE_VPID_PRINT(ORTE_PROC_MY_NAME->vpid), map); + free(map); + } else if (OPAL_SUCCESS == ret && NULL == map) { + opal_output(0, "MCW rank %s not bound", ORTE_VPID_PRINT(ORTE_PROC_MY_NAME->vpid)); + } else { + /* they want the binding report, so we will have to obtain the + * topology since locality wasn't given to us */ + if (OPAL_SUCCESS != opal_hwloc_base_get_topology()) { + /* there is nothing we can do, so just return */ + return ORTE_SUCCESS; + } + mycpus = hwloc_bitmap_alloc(); + if (hwloc_get_cpubind(opal_hwloc_topology, + mycpus, HWLOC_CPUBIND_PROCESS) < 0) { + opal_output(0, "MCW rank %d is not bound", + ORTE_PROC_MY_NAME->vpid); + } else { + char tmp1[1024], tmp2[1024]; + if (OPAL_ERR_NOT_BOUND == opal_hwloc_base_cset2str(tmp1, sizeof(tmp1), opal_hwloc_topology, mycpus)) { + opal_output(0, "MCW rank %d is not bound (or bound to all available processors)", ORTE_PROC_MY_NAME->vpid); + } else { + opal_hwloc_base_cset2mapstr(tmp2, sizeof(tmp2), opal_hwloc_topology, mycpus); + opal_output(0, "MCW rank %d bound to %s: %s", + ORTE_PROC_MY_NAME->vpid, tmp1, tmp2); + } + } + hwloc_bitmap_free(mycpus); } - free(map); - return ORTE_SUCCESS; } /* the topology system will pickup the binding pattern */ } diff --git a/orte/mca/schizo/slurm/schizo_slurm.c b/orte/mca/schizo/slurm/schizo_slurm.c index c91e53b2e2a..69b8710d4a9 100644 --- a/orte/mca/schizo/slurm/schizo_slurm.c +++ b/orte/mca/schizo/slurm/schizo_slurm.c @@ -45,7 +45,6 @@ static bool myenvdefined = false; static orte_schizo_launch_environ_t check_launch_environment(void) { - char *bind, *list, *ptr; int i; if (myenvdefined) { diff --git a/orte/tools/orte-info/Makefile.am b/orte/tools/orte-info/Makefile.am index ac852a27c01..d14048c5205 100644 --- a/orte/tools/orte-info/Makefile.am +++ b/orte/tools/orte-info/Makefile.am @@ -25,7 +25,7 @@ AM_CFLAGS = \ -DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" \ -DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \ -DOMPI_BUILD_USER="\"$$USER\"" \ - -DOMPI_BUILD_HOST="\"`$${HOSTNAME:-(hostname || uname -n) | sed 1q`\"" \ + -DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) | sed 1q`}\"" \ -DOMPI_BUILD_DATE="\"`$(top_srcdir)/config/getdate.sh`\"" \ -DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \ -DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \ diff --git a/orte/util/show_help.c b/orte/util/show_help.c index 1b68c94580c..8490f2b3d78 100644 --- a/orte/util/show_help.c +++ b/orte/util/show_help.c @@ -591,7 +591,7 @@ void orte_show_help_finalize(void) } int orte_show_help(const char *filename, const char *topic, - bool want_error_header, ...) + int want_error_header, ...) { int rc = ORTE_SUCCESS; va_list arglist; diff --git a/orte/util/show_help.h b/orte/util/show_help.h index cb572e46345..f2645d6c299 100644 --- a/orte/util/show_help.h +++ b/orte/util/show_help.h @@ -78,7 +78,7 @@ ORTE_DECLSPEC void orte_show_help_finalize(void); * (e.g., cray). */ ORTE_DECLSPEC int orte_show_help(const char *filename, const char *topic, - bool want_error_header, ...); + int want_error_header, ...); /** * Exactly the same as orte_show_help, but pass in a rendered string, diff --git a/oshmem/tools/oshmem_info/Makefile.am b/oshmem/tools/oshmem_info/Makefile.am index 4f30236dd2b..03df12e126b 100644 --- a/oshmem/tools/oshmem_info/Makefile.am +++ b/oshmem/tools/oshmem_info/Makefile.am @@ -17,7 +17,7 @@ AM_CPPFLAGS = \ -DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" \ -DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \ -DOMPI_BUILD_USER="\"$$USER\"" \ - -DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}\"" \ + -DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) | sed 1q`}\"" \ -DOMPI_BUILD_DATE="\"`$(top_srcdir)/config/getdate.sh`\"" \ -DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \ -DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \