diff --git a/ompi/proc/proc.c b/ompi/proc/proc.c index 12b781e7d2..d30182f7a4 100644 --- a/ompi/proc/proc.c +++ b/ompi/proc/proc.c @@ -107,7 +107,6 @@ int ompi_proc_init(void) OMPI_CAST_RTE_NAME(&proc->super.proc_name)->vpid = i; if (i == OMPI_PROC_MY_NAME->vpid) { - opal_value_t kv; ompi_proc_local_proc = proc; proc->super.proc_flags = OPAL_PROC_ALL_LOCAL; proc->super.proc_hostname = strdup(ompi_process_info.nodename); @@ -116,13 +115,8 @@ int ompi_proc_init(void) opal_proc_local_set(&proc->super); #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT /* add our arch to the modex */ - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_DSTORE_ARCH); - kv.type = OPAL_UINT32; - kv.data.uint32 = opal_local_arch; - ret = opal_pmix.put(PMIX_REMOTE, &kv); - OBJ_DESTRUCT(&kv); - + OPAL_MODEX_SEND_STRING(ret, PMIX_SYNC_REQD, PMIX_REMOTE, OPAL_DSTORE_ARCH, + &proc->super.proc_arch, OPAL_UINT32); if (OPAL_SUCCESS != ret) { return ret; } diff --git a/opal/util/proc.h b/opal/util/proc.h index db5cfbcfc9..8a52a08101 100644 --- a/opal/util/proc.h +++ b/opal/util/proc.h @@ -23,7 +23,7 @@ #include "opal/dss/dss.h" #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT -#include "opal/types.h" +#include #endif /** @@ -37,11 +37,22 @@ typedef opal_identifier_t opal_process_name_t; #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && !defined(WORDS_BIGENDIAN) -#define OPAL_PROCESS_NAME_NTOH(guid) \ - guid = ntoh64(guid) - -#define OPAL_PROCESS_NAME_HTON(guid) \ - guid = hton64(guid) +#define OPAL_PROCESS_NAME_NTOH(guid) opal_process_name_ntoh_intr(&(guid)) +static inline __opal_attribute_always_inline__ void +opal_process_name_ntoh_intr(opal_process_name_t *name) +{ + uint32_t * w = (uint32_t *)name; + w[0] = ntohl(w[0]); + w[1] = ntohl(w[1]); +} +#define OPAL_PROCESS_NAME_HTON(guid) opal_process_name_hton_intr(&(guid)) +static inline __opal_attribute_always_inline__ void +opal_process_name_hton_intr(opal_process_name_t *name) +{ + uint32_t * w = (uint32_t *)name; + w[0] = htonl(w[0]); + w[1] = htonl(w[1]); +} #else #define OPAL_PROCESS_NAME_NTOH(guid) #define OPAL_PROCESS_NAME_HTON(guid) diff --git a/orte/include/orte/types.h b/orte/include/orte/types.h index f14b527e6d..c9ae32063c 100644 --- a/orte/include/orte/types.h +++ b/orte/include/orte/types.h @@ -10,8 +10,6 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2014 Intel, Inc. All rights reserved. - * Copyright (c) 2014 Research Organization for Information Science - * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -85,17 +83,17 @@ typedef uint32_t orte_vpid_t; #define ORTE_VPID_MAX UINT32_MAX-2 #define ORTE_VPID_MIN 0 -#if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && !defined(WORDS_BIGENDIAN) -#define ORTE_PROCESS_NAME_HTON(n) \ - OPAL_PROCESS_NAME_HTON(*(opal_process_name_t *)&(n)) +#define ORTE_PROCESS_NAME_HTON(n) \ +do { \ + n.jobid = htonl(n.jobid); \ + n.vpid = htonl(n.vpid); \ +} while (0) -#define ORTE_PROCESS_NAME_NTOH(n) \ - OPAL_PROCESS_NAME_NTOH(*(opal_process_name_t *)&(n)) -#else -#define ORTE_PROCESS_NAME_HTON(n) - -#define ORTE_PROCESS_NAME_NTOH(n) -#endif +#define ORTE_PROCESS_NAME_NTOH(n) \ +do { \ + n.jobid = ntohl(n.jobid); \ + n.vpid = ntohl(n.vpid); \ +} while (0) #define ORTE_NAME_ARGS(n) \ (unsigned long) ((NULL == n) ? (unsigned long)ORTE_JOBID_INVALID : (unsigned long)(n)->jobid), \ @@ -117,23 +115,11 @@ typedef uint32_t orte_vpid_t; /* * define the process name structure - * the OPAL layer sees an orte_process_name_t as an opal_process_name_t aka uint64_t - * if heterogeneous is supported, when converting this uint64_t to - * an endian neutral format, vpid and jobid will be swapped. - * consequently, the orte_process_name_t struct must have different definitions - * (swap jobid and vpid) on little and big endian arch. */ -#if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && !defined(WORDS_BIGENDIAN) -struct orte_process_name_t { - orte_vpid_t vpid; /**< Process id - equivalent to rank */ - orte_jobid_t jobid; /**< Job number */ -}; -#else struct orte_process_name_t { orte_jobid_t jobid; /**< Job number */ orte_vpid_t vpid; /**< Process id - equivalent to rank */ }; -#endif typedef struct orte_process_name_t orte_process_name_t;