+#define IMPI_COLL_SELECT(cat, ret, args, args2) \
+ ret _XBT_CONCAT2(cat, __impi)(COLL_UNPAREN args) \
+ { \
+ int comm_size = comm->size(); \
+ int i = 0; \
+ _XBT_CONCAT(SIZECOMP_, cat) \
+ i = 0; \
+ int j = 0, k = 0; \
+ if (comm->get_leaders_comm() == MPI_COMM_NULL) { \
+ comm->init_smp(); \
+ } \
+ int local_size = 1; \
+ if (comm->is_uniform()) { \
+ local_size = comm->get_intra_comm()->size(); \
+ } \
+ while (i < INTEL_MAX_NB_PPN && local_size != _XBT_CONCAT3(intel_, cat, _table)[i].ppn) \
+ i++; \
+ if (i == INTEL_MAX_NB_PPN) \
+ i = 0; \
+ while (comm_size > _XBT_CONCAT3(intel_, cat, _table)[i].elems[j].max_num_proc && j < INTEL_MAX_NB_THRESHOLDS) \
+ j++; \
+ while (block_dsize >= _XBT_CONCAT3(intel_, cat, _table)[i].elems[j].elems[k].max_size && \
+ k < _XBT_CONCAT3(intel_, cat, _table)[i].elems[j].num_elems) \
+ k++; \
+ return (_XBT_CONCAT3(intel_, cat, \
+ _functions_table)[_XBT_CONCAT3(intel_, cat, _table)[i].elems[j].elems[k].algo - 1] args2); \
+ }