diff --git a/ompi/mca/bcol/basesmuma/bcol_basesmuma_smcm.c b/ompi/mca/bcol/basesmuma/bcol_basesmuma_smcm.c index 96ca6dcb4b..e0c23cae62 100644 --- a/ompi/mca/bcol/basesmuma/bcol_basesmuma_smcm.c +++ b/ompi/mca/bcol/basesmuma/bcol_basesmuma_smcm.c @@ -5,7 +5,7 @@ * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved. * Copyright (c) 2012-2016 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2014 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2016 Intel, Inc. All rights reserved. * Copyright (c) 2014-2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -444,7 +444,7 @@ static bcol_basesmuma_smcm_mmap_t * bcol_basesmuma_smcm_reg_mmap(void *in_ptr, i /* is addr past the end of the file? */ if ((unsigned char *) seg+length < myaddr) { opal_output (ompi_bcol_base_framework.framework_output, "mca_bcol_basesmuma_sm_alloc_mmap: memory region too small len %lu add %p", - (unsigned long) length, myaddr); + (unsigned long) length, (void*)myaddr); OBJ_RELEASE(map); munmap ((void *)seg, length); return NULL; diff --git a/ompi/mca/coll/tuned/coll_tuned_module.c b/ompi/mca/coll/tuned/coll_tuned_module.c index b09ae0c664..9f31284477 100644 --- a/ompi/mca/coll/tuned/coll_tuned_module.c +++ b/ompi/mca/coll/tuned/coll_tuned_module.c @@ -10,6 +10,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2016 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -120,7 +121,7 @@ ompi_coll_tuned_forced_getvalues( enum COLLTYPE type, coll_tuned_force_algorithm_params_t *forced_values ) { coll_tuned_force_algorithm_mca_param_indices_t* mca_params; - const int *tmp; + const int *tmp = NULL; mca_params = &(ompi_coll_tuned_forced_params[type]); diff --git a/ompi/mca/osc/rdma/osc_rdma.h b/ompi/mca/osc/rdma/osc_rdma.h index 8f70409e1c..eb22898ca5 100644 --- a/ompi/mca/osc/rdma/osc_rdma.h +++ b/ompi/mca/osc/rdma/osc_rdma.h @@ -12,6 +12,7 @@ * reserved. * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2012-2013 Sandia National Laboratories. All rights reserved. + * Copyright (c) 2016 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -325,7 +326,7 @@ static inline int _ompi_osc_rdma_register (ompi_osc_rdma_module_t *module, struc { if (module->selected_btl->btl_register_mem) { OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_INFO, "registering segment with btl. range: %p - %p (%lu bytes)", - ptr, (char *) ptr + size, size); + ptr, (void*)((char *) ptr + size), size); *handle = module->selected_btl->btl_register_mem (module->selected_btl, endpoint, ptr, size, flags); if (OPAL_UNLIKELY(NULL == *handle)) { diff --git a/ompi/mca/osc/rdma/osc_rdma_accumulate.c b/ompi/mca/osc/rdma/osc_rdma_accumulate.c index b12c94aa21..0fd2bbdd6e 100644 --- a/ompi/mca/osc/rdma/osc_rdma_accumulate.c +++ b/ompi/mca/osc/rdma/osc_rdma_accumulate.c @@ -4,6 +4,7 @@ * reserved. * Copyright (c) 2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2016 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -237,7 +238,7 @@ static inline int ompi_osc_rdma_gacc_contig (ompi_osc_rdma_sync_t *sync, const v target_address = target_address & ~btl_alignment_mask; OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "initiating btl get. local: %p (handle %p), remote: 0x%" PRIx64 - " (handle %p)", ptr, (void *) frag->handle, target_address, (void *) target_handle); + " (handle %p)", (void*)ptr, (void *) frag->handle, target_address, (void *) target_handle); ret = module->selected_btl->btl_get (module->selected_btl, peer->data_endpoint, ptr, target_address, frag->handle, target_handle, aligned_len, @@ -248,7 +249,7 @@ static inline int ompi_osc_rdma_gacc_contig (ompi_osc_rdma_sync_t *sync, const v memcpy (ptr, source, len); OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "initiating btl put. local: %p (handle %p), remote: 0x%" PRIx64 - " (handle %p)", ptr, (void *) frag->handle, target_address, (void *) target_handle); + " (handle %p)", (void*)ptr, (void *) frag->handle, target_address, (void *) target_handle); ret = module->selected_btl->btl_put (module->selected_btl, peer->data_endpoint, ptr, target_address, frag->handle, target_handle, len, 0, diff --git a/ompi/mca/osc/rdma/osc_rdma_comm.c b/ompi/mca/osc/rdma/osc_rdma_comm.c index 7efde7c39b..d4daad37b6 100644 --- a/ompi/mca/osc/rdma/osc_rdma_comm.c +++ b/ompi/mca/osc/rdma/osc_rdma_comm.c @@ -2,6 +2,7 @@ /* * Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2016 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -50,7 +51,7 @@ int ompi_osc_get_data_blocking (ompi_osc_rdma_module_t *module, struct mca_btl_b } local_handle = frag->handle; - OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "allocated temporary buffer %p in fragment %p", ptr, + OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "allocated temporary buffer %p in fragment %p", (void*)ptr, (void *) frag); } @@ -732,7 +733,7 @@ static int ompi_osc_rdma_get_contig (ompi_osc_rdma_sync_t *sync, ompi_osc_rdma_p } } else { OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "using internal buffer %p in fragment %p for get of size %lu bytes, source address 0x%lx", - ptr, (void *) frag, (unsigned long) aligned_len, (unsigned long) aligned_source_base); + (void*)ptr, (void *) frag, (unsigned long) aligned_len, (unsigned long) aligned_source_base); local_handle = frag->handle; } } diff --git a/ompi/mpi/tool/cvar_read.c b/ompi/mpi/tool/cvar_read.c index 843ca493f8..e79df41f81 100644 --- a/ompi/mpi/tool/cvar_read.c +++ b/ompi/mpi/tool/cvar_read.c @@ -3,6 +3,7 @@ * Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2016 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -23,7 +24,7 @@ int MPI_T_cvar_read (MPI_T_cvar_handle handle, void *buf) { - const mca_base_var_storage_t *value; + const mca_base_var_storage_t *value = NULL; int rc = MPI_SUCCESS; if (!mpit_is_initialized ()) { @@ -38,7 +39,7 @@ int MPI_T_cvar_read (MPI_T_cvar_handle handle, void *buf) do { rc = mca_base_var_get_value(handle->var->mbv_index, &value, NULL, NULL); - if (OPAL_SUCCESS != rc) { + if (OPAL_SUCCESS != rc || NULL == value) { /* shouldn't happen */ rc = MPI_ERR_OTHER; break; diff --git a/ompi/runtime/ompi_mpi_preconnect.c b/ompi/runtime/ompi_mpi_preconnect.c index 79008c2643..0fac35d517 100644 --- a/ompi/runtime/ompi_mpi_preconnect.c +++ b/ompi/runtime/ompi_mpi_preconnect.c @@ -7,6 +7,7 @@ * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2016 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,12 +33,12 @@ ompi_init_preconnect_mpi(void) int param, next, prev, i, ret = OMPI_SUCCESS; struct ompi_request_t * requests[2]; char inbuf[1], outbuf[1]; - const bool *value; + const bool *value = NULL; param = mca_base_var_find("ompi", "mpi", NULL, "preconnect_mpi"); if (0 > param) return OMPI_SUCCESS; ret = mca_base_var_get_value(param, &value, NULL, NULL); - if (OMPI_SUCCESS != ret || 0 == value[0]) { + if (OMPI_SUCCESS != ret || (NULL != value && 0 == value[0])) { return OMPI_SUCCESS; } diff --git a/opal/mca/hwloc/base/hwloc_base_frame.c b/opal/mca/hwloc/base/hwloc_base_frame.c index 25e00e6751..bb5e8d980f 100644 --- a/opal/mca/hwloc/base/hwloc_base_frame.c +++ b/opal/mca/hwloc/base/hwloc_base_frame.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2013-2015 Intel, Inc. All rights reserved. + * Copyright (c) 2013-2016 Intel, Inc. All rights reserved. * Copyright (c) 2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -313,8 +313,8 @@ static void buffer_cleanup(void *value) for (i=0; i < OPAL_HWLOC_PRINT_NUM_BUFS; i++) { free(ptr->buffers[i]); } + free(ptr); } - free(ptr); } opal_hwloc_print_buffers_t *opal_hwloc_get_print_buffer(void) diff --git a/opal/mca/mpool/hugepage/mpool_hugepage_component.c b/opal/mca/mpool/hugepage/mpool_hugepage_component.c index 0460f5a856..02320b9f91 100644 --- a/opal/mca/mpool/hugepage/mpool_hugepage_component.c +++ b/opal/mca/mpool/hugepage/mpool_hugepage_component.c @@ -190,6 +190,7 @@ static int mca_mpool_hugepage_close (void) return OPAL_SUCCESS; } +#ifdef HAVE_MNTENT_H static int page_compare (opal_list_item_t **a, opal_list_item_t **b) { mca_mpool_hugepage_hugepage_t *pagea = (mca_mpool_hugepage_hugepage_t *) *a; mca_mpool_hugepage_hugepage_t *pageb = (mca_mpool_hugepage_hugepage_t *) *b; @@ -201,6 +202,7 @@ static int page_compare (opal_list_item_t **a, opal_list_item_t **b) { return 0; } +#endif static void mca_mpool_hugepage_find_hugepages (void) { #ifdef HAVE_MNTENT_H diff --git a/opal/mca/pmix/pmix2x/pmix/src/dstore/pmix_esh.c b/opal/mca/pmix/pmix2x/pmix/src/dstore/pmix_esh.c index 56ece7cc5a..8e007c2754 100644 --- a/opal/mca/pmix/pmix2x/pmix/src/dstore/pmix_esh.c +++ b/opal/mca/pmix/pmix2x/pmix/src/dstore/pmix_esh.c @@ -2114,7 +2114,7 @@ static int pmix_sm_store(ns_track_elem_t *ns_info, pmix_rank_t rank, pmix_kval_t } } else { char ckey[PMIX_MAX_KEYLEN+1] = {0}; - strncpy(ckey, (const char *)addr, strlen(addr)+1); + strncpy(ckey, (const char *)addr, strlen((char*)addr)+1); PMIX_OUTPUT_VERBOSE((10, pmix_globals.debug_output, "%s:%d:%s: for rank %u, replace flag %d skip %s key, look for %s key", __FILE__, __LINE__, __func__, rank, data_exist, ckey, kval->key)); diff --git a/test/monitoring/monitoring_test.c b/test/monitoring/monitoring_test.c index e005db17ed..70d51d17c2 100644 --- a/test/monitoring/monitoring_test.c +++ b/test/monitoring/monitoring_test.c @@ -4,6 +4,7 @@ * reserved. * Copyright (c) 2013-2015 Inria. All rights reserved. * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2016 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -78,7 +79,6 @@ I 3 2 860 bytes 24 msgs sent static MPI_T_pvar_handle flush_handle; static const char flush_pvar_name[] = "pml_monitoring_flush"; -static const char flush_cvar_name[] = "pml_monitoring_enable"; static int flush_pvar_idx; int main(int argc, char* argv[]) @@ -132,7 +132,7 @@ int main(int argc, char* argv[]) flush_pvar_name); MPI_Abort(MPI_COMM_WORLD, MPIT_result); } - + if (rank == 0) { n = 25; MPI_Isend(&n,1,MPI_INT,to,tagno,MPI_COMM_WORLD,&request); @@ -182,7 +182,7 @@ int main(int argc, char* argv[]) if( MPI_SUCCESS != MPI_T_pvar_write(session, flush_handle, NULL) ) { fprintf(stderr, "Process %d cannot save monitoring in %s\n", rank, filename); } - + /* Second phase. Work with different communicators. even ranls will circulate a token