1
1
* redefine orte_process_name_t so it can be converted
  between host and network format as an opal_identifier_t
  aka uint64_t by the OPAL layer.
* correctly send OPAL_DSTORE_ARCH key
Этот коммит содержится в:
Gilles Gouaillardet 2014-10-15 17:19:13 +09:00
родитель 5c81658d58
Коммит c9c5d4011b
3 изменённых файлов: 38 добавлений и 29 удалений

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

@ -107,6 +107,7 @@ 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);
@ -115,8 +116,13 @@ int ompi_proc_init(void)
opal_proc_local_set(&proc->super);
#if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
/* add our arch to the modex */
OPAL_MODEX_SEND_STRING(ret, PMIX_SYNC_REQD, PMIX_REMOTE, OPAL_DSTORE_ARCH,
&proc->super.proc_arch, OPAL_UINT32);
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);
if (OPAL_SUCCESS != ret) {
return ret;
}

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

@ -23,7 +23,7 @@
#include "opal/dss/dss.h"
#if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
#include <arpa/inet.h>
#include "opal/types.h"
#endif
/**
@ -37,22 +37,11 @@
typedef opal_identifier_t opal_process_name_t;
#if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && !defined(WORDS_BIGENDIAN)
#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]);
}
#define OPAL_PROCESS_NAME_NTOH(guid) \
guid = ntoh64(guid)
#define OPAL_PROCESS_NAME_HTON(guid) \
guid = hton64(guid)
#else
#define OPAL_PROCESS_NAME_NTOH(guid)
#define OPAL_PROCESS_NAME_HTON(guid)

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

@ -10,6 +10,8 @@
* 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
@ -83,17 +85,17 @@ typedef uint32_t orte_vpid_t;
#define ORTE_VPID_MAX UINT32_MAX-2
#define ORTE_VPID_MIN 0
#define ORTE_PROCESS_NAME_HTON(n) \
do { \
n.jobid = htonl(n.jobid); \
n.vpid = htonl(n.vpid); \
} while (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_NTOH(n) \
do { \
n.jobid = ntohl(n.jobid); \
n.vpid = ntohl(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_NAME_ARGS(n) \
(unsigned long) ((NULL == n) ? (unsigned long)ORTE_JOBID_INVALID : (unsigned long)(n)->jobid), \
@ -115,11 +117,23 @@ do { \
/*
* 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;