@@ -991,6 +991,7 @@ void orte_plm_base_daemon_callback(int status, orte_process_name_t* sender,
991
991
opal_buffer_t * relay ;
992
992
char * sig ;
993
993
orte_topology_t * t ;
994
+ hwloc_topology_t topo ;
994
995
int i ;
995
996
bool found ;
996
997
orte_daemon_cmd_flag_t cmd = ORTE_DAEMON_REPORT_TOPOLOGY_CMD ;
@@ -1126,6 +1127,18 @@ void orte_plm_base_daemon_callback(int status, orte_process_name_t* sender,
1126
1127
OPAL_OUTPUT_VERBOSE ((5 , orte_plm_base_framework .framework_output ,
1127
1128
"%s RECEIVED TOPOLOGY SIG %s FROM NODE %s" ,
1128
1129
ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ), sig , nodename ));
1130
+
1131
+ /* rank=1 always sends its topology back */
1132
+ topo = NULL ;
1133
+ if (1 == sender -> vpid ) {
1134
+ idx = 1 ;
1135
+ if (OPAL_SUCCESS != (rc = opal_dss .unpack (buffer , & topo , & idx , OPAL_HWLOC_TOPO ))) {
1136
+ ORTE_ERROR_LOG (rc );
1137
+ orted_failed_launch = true;
1138
+ goto CLEANUP ;
1139
+ }
1140
+ }
1141
+
1129
1142
/* do we already have this topology from some other node? */
1130
1143
found = false;
1131
1144
for (i = 0 ; i < orte_node_topologies -> size ; i ++ ) {
@@ -1139,6 +1152,9 @@ void orte_plm_base_daemon_callback(int status, orte_process_name_t* sender,
1139
1152
ORTE_NAME_PRINT (ORTE_PROC_MY_NAME )));
1140
1153
found = true;
1141
1154
node -> topology = t ;
1155
+ if (NULL != topo ) {
1156
+ hwloc_topology_destroy (topo );
1157
+ }
1142
1158
free (sig );
1143
1159
break ;
1144
1160
}
@@ -1152,27 +1168,31 @@ void orte_plm_base_daemon_callback(int status, orte_process_name_t* sender,
1152
1168
t -> sig = sig ;
1153
1169
opal_pointer_array_add (orte_node_topologies , t );
1154
1170
node -> topology = t ;
1155
- /* construct the request */
1156
- relay = OBJ_NEW (opal_buffer_t );
1157
- if (OPAL_SUCCESS != (rc = opal_dss .pack (relay , & cmd , 1 , ORTE_DAEMON_CMD ))) {
1158
- ORTE_ERROR_LOG (rc );
1159
- OBJ_RELEASE (relay );
1160
- orted_failed_launch = true;
1161
- goto CLEANUP ;
1162
- }
1163
- /* send it */
1164
- orte_rml .send_buffer_nb (orte_mgmt_conduit ,
1165
- sender , relay ,
1166
- ORTE_RML_TAG_DAEMON ,
1167
- orte_rml_send_callback , NULL );
1168
- /* we will count this node as completed
1169
- * when we get the full topology back */
1170
- if (NULL != nodename ) {
1171
- free (nodename );
1172
- nodename = NULL ;
1171
+ if (NULL != topo ) {
1172
+ t -> topo = topo ;
1173
+ } else {
1174
+ /* construct the request */
1175
+ relay = OBJ_NEW (opal_buffer_t );
1176
+ if (OPAL_SUCCESS != (rc = opal_dss .pack (relay , & cmd , 1 , ORTE_DAEMON_CMD ))) {
1177
+ ORTE_ERROR_LOG (rc );
1178
+ OBJ_RELEASE (relay );
1179
+ orted_failed_launch = true;
1180
+ goto CLEANUP ;
1181
+ }
1182
+ /* send it */
1183
+ orte_rml .send_buffer_nb (orte_mgmt_conduit ,
1184
+ sender , relay ,
1185
+ ORTE_RML_TAG_DAEMON ,
1186
+ orte_rml_send_callback , NULL );
1187
+ /* we will count this node as completed
1188
+ * when we get the full topology back */
1189
+ if (NULL != nodename ) {
1190
+ free (nodename );
1191
+ nodename = NULL ;
1192
+ }
1193
+ idx = 1 ;
1194
+ continue ;
1173
1195
}
1174
- idx = 1 ;
1175
- continue ;
1176
1196
}
1177
1197
1178
1198
CLEANUP :
0 commit comments