diff --git a/ompi/proc/proc.h b/ompi/proc/proc.h index ffaa9e41e18..5aeeea10132 100644 --- a/ompi/proc/proc.h +++ b/ompi/proc/proc.h @@ -373,7 +373,7 @@ static inline bool ompi_proc_is_sentinel (ompi_proc_t *proc) * we assume an ompi_proc_t is at least aligned on two bytes, * so if the LSB of a pointer to an ompi_proc_t is 1, we have to handle * this pointer as a sentinel instead of a pointer. - * a sentinel can be seen as a 64 bits array with the following format : + * a sentinel can be seen as an uint64_t with the following format : * - bit 0 : 1 * - bits 1-15 : local jobid * - bits 16-31 : job family @@ -381,9 +381,10 @@ static inline bool ompi_proc_is_sentinel (ompi_proc_t *proc) */ static inline uintptr_t ompi_proc_name_to_sentinel (opal_process_name_t name) { - uintptr_t tmp, sentinel = 0x1; + uintptr_t tmp, sentinel = 0; /* local jobid must fit in 15 bits */ assert(! (ORTE_LOCAL_JOBID(name.jobid) & 0x8000)); + sentinel |= 0x1; tmp = (uintptr_t)ORTE_LOCAL_JOBID(name.jobid); sentinel |= ((tmp << 1) & 0xfffe); tmp = (uintptr_t)ORTE_JOB_FAMILY(name.jobid); @@ -396,7 +397,7 @@ static inline uintptr_t ompi_proc_name_to_sentinel (opal_process_name_t name) static inline opal_process_name_t ompi_proc_sentinel_to_name (uintptr_t sentinel) { opal_process_name_t name; - uint16_t local, family; + uint32_t local, family; uint32_t vpid; assert(sentinel & 0x1); local = (sentinel >> 1) & 0x7fff;