Skip to content

Commit f722a6b

Browse files
committed
Typos--
1 parent 364ecb3 commit f722a6b

File tree

17 files changed

+41
-44
lines changed

17 files changed

+41
-44
lines changed

topic_basics_of_distributed_memory_programming/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
<p class="ui">This topic introduces basic but essential concepts for distributed-memory programming
66
(Single-Program Multiple-Data (SPMD) programming style, the use of <i>process rank</i> to distribute work among processes,
7-
local vs. Global indices for 1-D and 2-D data distribution of arrays, simple message-passing to coordinate processes).
8-
The focus is mostly on correctness, and only a little bit on performance.
7+
local vs. global indices for 1-D and 2-D data distribution of arrays, simple message-passing to coordinate processes).
8+
The focus is mostly on correctness, and only a tiny bit on performance.
99
</p>
1010
</div>
1111

topic_basics_of_distributed_memory_programming/julia_set/1D_step1.html

+6-3
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,21 @@
2323

2424
<div class="ui list bulleted">
2525
<div class="item">Takes a single command-line argument, n, an integer that's strictly positive.</div>
26-
<div class="item">Have each process print out its rank (out of how many processes in total), and
26+
<div class="item">Has each process print out its rank (out of how many processes in total), and
2727
which rows of the image (as a range) it should compute (but actually do nothing for now). See the sample
28-
executions below to see what kind of output is expected.</div>
28+
executions below to see what kind of output is expected.
29+
<div class="ui list bulleted">
2930
<div class="item">The intended data distribution should be in as many "slabs" as there are processes, where
3031
each process is in charge of a set of contiguous rows.</div>
3132
<div class="item">The distribution should be <b>as balanced as possible</b> (at most
3233
a difference of one row between two processes)</div>
34+
</div>
35+
</div>
3336
</div>
3437

3538
<p class="ui">
3639
<i>Hint: </i> Computing the data distribution (i.e., for each process finding out which rows it should
37-
process) can be done using discrete math so that everything is computing as some large formula. But many find it simpler to compute
40+
process) can be done using discrete math so that everything is computed by a single formula. But many find it simpler to compute
3841
it programmatically with a loop (i.e., "counting by hand").
3942
</p>
4043

topic_basics_of_distributed_memory_programming/julia_set/1D_step2.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<p class="ui">
2-
Augment your program that that each process allocates space to store the pixels it needs to compute, and
2+
Augment your program so that each process allocates space to store the pixels it needs to compute, and
33
then computes them. <b>A process must only allocate space for the pixels it needs to compute</b>. In practice,
44
each process runs on a different hosts, and one wishes to compute a large image that does not fit in the
55
memory of a single host (which is one of the main motivations for going the "distributed-memory computing" route).
66
</p>
77

88
<p class="ui">
9-
The main difficulty here is keeping local vs. global indexing straight. That is, although as a programmer
10-
with think of the image as an array of, say, N pixels, no N-pixel array is ever allocated in the program (only
11-
smaller arrays allocated on each process).
9+
The main difficulty here is keeping local vs. global indexing straight. That is, although as programmers
10+
we think of the image as an array of, say, N pixels, no N-pixel array is ever allocated in the program (only
11+
smaller arrays allocated by each process).
1212
</p>
1313

1414
<div class="ui accordion fluid">
@@ -41,7 +41,7 @@
4141
<p class="ui">
4242
The answer to the above depends on the data distribution! Say that process 0 (i.e., process with
4343
rank 0) holds items 0 to 99 (global indices), process 1 holds items 100 to 199 (global indices), etc.
44-
So, for a given i between 0 and 1999, which this data distribution, I have:
44+
So, for a given i between 0 and 1999, with this data distribution, I have:
4545
</p>
4646
<div class="ui list bulleted">
4747
<div class="ui item">Item #i is held by process with rank i/100</div>
@@ -52,7 +52,7 @@
5252
in the array declared locally in the process), as opposed to i which is the <i>global index</i>.</p>
5353

