Skip to content

Commit 258220d

Browse files
committed
#276: tutorial: factor out of tutorial number of elements
1 parent 374ccfc commit 258220d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tutorial/tutorial_2b.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,11 @@ void ReduceCol::reduceHandler() {
8282
proxy.allreduce<&ReduceCol::reduceTarget>(val);
8383
}
8484

85+
int number_of_elements = 32;
86+
8587
void ReduceCol::reduceTarget(int value) {
8688
fmt::print("collection reduce value={}\n", value);
87-
assert(32 * 100 == value);
89+
assert(number_of_elements * 100 == value);
8890

8991
}
9092

@@ -99,8 +101,8 @@ static inline void collectionReduce() {
99101
*/
100102

101103
if (this_node == 0) {
102-
// Range of 32 elements for the collection
103-
auto range = vt::Index1D(32);
104+
// Range of `number_of_elements` elements for the collection
105+
auto range = vt::Index1D(number_of_elements);
104106

105107
// Construct the collection in a rooted manner. By default, the elements
106108
// will be block mapped to the nodes

0 commit comments

Comments
 (0)