@@ -49,7 +49,7 @@ qvi_hwsplit_s::~qvi_hwsplit_s(void)
49
49
void
50
50
qvi_hwsplit_s::reserve (void )
51
51
{
52
- m_taskids .resize (m_group_size);
52
+ m_group_tids .resize (m_group_size);
53
53
m_hwpools.resize (m_group_size);
54
54
m_colors.resize (m_group_size);
55
55
m_affinities.resize (m_group_size);
@@ -237,7 +237,7 @@ qvi_hwsplit_s::split_devices_affinity_preserving(void)
237
237
}
238
238
// Store device affinities.
239
239
qvi_hwloc_cpusets_t devaffs;
240
- for (auto &dev : devs) {
240
+ for (const auto &dev : devs) {
241
241
devaffs.push_back (dev->affinity ());
242
242
}
243
243
@@ -429,7 +429,7 @@ qvi_hwsplit_s::split(void)
429
429
return rc;
430
430
}
431
431
432
- qvi_coll_hwsplit_s::qvi_coll_hwsplit_s (
432
+ qvi_hwsplit_coll_s::qvi_hwsplit_coll_s (
433
433
qv_scope_t *parent,
434
434
uint_t npieces,
435
435
int color,
@@ -438,7 +438,7 @@ qvi_coll_hwsplit_s::qvi_coll_hwsplit_s(
438
438
, m_color(color)
439
439
{
440
440
const qvi_group_t *const pgroup = m_parent->group ();
441
- if (pgroup->rank () == qvi_coll_hwsplit_s ::s_rootid) {
441
+ if (pgroup->rank () == qvi_hwsplit_coll_s ::s_rootid) {
442
442
m_hwsplit = qvi_hwsplit_s (
443
443
m_parent, pgroup->size (), npieces, split_at_type
444
444
);
@@ -447,7 +447,7 @@ qvi_coll_hwsplit_s::qvi_coll_hwsplit_s(
447
447
448
448
template <typename TYPE>
449
449
int
450
- qvi_coll_hwsplit_s ::scatter_values (
450
+ qvi_hwsplit_coll_s ::scatter_values (
451
451
const std::vector<TYPE> &values,
452
452
TYPE *value
453
453
) {
@@ -490,7 +490,7 @@ qvi_coll_hwsplit_s::scatter_values(
490
490
491
491
template <typename TYPE>
492
492
int
493
- qvi_coll_hwsplit_s ::bcast_value (
493
+ qvi_hwsplit_coll_s ::bcast_value (
494
494
TYPE *value
495
495
) {
496
496
static_assert (std::is_trivially_copyable<TYPE>::value, " " );
@@ -506,7 +506,7 @@ qvi_coll_hwsplit_s::bcast_value(
506
506
507
507
template <typename TYPE>
508
508
int
509
- qvi_coll_hwsplit_s ::gather_values (
509
+ qvi_hwsplit_coll_s ::gather_values (
510
510
TYPE invalue,
511
511
std::vector<TYPE> &outvals
512
512
) {
@@ -554,7 +554,7 @@ qvi_coll_hwsplit_s::gather_values(
554
554
}
555
555
556
556
int
557
- qvi_coll_hwsplit_s ::gather_hwpools (
557
+ qvi_hwsplit_coll_s ::gather_hwpools (
558
558
qvi_hwpool_s *txpool,
559
559
std::vector<qvi_hwpool_s *> &rxpools
560
560
) {
@@ -597,20 +597,19 @@ qvi_coll_hwsplit_s::gather_hwpools(
597
597
}
598
598
599
599
int
600
- qvi_coll_hwsplit_s ::gather (void )
600
+ qvi_hwsplit_coll_s ::gather (void )
601
601
{
602
- int rc = gather_values (qvi_task_t::mytid (), m_hwsplit.m_taskids );
602
+ int rc = gather_values (qvi_task_t::mytid (), m_hwsplit.m_group_tids );
603
+ if (qvi_unlikely (rc != QV_SUCCESS)) return rc;
604
+ rc = gather_values (m_color, m_hwsplit.m_colors );
603
605
if (qvi_unlikely (rc != QV_SUCCESS)) return rc;
604
606
// Note that the result hwpools are copies, so we can modify them freely.
605
607
rc = gather_hwpools (m_parent->hwpool (), m_hwsplit.m_hwpools );
606
608
if (qvi_unlikely (rc != QV_SUCCESS)) return rc;
607
609
608
- rc = gather_values (m_color, m_hwsplit.m_colors );
609
- if (qvi_unlikely (rc != QV_SUCCESS)) return rc;
610
-
611
- const int myid = m_parent->group ()->rank ();
610
+ const int myrank = m_parent->group ()->rank ();
612
611
const uint_t group_size = m_parent->group ()->size ();
613
- if (myid == qvi_coll_hwsplit_s ::s_rootid) {
612
+ if (myrank == qvi_hwsplit_coll_s ::s_rootid) {
614
613
m_hwsplit.m_affinities .resize (group_size);
615
614
for (uint_t tid = 0 ; tid < group_size; ++tid) {
616
615
hwloc_cpuset_t cpuset = nullptr ;
@@ -627,7 +626,7 @@ qvi_coll_hwsplit_s::gather(void)
627
626
}
628
627
629
628
int
630
- qvi_coll_hwsplit_s ::scatter_hwpools (
629
+ qvi_hwsplit_coll_s ::scatter_hwpools (
631
630
const std::vector<qvi_hwpool_s *> &pools,
632
631
qvi_hwpool_s **pool
633
632
) {
@@ -667,7 +666,7 @@ qvi_coll_hwsplit_s::scatter_hwpools(
667
666
}
668
667
669
668
int
670
- qvi_coll_hwsplit_s ::scatter (
669
+ qvi_hwsplit_coll_s ::scatter (
671
670
int *colorp,
672
671
qvi_hwpool_s **result
673
672
) {
@@ -677,13 +676,13 @@ qvi_coll_hwsplit_s::scatter(
677
676
}
678
677
679
678
int
680
- qvi_coll_hwsplit_s ::barrier (void )
679
+ qvi_hwsplit_coll_s ::barrier (void )
681
680
{
682
681
return m_parent->group ()->barrier ();
683
682
}
684
683
685
684
int
686
- qvi_coll_hwsplit_s ::split (
685
+ qvi_hwsplit_coll_s ::split (
687
686
int *colorp,
688
687
qvi_hwpool_s **result
689
688
) {
0 commit comments