Skip to content

Commit

Permalink
#276: tutorial: factor out of tutorial number of elements
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander committed Jun 13, 2023
1 parent 374ccfc commit 258220d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tutorial/tutorial_2b.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ void ReduceCol::reduceHandler() {
proxy.allreduce<&ReduceCol::reduceTarget>(val);
}

int number_of_elements = 32;

void ReduceCol::reduceTarget(int value) {
fmt::print("collection reduce value={}\n", value);
assert(32 * 100 == value);
assert(number_of_elements * 100 == value);

}

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

if (this_node == 0) {
// Range of 32 elements for the collection
auto range = vt::Index1D(32);
// Range of `number_of_elements` elements for the collection
auto range = vt::Index1D(number_of_elements);

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

0 comments on commit 258220d

Please sign in to comment.