@@ -641,7 +641,9 @@ qvi_hwsplit_coll::scatter_values(
641
641
}
642
642
643
643
rc = group->scatter (txbuffs.data (), rootid, &rxbuff);
644
- if (qvi_unlikely (rc != QV_SUCCESS)) goto out;
644
+ if (qvi_unlikely (rc != QV_SUCCESS)) {
645
+ goto out;
646
+ }
645
647
646
648
*value = *(TYPE *)rxbuff->data ();
647
649
out:
@@ -692,7 +694,7 @@ qvi_hwsplit_coll::gather_values(
692
694
return rc;
693
695
}
694
696
// Gather the values to the root.
695
- bool shared = false ;
697
+ qvi_alloc_type_t shared = ALLOC_PRIVATE ;
696
698
qvi_bbuff **bbuffs = nullptr ;
697
699
rc = group->gather (txbuff, rootid, &shared, &bbuffs);
698
700
if (qvi_unlikely (rc != QV_SUCCESS)) goto out;
@@ -705,14 +707,15 @@ qvi_hwsplit_coll::gather_values(
705
707
}
706
708
}
707
709
out:
708
- if (! shared || (shared && (group->rank () == rootid))) {
710
+ if ((ALLOC_PRIVATE == shared) || ((ALLOC_SHARED == shared) && (group->rank () == rootid))) {
709
711
if (bbuffs) {
710
- for (uint_t i = 0 ; i < group_size; ++i) {
712
+ for (uint_t i = 0 ; i < group_size; ++i) {
711
713
qvi_bbuff_delete (&bbuffs[i]);
712
714
}
713
715
delete[] bbuffs;
714
716
}
715
717
}
718
+
716
719
qvi_bbuff_delete (&txbuff);
717
720
if (qvi_unlikely (rc != QV_SUCCESS)) {
718
721
// If something went wrong, just zero-initialize the values.
@@ -733,7 +736,7 @@ qvi_hwsplit_coll::gather_hwpools(
733
736
int rc = txpool->packinto (&txbuff);
734
737
if (qvi_unlikely (rc != QV_SUCCESS)) return rc;
735
738
// Gather the values to the root.
736
- bool shared = false ;
739
+ qvi_alloc_type_t shared = ALLOC_PRIVATE ;
737
740
qvi_bbuff **bbuffs = nullptr ;
738
741
rc = group->gather (&txbuff, rootid, &shared, &bbuffs);
739
742
if (rc != QV_SUCCESS) goto out;
@@ -749,14 +752,15 @@ qvi_hwsplit_coll::gather_hwpools(
749
752
}
750
753
}
751
754
out:
752
- if (! shared || (shared && (group->rank () == rootid))) {
755
+ if ((ALLOC_PRIVATE == shared) || ((ALLOC_SHARED == shared) && (group->rank () == rootid))) {
753
756
if (bbuffs) {
754
757
for (uint_t i = 0 ; i < group_size; ++i) {
755
758
qvi_bbuff_delete (&bbuffs[i]);
756
759
}
757
760
delete[] bbuffs;
758
761
}
759
762
}
763
+
760
764
if (rc != QV_SUCCESS) {
761
765
// If something went wrong, just zero-initialize the pools.
762
766
rxpools = {};
0 commit comments