5454
<p>The more complicated the distribution, the more intricate the global-to-local or local-to-global
55-
conversion. 1-D data distributions are the simplest. In an upcoming activity we'll deal with a 2-D
55+
conversion. 1-D data distributions, like the one above, are the simplest. In the next activity we'll deal with a 2-D
5656
data distribution.</p>
5757

5858
</div>

topic_basics_of_distributed_memory_programming/julia_set/1D_step3.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p class="ui">
2-
Augment your program that that the Julia set is saved to a bmp file. This requires some coordination between the
2+
Augment your program so that the Julia set is saved to a bmp file. This requires some coordination between the
33
processes:
44
<div class="ui list bulleted">
55
<div class="ui item">Only one process must create the file and write the header</div>
@@ -11,7 +11,7 @@
1111
<p class="ui">
1212
First you must pick one process to create the file and write the header to it
1313
(it is typical to pick process of rank 0). Second, each process, after its done computing
14-
its pixels, waits for a "go ahead!" message from its predecessor, and then sends a "go ahead!"
14+
its pixels, waits for a "go ahead!" message from its predecessor, writes to the file, and then sends a "go ahead!"
1515
message to its successor. The exceptions are the process with rank 0, which does not need to wait for
1616
a message, and the last process, which does not need to send a message. It doesn't really matter
1717
what these messages contain (e.g., they can be a single byte, or even zero-byte messages),
@@ -20,7 +20,7 @@
2020
</p>
2121

2222
<p class="ui">
23-
<b>Warning:</b> Make sure that your processes compute in parallel. That is, all processes compute, and then
23+
<b>Warning:</b> Make sure that your processes compute in parallel. That is, all processes compute together, and then
2424
they take turn writing what they have computed to the file.
2525
</p>
2626

@@ -44,13 +44,13 @@
4444
<div class="content">
4545
<p class="ui message">
4646
Although the above scheme is pretty simple, what we are really doing is creating a <i>logical topology</i>. That is,
47-
based on ranks, we impose structure on our set of processes. In this case, a "linear chain" in which process #i communicates
47+
based on process rank, we impose structure on our set of processes. In this case, a "linear chain" in which process #i communicates
4848
with process #i+1. Probably the simplest structure. We will see examples of more complex logical topologies.
4949
Different applications lend themselves naturally to different logical topologies (rings, grids, trees, etc.).
5050
One interesting question, which is outside
5151
the score of this topic, is how well the logical topology matches the physical topology of the actual
5252
parallel platform in use (a good match typically boosts performance). Ideally, one can define a logical topology
53-
that makes writing the application intuitive, and that is also well-matched to the physical platform.
53+
that makes writing the application easy, and that is also well-matched to the physical platform.
5454
</p>
5555
</div>
5656
</div>

topic_basics_of_distributed_memory_programming/julia_set/2D_step1.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<p class="ui">
2020
This 2-D data distribution complicates the global vs. local indexing issue that was
2121
discussed in Activity #2. The first thing to do is to figure out which process is responsible
22-
for each tile. A common approach is to use a row-major view of the processes. In other words,
22+
for which tile. A common approach is to use a row-major view of the processes. In other words,
2323
we think of a logical topology in which the processes are organized in a square grid (because
2424
our number of processes is a perfect square). By default, MPI gives us only a linear (i.e., 1-D) rank.
2525
We "transform" this rank into a 2-D rank where each process has a "row" and a "column", using a row-major

topic_basics_of_distributed_memory_programming/julia_set/2D_step2.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<p class="ui">
2-
Augment your program that that each process allocates space to store the pixels it needs to compute, and
2+
Augment your program so that each process allocates space to store the pixels it needs to compute, and
33
then computes them. As in the previous activity, the main difficulty here is
4-
keeping local vs. global indexing straight. It is in fact a bit more complex
5-
than for Activity #2 due to the use of a 2-D date distribution.
4+
keeping local vs. global indexing straight. It is a bit more complex
5+
than for Activity #2 due to the use of a 2-D data distribution.
66
</p>
77

