Skip to content

Commit 4e85239

Browse files
committed
switch to more technical vocabulary
1 parent da9144b commit 4e85239

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,16 @@ The example shows the distributed nature of dr data structures. The distributed_
150150

151151
[./src/example4.cpp](src/example4.cpp)
152152

153-
This example demonstrates adding 2 distributed,multidimensional arrays. In this case they have 2 dimensions. There is an std::array to initialize the size of each one of them and they are populated with sequential values using a distributed version of iota - `mhp::iota`. The main part of the code is a for_each loop that computes the sum on a specified number of nodes taking a lambda copy function, 2 input arrays (a and b) and one output array (c) as parameters. The result is printed on a node 0.
153+
This example illustrates adding two distributed,multidimensional arrays. Each array has two dimensions and is initialized by an `std::array`. The arrays are populated with sequential values using a distributed version of iota called `mhp::iota`. A for_each loop is the main part of the code, computing the sum on a specified number of nodes. It takes a lambda copy function along with two input arrays (a and b) and an output array (c) as parameters. The result is printed on a node 0.
154154

155155
### Example 5
156156

157157
[./src/example5.cpp](src/example5.cpp)
158158

159-
Example 5 provides a clear method for calculating a 2D 5-point stencil using distributed multidimensional arrays, specifically `dr::mhp::distributed_mdarray`. Initially, it involves setting up key parameters like the radius for element exchange between nodes through `dr::mhp::halo`, and defining the start and end points of the array slice. Central to this example is the `mhp::stencil_for_each` function, which applies a lambda function to two subsets of the array, designated as input and output. This lambda function, mdspan_stencil_op, performs a simple calculation by summing the values of an element and its neighbors and then averaging them. This process is made possible by `mhp::halo().exchange()`, which allows for the sharing of values across different nodes. Finally, the results are neatly displayed on node 0 using mdspan(), making it easy to understand the changes made to the 2D array. This example is a practical demonstration of performing stencil operations on distributed arrays.
159+
Example 5 outlines a method for calculating a 2D 5-point stencil with distributed multidimensional arrays, specifically utilizing `dr::mhp::distributed_mdarray`. Initially, it involves setting up key parameters like the radius for element exchange between nodes through `dr::mhp::halo`, and defining the start and end points of the array slice. The example's core is the `mhp::stencil_for_each` function, which applies a lambda function to two subsets of the array, designated as input and output. The `mdspan_stencil_op` lambda function conducts a simple calculation that involves adding together the values of an element and its adjacent elements and subsequently calculating their average. The `mhp::halo().exchange()` enables values to be shared across distinct nodes, making this process feasible. Ultimately, the outcomes of the calculation are neatly displayed on node 0 using mdspan(), resulting in a clear indication of the modifications made to the 2D array. This example is a practical demonstration of executing stencil operations on distributed arrays.
160160

161161
### Example 6
162162

163163
[./src/example6.cpp](src/example6.cpp)
164164

165-
The code of this example showcases a 2D pattern search in a distributed, multidimensional array (`mhp::distributed_mdarray<float, 2>`). It initializes a two-dimensional array, populates it using `mhp::iota`, transforms to binary values using `mhp::transform` and defines a 2x2 pattern. The code uses a lambda function to scan the array and mark occurrences of the pattern in a separate array. The mechanism is very similar to the one in the example5.
165+
This example's code demonstrates a 2D pattern search in a distributed, multidimensional array (`mhp::distributed_mdarray<float, 2>`). It initializes a 2D array, populates it with `mhp::iota`, converts it to binary values using `mhp::transform` and defines a pattern of 2x2. A lambda function is used to scan the array and mark occurrences of the pattern in a separate array. The process is similar to the one demonstrated in example5.

0 commit comments

Comments
 (0)