|
25 | 25 | #include "mpi.h"
|
26 | 26 | #include "coll_han.h"
|
27 | 27 | #include "coll_han_dynamic.h"
|
| 28 | +#include "opal/mca/smsc/smsc.h" |
28 | 29 |
|
29 | 30 | #define HAN_SUBCOM_SAVE_COLLECTIVE(FALLBACKS, COMM, HANM, COLL) \
|
30 | 31 | do { \
|
@@ -183,6 +184,20 @@ int mca_coll_han_comm_create_new(struct ompi_communicator_t *comm,
|
183 | 184 | HAN_SUBCOM_LOAD_COLLECTIVE(fallbacks, comm, han_module, gather);
|
184 | 185 | HAN_SUBCOM_LOAD_COLLECTIVE(fallbacks, comm, han_module, scatter);
|
185 | 186 |
|
| 187 | + if (mca_smsc) { |
| 188 | + han_module->local_smsc_eps = malloc( sizeof(*han_module->local_smsc_eps) * low_size); |
| 189 | + for (int jlow=0; jlow<low_size; jlow++) { |
| 190 | + struct ompi_proc_t* ompi_proc = ompi_comm_peer_lookup(*low_comm, jlow); |
| 191 | + han_module->local_smsc_eps[jlow] = mca_smsc->get_endpoint(&ompi_proc->super); |
| 192 | + } |
| 193 | + OPAL_OUTPUT_VERBOSE((30, mca_coll_han_component.han_output, |
| 194 | + "Han created SMSC endpoints for low_comm\n")); |
| 195 | + } else { |
| 196 | + han_module->local_smsc_eps = NULL; |
| 197 | + OPAL_OUTPUT_VERBOSE((30, mca_coll_han_component.han_output, |
| 198 | + "Han did not find any SMSC components\n")); |
| 199 | + } |
| 200 | + |
186 | 201 | OBJ_DESTRUCT(&comm_info);
|
187 | 202 | return OMPI_SUCCESS;
|
188 | 203 |
|
@@ -350,6 +365,20 @@ int mca_coll_han_comm_create(struct ompi_communicator_t *comm,
|
350 | 365 | HAN_SUBCOM_LOAD_COLLECTIVE(fallbacks, comm, han_module, gather);
|
351 | 366 | HAN_SUBCOM_LOAD_COLLECTIVE(fallbacks, comm, han_module, scatter);
|
352 | 367 |
|
| 368 | + if (mca_smsc) { |
| 369 | + han_module->local_smsc_eps = malloc( sizeof(*han_module->local_smsc_eps) * low_size); |
| 370 | + for (int jlow=0; jlow<low_size; jlow++) { |
| 371 | + struct ompi_proc_t* ompi_proc = ompi_comm_peer_lookup(low_comms[1], jlow); |
| 372 | + han_module->local_smsc_eps[jlow] = mca_smsc->get_endpoint(&ompi_proc->super); |
| 373 | + } |
| 374 | + OPAL_OUTPUT_VERBOSE((30, mca_coll_han_component.han_output, |
| 375 | + "Han created SMSC endpoints for low_comm\n")); |
| 376 | + } else { |
| 377 | + han_module->local_smsc_eps = NULL; |
| 378 | + OPAL_OUTPUT_VERBOSE((30, mca_coll_han_component.han_output, |
| 379 | + "Han did not find any SMSC components\n")); |
| 380 | + } |
| 381 | + |
353 | 382 | OBJ_DESTRUCT(&comm_info);
|
354 | 383 | return OMPI_SUCCESS;
|
355 | 384 | }
|
0 commit comments