Skip to content

Commit

Permalink
sentinel: uses local jobid and family as uint32_t
Browse files Browse the repository at this point in the history
  • Loading branch information
ggouaillardet committed Feb 7, 2016
1 parent fe3941c commit 9057cdd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ompi/proc/proc.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,17 +373,18 @@ 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
* - bits 32-63 : vpid
*/
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);
Expand All @@ -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;
Expand Down

0 comments on commit 9057cdd

Please sign in to comment.