File tree 2 files changed +24
-1
lines changed 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -369,6 +369,7 @@ static inline bool ompi_proc_is_sentinel (ompi_proc_t *proc)
369
369
return (intptr_t ) proc & 0x1 ;
370
370
}
371
371
372
+ #if OPAL_SIZEOF_PROCESS_NAME_T == SIZEOF_VOID_P
372
373
/*
373
374
* we assume an ompi_proc_t is at least aligned on two bytes,
374
375
* so if the LSB of a pointer to an ompi_proc_t is 1, we have to handle
@@ -407,6 +408,27 @@ static inline opal_process_name_t ompi_proc_sentinel_to_name (uintptr_t sentinel
407
408
name .vpid = vpid ;
408
409
return name ;
409
410
}
411
+ #elif 4 == SIZEOF_VOID_P
412
+ /*
413
+ * currently, a sentinel is only made from the current jobid aka OMPI_PROC_MY_NAME->jobid
414
+ * so we only store the first 31 bits of the vpid
415
+ */
416
+ static inline uintptr_t ompi_proc_name_to_sentinel (opal_process_name_t name )
417
+ {
418
+ assert (OMPI_PROC_MY_NAME -> jobid == name .jobid );
419
+ return (uintptr_t )((name .vpid <<1 ) | 0x1 );
420
+ }
421
+
422
+ static inline opal_process_name_t ompi_proc_sentinel_to_name (uintptr_t sentinel )
423
+ {
424
+ opal_process_name_t name ;
425
+ name .jobid = OMPI_PROC_MY_NAME -> jobid ;
426
+ name .vpid = sentinel >> 1 ;
427
+ return name ;
428
+ }
429
+ #else
430
+ #error unsupported pointer size
431
+ #endif
410
432
411
433
END_C_DECLS
412
434
Original file line number Diff line number Diff line change 14
14
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights
15
15
* reserved.
16
16
* Copyright (c) 2014 Intel, Inc. All rights reserved.
17
- * Copyright (c) 2014 Research Organization for Information Science
17
+ * Copyright (c) 2014-2016 Research Organization for Information Science
18
18
* and Technology (RIST). All rights reserved.
19
19
* $COPYRIGHT$
20
20
*
@@ -47,6 +47,7 @@ typedef struct {
47
47
opal_jobid_t jobid ;
48
48
opal_vpid_t vpid ;
49
49
} opal_process_name_t ;
50
+ #define OPAL_SIZEOF_PROCESS_NAME_T 8
50
51
51
52
BEGIN_C_DECLS
52
53
You can’t perform that action at this time.
0 commit comments