Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 75756c8

Browse files
author
Ralph Castain
committed
Improve the transport key print statement to ensure that we don't get zero fields as this can be a problem for PSM
(cherry picked from commit 29bc24b)
1 parent f0e283d commit 75756c8

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

orte/mca/ess/pmi/ess_pmi_module.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ static int rte_init(void)
186186
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
187187
return ORTE_ERR_OUT_OF_RESOURCE;
188188
}
189+
opal_output_verbose(2, orte_ess_base_framework.framework_output,
190+
"%s transport key %s",
191+
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), string_key);
189192
asprintf(&envar, OPAL_MCA_PREFIX"orte_precondition_transports=%s", string_key);
190193
putenv(envar);
191194
added_transport_keys = true;

orte/util/pre_condition_transports.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static inline void orte_pre_condition_transports_use_rand(uint64_t* unique_key)
6464
char* orte_pre_condition_transports_print(uint64_t *unique_key)
6565
{
6666
unsigned int *int_ptr;
67-
size_t i, string_key_len, written_len;
67+
size_t i, j, string_key_len, written_len;
6868
char *string_key = NULL, *format = NULL;
6969

7070
/* string is two 64 bit numbers printed in hex with a dash between
@@ -92,6 +92,12 @@ char* orte_pre_condition_transports_print(uint64_t *unique_key)
9292
/* print the first number */
9393
int_ptr = (unsigned int*) &unique_key[0];
9494
for (i = 0 ; i < sizeof(uint64_t) / sizeof(unsigned int) ; ++i) {
95+
if (0 == int_ptr[i]) {
96+
/* inject some energy */
97+
for (j=0; j < sizeof(unsigned int); j++) {
98+
int_ptr[i] |= j << j;
99+
}
100+
}
95101
snprintf(string_key + written_len,
96102
string_key_len - written_len,
97103
format, int_ptr[i]);
@@ -105,6 +111,12 @@ char* orte_pre_condition_transports_print(uint64_t *unique_key)
105111
/* print the second number */
106112
int_ptr = (unsigned int*) &unique_key[1];
107113
for (i = 0 ; i < sizeof(uint64_t) / sizeof(unsigned int) ; ++i) {
114+
if (0 == int_ptr[i]) {
115+
/* inject some energy */
116+
for (j=0; j < sizeof(unsigned int); j++) {
117+
int_ptr[i] |= j << j;
118+
}
119+
}
108120
snprintf(string_key + written_len,
109121
string_key_len - written_len,
110122
format, int_ptr[i]);

0 commit comments

Comments
 (0)