88
<p class="ui">
99
Have each process apply a <i>tint</i> to the pixels it handles, by passing
10-
value <code>rank<sup>2</sup></code> as the 5th argument to
10+
value <code>rank<sup>2</sup></code> (i.e., the square of the rank) as the 5th argument to
1111
function <code>compute_julia_pixel()</code> (instead of passing the default
1212
1.0 value).
1313
</p>

topic_basics_of_distributed_memory_programming/julia_set/2D_step3.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<p class="ui">
2-
Augment your program that that the Julia set is saved to a bmp file.
2+
Augment your program so that the Julia set is saved to a bmp file.
33
The difference with Activity #2 is that now each process holds a tile, and
4-
yet the file must contains the pixels in row major order. So each process
4+
yet the file must contain the pixels in row major order. So each process
55
will have to append many times to the file, writing one piece of a row at a time.
66
As a result, more complex coordination is required compared to
77
Activity #2.
@@ -23,7 +23,7 @@
2323
</p>
2424
</div>
2525
<div class="ui row">
26-
The figure above show an example with 9 processes (2-D rank coordinates are shown
26+
The figure above shows an example with 9 processes (2-D rank coordinates are shown
2727
in red), where each process holds a 4x8 tile (4 row segments). The numbers on
2828
each segment indicate the sequence in which the pixels must be written to the
2929
file. In this example, there are 36 row segments. First process (0,0)

topic_basics_of_distributed_memory_programming/julia_set/introduction.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ <h3 class="ui header">Roadmap</h3>
2525
and
2626
outputs it to a bmp file.
2727
</li>
28-
<li class="item"><b>Activity #2:</b> Realize a parallel implementation the program using MPI, using a 1-D data
28+
<li class="item"><b>Activity #2:</b> Realize a parallel implementation the program with MPI, using a 1-D data
2929
distribution.
3030
</li>
31-
<li class="item"><b>Activity #3:</b> Realize a parallel implementation the program using MPI, using a 2-D data
31+
<li class="item"><b>Activity #3:</b> Realize a parallel implementation the program with MPI, using a 2-D data
3232
distribution.
3333
</li>
3434
</ul>
@@ -41,7 +41,7 @@ <h3 class="ui header">What to turn in</h3>
4141
<p class="ui">You should turn in a single archive (or a github repo) with:
4242
<div class="ui bulleted list">
4343
<div class="item">All source code</div>
44-
<div class="item">XML platform files (see details in the activities)</div>
44+
<div class="item">XML platform files and host files (see details in the activities)</div>
4545
<div class="item">A Makefile that compiles all executables (and has a 'clean' target!)</div>
4646
<div class="item">A README file with answers to the questions asked in the activities</div>
4747
</div>

topic_basics_of_distributed_memory_programming/julia_set/julia_accordion.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<li class="item">z<sub>n+1</sub> = z<sub>n</sub><sup>2</sup> + c</li>
2323
</ul>
2424
where c = -0.79 + i * 0.15. Different
25-
values of c lead to different images, we know many values that produce "pretty" images.
25+
values of c lead to different images, and we know many values that produce "pretty" images.
2626
</p>
2727
<p class="ui">
2828
The color of a pixel corresponding to point z is determined based on the number of iterations

topic_basics_of_distributed_memory_programming/julia_set/sequential.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
In this activity we develop a simple sequential (i.e., non-parallel) programs that computes a
1+
In this activity we develop a simple sequential (i.e., non-parallel) program that computes a
22
Julia set and saves it to a bitmap file. We break it down into the two steps below:
33
<br>
44

topic_basics_of_distributed_memory_programming/julia_set/sequential_step1.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<div class="ui list bulleted">
44
<div class="item">Takes a single command-line argument, n, an <code>integer</code> that's strictly positive.</div>
5-
<div class="item">Allocates an 1-D <code>unsigned char</code> n * (2 * n) *3 elements. This array is used to
5+
<div class="item">Allocates an 1-D <code>unsigned char</code> array of n*(2*n)*3 elements. This array is used to store
66
the pixels of an image with height (in pixels) of n width (in pixels) of 2n, where each pixel is encoded using 3 bytes (RGB
77
values).
88
</div>
@@ -12,7 +12,7 @@
1212
<p class="ui">
1313
To make the above easier you are provided with one helper C function, <code>compute_julia_pixel()</code>, to which
1414
you pass the (x,y) coordinates of a pixed, the (width, height) dimensions of the image, a "tint" float (pass 1.0
15-
for now), and a pointer to 3 contiguous bytes (<code>unsigned char</code>). These bytes are set to appropriate
15+
for now), and a pointer to 3 contiguous bytes (<code>unsigned char *</code>). These bytes are set to appropriate
1616
RGB values (Red Green Blue) for displaying the Julia set.
1717
<a target="_blank" href="{{site.baseurl}}topic_basics_of_distributed_memory_programming/julia/compute_julia_pixel.c">[Download
1818
source of compute_julia_pixel()]</a>
@@ -35,7 +35,7 @@
3535
<br>
3636

