From 3c2e75c6b7b8a720cc2f6986f587a5003db77469 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Tue, 5 Aug 2014 05:22:50 +0000 Subject: [PATCH] Fix OPAL_PROCESS_NAME_xTOy for heterogeneous support This commit was SVN r32425. --- opal/util/proc.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/opal/util/proc.h b/opal/util/proc.h index 9611312e7c..03cb195683 100644 --- a/opal/util/proc.h +++ b/opal/util/proc.h @@ -3,6 +3,8 @@ * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2013 Inria. All rights reserved. + * Copyright (c) 2014 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -18,6 +20,10 @@ #include "opal/mca/hwloc/hwloc.h" #include "opal/dss/dss.h" +#if OPAL_ENABLE_HETEROGENEOUS_SUPPORT +#include +#endif + /** * This is a transparent handle proposed to the upper layer as a mean * to store whatever information it needs in order to efficiently @@ -28,8 +34,27 @@ */ 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]); +} +#else #define OPAL_PROCESS_NAME_NTOH(guid) #define OPAL_PROCESS_NAME_HTON(guid) +#endif typedef struct opal_proc_t { /** allow proc to be placed on a list */