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; OMPI_CAST_RTE_NAME(&proc->super.proc_name)->vpid = i;
if (i == OMPI_PROC_MY_NAME->vpid) { if (i == OMPI_PROC_MY_NAME->vpid) {
opal_value_t kv;
ompi_proc_local_proc = proc; ompi_proc_local_proc = proc;
proc->super.proc_flags = OPAL_PROC_ALL_LOCAL; proc->super.proc_flags = OPAL_PROC_ALL_LOCAL;
proc->super.proc_hostname = strdup(ompi_process_info.nodename); proc->super.proc_hostname = strdup(ompi_process_info.nodename);
@ -115,8 +116,13 @@ int ompi_proc_init(void)
opal_proc_local_set(&proc->super); opal_proc_local_set(&proc->super);
#if OPAL_ENABLE_HETEROGENEOUS_SUPPORT #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
/* add our arch to the modex */ /* add our arch to the modex */
OPAL_MODEX_SEND_STRING(ret, PMIX_SYNC_REQD, PMIX_REMOTE, OPAL_DSTORE_ARCH, OBJ_CONSTRUCT(&kv, opal_value_t);
&proc->super.proc_arch, OPAL_UINT32); 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) { if (OPAL_SUCCESS != ret) {
return ret; return ret;
} }

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

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

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

@ -10,6 +10,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) 2014 Intel, Inc. 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$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -83,17 +85,17 @@ typedef uint32_t orte_vpid_t;
#define ORTE_VPID_MAX UINT32_MAX-2 #define ORTE_VPID_MAX UINT32_MAX-2
#define ORTE_VPID_MIN 0 #define ORTE_VPID_MIN 0
#define ORTE_PROCESS_NAME_HTON(n) \ #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && !defined(WORDS_BIGENDIAN)
do { \ #define ORTE_PROCESS_NAME_HTON(n) \
n.jobid = htonl(n.jobid); \ OPAL_PROCESS_NAME_HTON(*(opal_process_name_t *)&(n))
n.vpid = htonl(n.vpid); \
} while (0)
#define ORTE_PROCESS_NAME_NTOH(n) \ #define ORTE_PROCESS_NAME_NTOH(n) \
do { \ OPAL_PROCESS_NAME_NTOH(*(opal_process_name_t *)&(n))
n.jobid = ntohl(n.jobid); \ #else
n.vpid = ntohl(n.vpid); \ #define ORTE_PROCESS_NAME_HTON(n)
} while (0)
#define ORTE_PROCESS_NAME_NTOH(n)
#endif
#define ORTE_NAME_ARGS(n) \ #define ORTE_NAME_ARGS(n) \
(unsigned long) ((NULL == n) ? (unsigned long)ORTE_JOBID_INVALID : (unsigned long)(n)->jobid), \ (unsigned long) ((NULL == n) ? (unsigned long)ORTE_JOBID_INVALID : (unsigned long)(n)->jobid), \
@ -115,11 +117,23 @@ do { \
/* /*
* define the process name structure * 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 { struct orte_process_name_t {
orte_jobid_t jobid; /**< Job number */ orte_jobid_t jobid; /**< Job number */
orte_vpid_t vpid; /**< Process id - equivalent to rank */ orte_vpid_t vpid; /**< Process id - equivalent to rank */
}; };
#endif
typedef struct orte_process_name_t orte_process_name_t; typedef struct orte_process_name_t orte_process_name_t;