3737
<p class="ui">
38-
The program must store the pixels of the 2-D image into a <b>1-D array using a <i>row-major scheme</i></b>.
38+
The program must store the pixels of the 2-D image into the <b>1-D array using a <i>row-major scheme</i></b>.
3939
</p>
4040

4141

@@ -52,7 +52,7 @@ <h4 class="ui header">Storing 2-D data is a row-major 1-D array</h4>
5252
You may find the use of a 1-D array to store the pixels surprising, since after all the image is 2-D. However, it is
5353
common to use 1-D arrays, especially when they are dynamically allocated. One option would be to allocate an array
5454
of pointers to
55-
1-D arrays, making it possible to access elements with the convenient syntax <code>Array[i][j]</code>.
55+
1-D arrays, where each 1-D array represents a pixel row. This would make it possible to access elements with the convenient syntax <code>Array[i][j]</code>.
5656
But this is typically a bad idea as it reduces locality (i.e., the efficient use of the cache), which in turns harms
5757
performance.
5858
</p>
@@ -67,7 +67,7 @@ <h4 class="ui header">Storing 2-D data is a row-major 1-D array</h4>
6767

6868

6969
Now that the program computes the Julia set pixels as a 1-D array of 3-byte elements, it would be nice to see them (if only to check
70-
that they're set correctly). So move on to Step #2 (next tab)...
70+
that they're set correctly). So let's move on to Step #2...
7171

7272

7373

topic_basics_of_distributed_memory_programming/julia_set/sequential_step2.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</div>
3131

3232
<p class="ui">
33-
<b>Warning: </b> If the number of width of the image in number of pixels, 2n, is not a multiple of 4 (i.e., in our case
33+
<b>Warning: </b> If the width of the image in number of pixels, 2n, is not a multiple of 4 (i.e., in our case
3434
if n is odd), then the bmp file format requires that each row of pixel be <i>padded</i>. This means that
3535
extra bytes must be written to the file to make the number of bytes in each pixel row a multiple of 4 in case it
3636
is not. <b>For
@@ -43,7 +43,7 @@
4343
<p class="ui">
4444
Verify that your program outputs the expected Julia set, by opening the bmp file with your favorite
4545
image viewer. Try different values of n and check that
46-
your obtain images with the expected resolutions.
46+
your obtain images with the expected resolutions/dimensions.
4747
</p>
4848

4949

topic_flexible_programs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22

33
<p style="text-align:center;" class="ui">
4-
<img align="center" width="200" src="../topic_flexible_programs/under_construction.jpg">
4+
<img align="center" width="200" src="../public/under_construction.jpg">
55
</p>

topic_getting_started/tbd.html

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
<p style="text-align:center;" class="ui">
3-
<img align="center" width="200" src="./under_construction.jpg">
3+
<img align="center" width="200" src="../../public/under_construction.jpg">
44
</p>
Binary file not shown.

0 commit comments

Comments
 (0)