diff --git a/ompi/mca/topo/treematch/treematch/tm_mapping.c b/ompi/mca/topo/treematch/treematch/tm_mapping.c index 8ce1b9e895..b30846c0cc 100644 --- a/ompi/mca/topo/treematch/treematch/tm_mapping.c +++ b/ompi/mca/topo/treematch/treematch/tm_mapping.c @@ -247,9 +247,7 @@ static long int init_mat_mmap(char *filename,int N, double **mat, double *sum_ro return nnz; } - - - +#ifdef __MACH__ static long int init_mat_long(char *filename,int N, double **mat, double *sum_row){ int i; unsigned int vl = tm_get_verbose_level(); @@ -275,7 +273,7 @@ static long int init_mat_long(char *filename,int N, double **mat, double *sum_ro fclose (pf); return nnz; } - +#endif tm_affinity_mat_t * new_affinity_mat(double **mat, double *sum_row, int order, long int nnz){ tm_affinity_mat_t * aff_mat; diff --git a/opal/datatype/opal_convertor_raw.c b/opal/datatype/opal_convertor_raw.c index 5bea5dcf5b..39c8a40c5c 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_copy_functions_heterogeneous.c b/opal/datatype/opal_copy_functions_heterogeneous.c index dd0baa3a1f..7a3e7d57f9 100644 --- a/opal/datatype/opal_copy_functions_heterogeneous.c +++ b/opal/datatype/opal_copy_functions_heterogeneous.c @@ -89,13 +89,14 @@ struct bit80 { static inline void opal_dt_swap_long_double(void *to_p, const void *from_p, const size_t size, size_t count, uint32_t remoteArch) { + #ifdef HAVE_IEEE754_H - size_t i; - long double*to = (long double *) to_p; if ((opal_local_arch&OPAL_ARCH_LDISINTEL) && !(remoteArch&OPAL_ARCH_LDISINTEL)) { #ifdef __x86_64 - for (i=0; iproc_addr_count ; i++) { if (MCA_BTL_TCP_AF_INET == remote_addrs[i].addr_family) { - memcpy(&btl_proc->proc_addrs[i].addr_inet, + memcpy(&btl_proc->proc_addrs[i].addr_union.addr_inet, remote_addrs[i].addr, sizeof(struct in_addr)); btl_proc->proc_addrs[i].addr_port = remote_addrs[i].addr_port; btl_proc->proc_addrs[i].addr_ifkindex = remote_addrs[i].addr_ifkindex; @@ -180,7 +180,7 @@ mca_btl_tcp_proc_t* mca_btl_tcp_proc_create(opal_proc_t* proc) btl_proc->proc_addrs[i].addr_inuse = false; } else if (MCA_BTL_TCP_AF_INET6 == remote_addrs[i].addr_family) { #if OPAL_ENABLE_IPV6 - memcpy(&btl_proc->proc_addrs[i].addr_inet6, + memcpy(&btl_proc->proc_addrs[i].addr_union.addr_inet6, remote_addrs[i].addr, sizeof(struct in6_addr)); btl_proc->proc_addrs[i].addr_port = remote_addrs[i].addr_port; btl_proc->proc_addrs[i].addr_ifkindex = remote_addrs[i].addr_ifkindex; @@ -869,7 +869,7 @@ void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t* btl_proc, struct sockaddr* addr } switch (addr->sa_family) { case AF_INET: - if( memcmp( &btl_endpoint->endpoint_addr->addr_inet, + if( memcmp( &btl_endpoint->endpoint_addr->addr_union.addr_inet, &(((struct sockaddr_in*)addr)->sin_addr), sizeof(struct in_addr) ) ) { char tmp[2][16]; @@ -878,7 +878,7 @@ void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t* btl_proc, struct sockaddr* addr OPAL_NAME_PRINT(btl_proc->proc_opal->proc_name), inet_ntop(AF_INET, (void*)&((struct sockaddr_in*)addr)->sin_addr, tmp[0], 16), - inet_ntop(AF_INET, (void*)(struct in_addr*)&btl_endpoint->endpoint_addr->addr_inet, + inet_ntop(AF_INET, (void*)(struct in_addr*)&btl_endpoint->endpoint_addr->addr_union.addr_inet, tmp[1], 16), (int)i, (int)btl_proc->proc_endpoint_count); continue; @@ -890,7 +890,7 @@ void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t* btl_proc, struct sockaddr* addr break; #if OPAL_ENABLE_IPV6 case AF_INET6: - if( memcmp( &btl_endpoint->endpoint_addr->addr_inet, + if( memcmp( &btl_endpoint->endpoint_addr->addr_union.addr_inet, &(((struct sockaddr_in6*)addr)->sin6_addr), sizeof(struct in6_addr) ) ) { char tmp[2][INET6_ADDRSTRLEN]; @@ -899,7 +899,7 @@ void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t* btl_proc, struct sockaddr* addr OPAL_NAME_PRINT(btl_proc->proc_opal->proc_name), inet_ntop(AF_INET6, (void*)&((struct sockaddr_in6*)addr)->sin6_addr, tmp[0], INET6_ADDRSTRLEN), - inet_ntop(AF_INET6, (void*)(struct in6_addr*)&btl_endpoint->endpoint_addr->addr_inet, + inet_ntop(AF_INET6, (void*)(struct in6_addr*)&btl_endpoint->endpoint_addr->addr_union.addr_inet, tmp[1], INET6_ADDRSTRLEN), (int)i, (int)btl_proc->proc_endpoint_count); continue; @@ -941,7 +941,7 @@ void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t* btl_proc, struct sockaddr* addr continue; } inet_ntop(btl_endpoint->endpoint_addr->addr_family, - (void*) &(btl_endpoint->endpoint_addr->addr_inet), + (void*) &(btl_endpoint->endpoint_addr->addr_union.addr_inet), ip, sizeof(ip) - 1); if (NULL == addr_str) { opal_asprintf(&tmp, "\n\t%s", ip); @@ -978,7 +978,7 @@ bool mca_btl_tcp_proc_tosocks(mca_btl_tcp_addr_t* proc_addr, case AF_INET: output->ss_family = AF_INET; memcpy(&((struct sockaddr_in*)output)->sin_addr, - &proc_addr->addr_inet, sizeof(struct in_addr)); + &proc_addr->addr_union.addr_inet, sizeof(struct in_addr)); ((struct sockaddr_in*)output)->sin_port = proc_addr->addr_port; break; #if OPAL_ENABLE_IPV6 @@ -986,8 +986,8 @@ bool mca_btl_tcp_proc_tosocks(mca_btl_tcp_addr_t* proc_addr, { struct sockaddr_in6* inaddr = (struct sockaddr_in6*)output; output->ss_family = AF_INET6; - memcpy(&inaddr->sin6_addr, &proc_addr->addr_inet, - sizeof (proc_addr->addr_inet)); + memcpy(&inaddr->sin6_addr, &proc_addr->addr_union.addr_inet, + sizeof (proc_addr->addr_union.addr_inet)); inaddr->sin6_port = proc_addr->addr_port; inaddr->sin6_scope_id = 0; inaddr->sin6_flowinfo = 0; diff --git a/opal/mca/memory/patcher/memory_patcher_component.c b/opal/mca/memory/patcher/memory_patcher_component.c index 687d430fa3..e12e582f80 100644 --- a/opal/mca/memory/patcher/memory_patcher_component.c +++ b/opal/mca/memory/patcher/memory_patcher_component.c @@ -334,12 +334,20 @@ static int intercept_brk (void *addr) #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 defined(SYS_shmdt) || (defined(IPCOP_shmdt) && defined(SYS_ipc)) +#define HAS_SHMDT 1 +#else +#define HAS_SHMDT 0 +#endif -#if (HAS_SHMDT || HAS_SHMAT) && defined(__linux__) +#if defined(SYS_shmat) ||(defined(IPCOP_shmat) && defined(SYS_ipc)) +#define HAS_SHMAT 1 +#else +#define HAS_SHMAT 0 +#endif + +#if HAS_SHMDT || HAS_SHMAT +#if defined(__linux__) #include #include @@ -415,8 +423,10 @@ static size_t get_shm_size(int shmid) return ds.shm_segsz; } #endif +#endif -#if HAS_SHMAT && defined(__linux__) +#if HAS_SHMAT +#if defined(__linux__) static void *(*original_shmat)(int shmid, const void *shmaddr, int shmflg); static void *_intercept_shmat(int shmid, const void *shmaddr, int shmflg) @@ -462,8 +472,10 @@ static void* intercept_shmat (int shmid, const void * shmaddr, int shmflg) return result; } #endif +#endif -#if HAS_SHMDT && defined(__linux__) +#if HAS_SHMDT +#if defined(__linux__) static int (*original_shmdt) (const void *); static int _intercept_shmdt (const void *shmaddr) @@ -495,6 +507,7 @@ static int intercept_shmdt (const void *shmaddr) return result; } #endif +#endif static int patcher_register (void) { @@ -570,19 +583,23 @@ static int patcher_open (void) } #endif -#if HAS_SHMAT && defined(__linux__) +#if HAS_SHMAT +#if defined(__linux__) rc = opal_patcher->patch_symbol ("shmat", (uintptr_t) intercept_shmat, (uintptr_t *) &original_shmat); if (OPAL_SUCCESS != rc) { return rc; } #endif +#endif -#if HAS_SHMDT && defined(__linux__) +#if 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 #if defined (SYS_brk) rc = opal_patcher->patch_symbol ("brk", (uintptr_t)intercept_brk, (uintptr_t *) &original_brk); diff --git a/opal/util/malloc.c b/opal/util/malloc.c index 63a59ba5cc..be917a379d 100644 --- a/opal/util/malloc.c +++ b/opal/util/malloc.c @@ -52,13 +52,14 @@ int opal_malloc_debug_level = OPAL_MALLOC_DEBUG_LEVEL; int opal_malloc_output = -1; + +#if OPAL_ENABLE_DEBUG + /* * Private variables */ static opal_output_stream_t malloc_stream; - -#if OPAL_ENABLE_DEBUG /* * Finalize the malloc debug interface */