1
1

Merge pull request #8204 from jsquyres/pr/v4.1.x/fix-warnings

v4.1.x: fix many warnings
Этот коммит содержится в:
Raghu Raja 2020-11-23 17:28:44 -08:00 коммит произвёл GitHub
родитель d09771c5ba f9e2bf7c6b
Коммит 38011d3402
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
26 изменённых файлов: 201 добавлений и 118 удалений

Просмотреть файл

@ -7,7 +7,7 @@
* Copyright (c) 2010-2017 Cisco Systems, Inc. All rights reserved * Copyright (c) 2010-2017 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights * Copyright (c) 2013 Los Alamos National Security, LLC. All rights
* reserved. * 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. * and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $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 END_C_DECLS
#endif /* OMPI_DATATYPE_H_HAS_BEEN_INCLUDED */ #endif /* OMPI_DATATYPE_H_HAS_BEEN_INCLUDED */

Просмотреть файл

@ -624,7 +624,7 @@ int ompi_coll_adapt_ireduce_generic(const void *sbuf, void *rbuf, int count,
OPAL_OUTPUT_VERBOSE((30, mca_coll_adapt_component.adapt_output, OPAL_OUTPUT_VERBOSE((30, mca_coll_adapt_component.adapt_output,
"[%d]: distance %d, inbuf %p, inbuf->buff %p, inbuf->buff-lb %p, to_inbuf %p, inbuf_list %p\n", "[%d]: distance %d, inbuf %p, inbuf->buff %p, inbuf->buff-lb %p, to_inbuf %p, inbuf_list %p\n",
rank, con->distance, (void *) temp_inbuf, (void *) temp_inbuf->buff, rank, con->distance, (void *) temp_inbuf, (void *) temp_inbuf->buff,
(char *) temp_inbuf->buff - lower_bound, (void *) ((char *) temp_inbuf->buff - lower_bound),
(void *) to_inbuf((char *) temp_inbuf->buff - lower_bound, con->distance), (void *) to_inbuf((char *) temp_inbuf->buff - lower_bound, con->distance),
(void *) &con->inbuf_list)); (void *) &con->inbuf_list));
opal_free_list_return_st(&con->inbuf_list, (opal_free_list_item_t *) temp_inbuf); opal_free_list_return_st(&con->inbuf_list, (opal_free_list_item_t *) temp_inbuf);

Просмотреть файл

@ -100,7 +100,7 @@ int ompi_coll_base_allgatherv_intra_bruck(const void *sbuf, int scount,
{ {
int line = -1, err = 0, rank, size, sendto, recvfrom, distance, blockcount, i; int line = -1, err = 0, rank, size, sendto, recvfrom, distance, blockcount, i;
int *new_rcounts = NULL, *new_rdispls = NULL, *new_scounts = NULL, *new_sdispls = NULL; int *new_rcounts = NULL, *new_rdispls = NULL, *new_scounts = NULL, *new_sdispls = NULL;
ptrdiff_t slb, rlb, sext, rext; ptrdiff_t rlb, rext;
char *tmpsend = NULL, *tmprecv = NULL; char *tmpsend = NULL, *tmprecv = NULL;
struct ompi_datatype_t *new_rdtype, *new_sdtype; struct ompi_datatype_t *new_rdtype, *new_sdtype;
@ -226,7 +226,7 @@ int ompi_coll_base_allgatherv_intra_ring(const void *sbuf, int scount,
mca_coll_base_module_t *module) mca_coll_base_module_t *module)
{ {
int line = -1, rank, size, sendto, recvfrom, i, recvdatafrom, senddatafrom, err = 0; int line = -1, rank, size, sendto, recvfrom, i, recvdatafrom, senddatafrom, err = 0;
ptrdiff_t slb, rlb, sext, rext; ptrdiff_t rlb, rext;
char *tmpsend = NULL, *tmprecv = NULL; char *tmpsend = NULL, *tmprecv = NULL;
size = ompi_comm_size(comm); size = ompi_comm_size(comm);
@ -355,7 +355,7 @@ ompi_coll_base_allgatherv_intra_neighborexchange(const void *sbuf, int scount,
int line = -1, rank, size, i, even_rank, err = 0; int line = -1, rank, size, i, even_rank, err = 0;
int neighbor[2], offset_at_step[2], recv_data_from[2], send_data_from; int neighbor[2], offset_at_step[2], recv_data_from[2], send_data_from;
int new_scounts[2], new_sdispls[2], new_rcounts[2], new_rdispls[2]; int new_scounts[2], new_sdispls[2], new_rcounts[2], new_rdispls[2];
ptrdiff_t slb, rlb, sext, rext; ptrdiff_t rlb, rext;
char *tmpsend = NULL, *tmprecv = NULL; char *tmpsend = NULL, *tmprecv = NULL;
struct ompi_datatype_t *new_rdtype, *new_sdtype; struct ompi_datatype_t *new_rdtype, *new_sdtype;
@ -500,7 +500,7 @@ int ompi_coll_base_allgatherv_intra_two_procs(const void *sbuf, int scount,
{ {
int line = -1, err = 0, rank, remote; int line = -1, err = 0, rank, remote;
char *tmpsend = NULL, *tmprecv = NULL; char *tmpsend = NULL, *tmprecv = NULL;
ptrdiff_t sext, rext, lb; ptrdiff_t rext, lb;
rank = ompi_comm_rank(comm); rank = ompi_comm_rank(comm);

Просмотреть файл

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * 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. * and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
@ -220,7 +220,7 @@ static void release_vecs_callback(ompi_coll_base_nbc_request_t *request) {
if (NULL != request->data.vecs.stypes) { if (NULL != request->data.vecs.stypes) {
for (int i=0; i<scount; i++) { for (int i=0; i<scount; i++) {
if (NULL != request->data.vecs.stypes[i]) { if (NULL != request->data.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; request->data.vecs.stypes = NULL;
@ -228,7 +228,7 @@ static void release_vecs_callback(ompi_coll_base_nbc_request_t *request) {
if (NULL != request->data.vecs.rtypes) { if (NULL != request->data.vecs.rtypes) {
for (int i=0; i<rcount; i++) { for (int i=0; i<rcount; i++) {
if (NULL != request->data.vecs.rtypes[i]) { if (NULL != request->data.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; request->data.vecs.rtypes = NULL;

Просмотреть файл

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * 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. * and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
@ -58,8 +58,8 @@ struct ompi_coll_base_nbc_request_t {
opal_object_t *objs[2]; opal_object_t *objs[2];
} objs; } objs;
struct { struct {
ompi_datatype_t **stypes; ompi_datatype_t * const *stypes;
ompi_datatype_t **rtypes; ompi_datatype_t * const *rtypes;
} vecs; } vecs;
} data; } data;
}; };

Просмотреть файл

@ -28,6 +28,9 @@ lib_LTLIBRARIES += $(component_install)
lib_LTLIBRARIES += ompi_monitoring_prof.la lib_LTLIBRARIES += ompi_monitoring_prof.la
ompi_monitoring_prof_la_SOURCES = monitoring_prof.c 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= \ ompi_monitoring_prof_la_LDFLAGS= \
-module -avoid-version -shared $(WRAPPER_EXTRA_LDFLAGS) -module -avoid-version -shared $(WRAPPER_EXTRA_LDFLAGS)
ompi_monitoring_prof_la_LIBADD = \ ompi_monitoring_prof_la_LIBADD = \

Просмотреть файл

@ -378,67 +378,3 @@ int write_mat(char * filename, size_t * mat, unsigned int dim)
return 0; return 0;
} }
/**
* MPI binding for fortran
*/
#include <stdbool.h>
#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

Просмотреть файл

@ -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 <stdbool.h>
#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

Просмотреть файл

@ -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) { OPAL_LIST_FOREACH(attachment, &handle->attachments, ompi_osc_rdma_attachment_t) {
intptr_t region_bound = attachment->base + attachment->len; intptr_t region_bound = attachment->base + attachment->len;
if (base >= attachment->base && base < region_bound || if ((base >= attachment->base && base < region_bound) ||
bound > attachment->base && bound <= region_bound) { (bound > attachment->base && bound <= region_bound)) {
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "existing region {%p, %p} overlaps region {%p, %p}", 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); (void *) attachment->base, (void *) region_bound, (void *) base, (void *) bound);
return true; 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; ompi_osc_rdma_handle_t *rdma_region_handle;
osc_rdma_counter_t region_count, region_id; osc_rdma_counter_t region_count, region_id;
ompi_osc_rdma_region_t *region; ompi_osc_rdma_region_t *region;
void *bound; int region_index;
int start_index = INT_MAX, region_index;
if (module->flavor != MPI_WIN_FLAVOR_DYNAMIC) { if (module->flavor != MPI_WIN_FLAVOR_DYNAMIC) {
return OMPI_ERR_WIN; 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]; rdma_region_handle = module->dynamic_handles[region_index];
region = (ompi_osc_rdma_region_t *) ((intptr_t) module->state->regions + region_index * module->region_size); 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" 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; continue;
} }

Просмотреть файл

@ -23,7 +23,7 @@ struct ompi_osc_rdma_peer_t;
#if OPAL_HAVE_ATOMIC_MATH_64 #if OPAL_HAVE_ATOMIC_MATH_64
typedef int64_t osc_rdma_base_t; 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; typedef int64_t osc_rdma_counter_t;
#define ompi_osc_rdma_counter_add opal_atomic_add_fetch_64 #define ompi_osc_rdma_counter_add opal_atomic_add_fetch_64
@ -31,7 +31,7 @@ typedef int64_t osc_rdma_counter_t;
#else #else
typedef int32_t osc_rdma_base_t; 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; typedef int32_t osc_rdma_counter_t;
#define ompi_osc_rdma_counter_add opal_atomic_add_fetch_32 #define ompi_osc_rdma_counter_add opal_atomic_add_fetch_32

Просмотреть файл

@ -28,7 +28,7 @@ AM_CFLAGS = \
-DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" \ -DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" \
-DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \ -DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \
-DOMPI_BUILD_USER="\"$$USER\"" \ -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_DATE="\"`$(top_srcdir)/config/getdate.sh`\"" \
-DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \ -DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \
-DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \ -DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \

Просмотреть файл

@ -11,8 +11,8 @@
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2007-2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007-2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science * Copyright (c) 2014-2020 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights * Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* $COPYRIGHT$ * $COPYRIGHT$
@ -345,6 +345,27 @@ static inline opal_object_t *opal_obj_new_debug(opal_class_t* type, const char*
} while (0) } while (0)
#endif #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. * Construct (initialize) objects that are not dynamically allocated.

Просмотреть файл

@ -41,7 +41,7 @@ opal_convertor_merge_iov( struct iovec* iov, uint32_t* iov_count,
uint32_t* idx ) uint32_t* idx )
{ {
if( 0 != iov[*idx].iov_len ) { 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 */ iov[*idx].iov_len += len; /* merge with previous iovec */
return 0; return 0;
} /* cannot merge, move to the next position */ } /* cannot merge, move to the next position */

Просмотреть файл

@ -68,7 +68,7 @@ pack_partial_blocklen( opal_convertor_t* CONVERTOR,
OPAL_DATATYPE_SAFEGUARD_POINTER( _memory, do_now_bytes, (CONVERTOR)->pBaseBuf, OPAL_DATATYPE_SAFEGUARD_POINTER( _memory, do_now_bytes, (CONVERTOR)->pBaseBuf,
(CONVERTOR)->pDesc, (CONVERTOR)->count ); (CONVERTOR)->pDesc, (CONVERTOR)->count );
DO_DEBUG( opal_output( 0, "pack memcpy( %p, %p, %lu ) => space %lu [partial]\n", 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) ); MEMCPY_CSUM( _packed, _memory, do_now_bytes, (CONVERTOR) );
*(memory) += (ptrdiff_t)do_now_bytes; *(memory) += (ptrdiff_t)do_now_bytes;
if( do_now == left_in_block ) /* compensate if completed a blocklen */ if( do_now == left_in_block ) /* compensate if completed a blocklen */

Просмотреть файл

@ -44,7 +44,7 @@ static opal_event_t ipc_event;
static struct timeval ack_timeout; static struct timeval ack_timeout;
static opal_list_t udp_port_listeners; static opal_list_t udp_port_listeners;
static opal_list_t ipc_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 /* JMS The pings_pending and ping_results should probably both be hash
tables for more efficient lookups */ tables for more efficient lookups */
static opal_list_t pings_pending; static opal_list_t pings_pending;

Просмотреть файл

@ -55,6 +55,11 @@
#include "memory_patcher.h" #include "memory_patcher.h"
#undef opal_memory_changed #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_open(void);
static int patcher_close(void); static int patcher_close(void);
static int patcher_register(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 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__; static int _intercept_munmap(void *start, size_t length) __opal_attribute_noinline__;
#if defined (SYS_mremap)
#if defined(__linux__) #if defined(__linux__)
static void *_intercept_mremap (void *start, size_t oldlen, size_t newlen, int flags, void *new_address) __opal_attribute_noinline__; static void *_intercept_mremap (void *start, size_t oldlen, size_t newlen, int flags, void *new_address) __opal_attribute_noinline__;
#else #else
static void *_intercept_mremap (void *start, size_t oldlen, void *new_address, size_t newlen, int flags) __opal_attribute_noinline__; 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__; 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__; 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__; 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__; static int _intercept_shmdt (const void *shmaddr) __opal_attribute_noinline__;
#endif // HAS_SHMDT
#endif // defined(__linux__)
#if defined (SYS_mmap) #if defined (SYS_mmap)
@ -362,12 +377,8 @@ static int intercept_brk (void *addr)
#define IPCOP_shmdt 22 #define IPCOP_shmdt 22
#endif #endif
#define HAS_SHMDT (defined(SYS_shmdt) || \ #if defined(__linux__)
(defined(IPCOP_shmdt) && defined(SYS_ipc))) #if (HAS_SHMDT || HAS_SHMAT)
#define HAS_SHMAT (defined(SYS_shmat) || \
(defined(IPCOP_shmat) && defined(SYS_ipc)))
#if (HAS_SHMDT || HAS_SHMAT) && defined(__linux__)
#include <stdio.h> #include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
@ -443,8 +454,10 @@ static size_t get_shm_size(int shmid)
return ds.shm_segsz; return ds.shm_segsz;
} }
#endif #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 *(*original_shmat)(int shmid, const void *shmaddr, int shmflg);
static void *_intercept_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; return result;
} }
#endif #endif
#endif // defined(__linux__)
#if HAS_SHMDT && defined(__linux__) #if defined(__linux__)
#if HAS_SHMDT
static int (*original_shmdt) (const void *); static int (*original_shmdt) (const void *);
static int _intercept_shmdt (const void *shmaddr) static int _intercept_shmdt (const void *shmaddr)
@ -523,6 +538,7 @@ static int intercept_shmdt (const void *shmaddr)
return result; return result;
} }
#endif #endif
#endif // defined(__linux__)
static int patcher_register (void) static int patcher_register (void)
{ {
@ -598,19 +614,21 @@ static int patcher_open (void)
} }
#endif #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); rc = opal_patcher->patch_symbol ("shmat", (uintptr_t) intercept_shmat, (uintptr_t *) &original_shmat);
if (OPAL_SUCCESS != rc) { if (OPAL_SUCCESS != rc) {
return 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); rc = opal_patcher->patch_symbol ("shmdt", (uintptr_t) intercept_shmdt, (uintptr_t *) &original_shmdt);
if (OPAL_SUCCESS != rc) { if (OPAL_SUCCESS != rc) {
return rc; return rc;
} }
#endif #endif // HAS_SHMDT
#endif // defined(__linux__)
#if defined (SYS_brk) #if defined (SYS_brk)
rc = opal_patcher->patch_symbol ("brk", (uintptr_t)intercept_brk, (uintptr_t *) &original_brk); rc = opal_patcher->patch_symbol ("brk", (uintptr_t)intercept_brk, (uintptr_t *) &original_brk);

Просмотреть файл

@ -77,6 +77,7 @@ static int PatchLoadImm (uintptr_t addr, unsigned int reg, size_t value)
#endif #endif
#if !HAVE___CLEAR_CACHE
static void flush_and_invalidate_cache (unsigned long a) static void flush_and_invalidate_cache (unsigned long a)
{ {
#if OPAL_ASSEMBLY_ARCH == OPAL_IA32 #if OPAL_ASSEMBLY_ARCH == OPAL_IA32
@ -114,6 +115,7 @@ static void flush_and_invalidate_cache (unsigned long a)
"isb":: "r" (a)); "isb":: "r" (a));
#endif #endif
} }
#endif // !HAVE___CLEAR_CACHE
// modify protection of memory range // modify protection of memory range
static void ModifyMemoryProtection (uintptr_t addr, size_t length, int prot) static void ModifyMemoryProtection (uintptr_t addr, size_t length, int prot)

Просмотреть файл

@ -1191,9 +1191,7 @@ int pmix3x_value_unload(opal_value_t *kv,
/* handle the various types */ /* handle the various types */
if (PMIX_INFO == v->data.darray->type) { if (PMIX_INFO == v->data.darray->type) {
pmix_info_t *iptr = (pmix_info_t*)v->data.darray->array; 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); rc = pmix3x_value_unload(ival, &iptr[n].value);
if (OPAL_SUCCESS != rc) { if (OPAL_SUCCESS != rc) {
OPAL_LIST_RELEASE(lt); OPAL_LIST_RELEASE(lt);

Просмотреть файл

@ -32,7 +32,7 @@
static const char *path_sep = OPAL_PATH_SEP; static const char *path_sep = OPAL_PATH_SEP;
char *opal_os_path(bool relative, ...) char *opal_os_path(int relative, ...)
{ {
va_list ap; va_list ap;
char *element, *path; char *element, *path;

Просмотреть файл

@ -62,8 +62,12 @@ BEGIN_C_DECLS
* provided path elements, separated by the path separator character * provided path elements, separated by the path separator character
* appropriate to the local operating system. The path_name string has been malloc'd * 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. * 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 * Convert the path to be OS friendly. On UNIX this function will

Просмотреть файл

@ -50,7 +50,7 @@ static char **search_dirs = NULL;
static int opal_show_vhelp_internal(const char *filename, const char *topic, static int opal_show_vhelp_internal(const char *filename, const char *topic,
bool want_error_header, va_list arglist); bool want_error_header, va_list arglist);
static int opal_show_help_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, ...);
opal_show_help_fn_t opal_show_help = opal_show_help_internal; opal_show_help_fn_t opal_show_help = opal_show_help_internal;
opal_show_vhelp_fn_t opal_show_vhelp = opal_show_vhelp_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, char *opal_show_help_string(const char *filename, const char *topic,
bool want_error_handler, ...) int want_error_handler, ...)
{ {
char *output; char *output;
va_list arglist; 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, static int opal_show_help_internal(const char *filename, const char *topic,
bool want_error_header, ...) int want_error_header, ...)
{ {
va_list arglist; va_list arglist;
int rc; int rc;

Просмотреть файл

@ -127,9 +127,14 @@ OPAL_DECLSPEC int opal_show_help_finalize(void);
* (typically $prefix/share/openmpi), and looks up the message * (typically $prefix/share/openmpi), and looks up the message
* based on the topic, and displays it. If want_error_header is * based on the topic, and displays it. If want_error_header is
* true, a header and footer of asterisks are also displayed. * 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, 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; 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 * This function does the same thing as opal_show_help(), but returns
* its output in a string (that must be freed by the caller). * 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, OPAL_DECLSPEC char* opal_show_help_string(const char *filename,
const char *topic, const char *topic,
bool want_error_header, ...); int want_error_header, ...);
/** /**
* This function does the same thing as opal_show_help_string(), but * This function does the same thing as opal_show_help_string(), but

Просмотреть файл

@ -45,7 +45,6 @@ static bool myenvdefined = false;
static orte_schizo_launch_environ_t check_launch_environment(void) static orte_schizo_launch_environ_t check_launch_environment(void)
{ {
char *bind, *list, *ptr;
int i; int i;
if (myenvdefined) { if (myenvdefined) {

Просмотреть файл

@ -591,7 +591,7 @@ void orte_show_help_finalize(void)
} }
int orte_show_help(const char *filename, const char *topic, int orte_show_help(const char *filename, const char *topic,
bool want_error_header, ...) int want_error_header, ...)
{ {
int rc = ORTE_SUCCESS; int rc = ORTE_SUCCESS;
va_list arglist; va_list arglist;

Просмотреть файл

@ -78,7 +78,7 @@ ORTE_DECLSPEC void orte_show_help_finalize(void);
* (e.g., cray). * (e.g., cray).
*/ */
ORTE_DECLSPEC int orte_show_help(const char *filename, const char *topic, 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, * Exactly the same as orte_show_help, but pass in a rendered string,

Просмотреть файл

@ -17,7 +17,7 @@ AM_CPPFLAGS = \
-DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" \ -DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" \
-DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \ -DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \
-DOMPI_BUILD_USER="\"$$USER\"" \ -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_DATE="\"`$(top_srcdir)/config/getdate.sh`\"" \
-DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \ -DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \
-DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \ -DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \