Skip to content

Commit e509185

Browse files
committed
Adding more content to Topic #1
1 parent 5211cac commit e509185

15 files changed

+334
-118
lines changed

000_objectives.md

+22-23
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@ title: About
44
description: Curricular information
55
---
66

7-
87
<div class="ui container raised border segment">
98

109
<h3 class="ui header">
1110
Target audience
1211
</h3>
1312

14-
<ul class="ui list">
13+
<div class="ui list bulleted">
1514

16-
<li class="ui item"> Students/Researchers/Practitioners who want to complement their learning with hands-on experience with distributed-memory programming, message-passing, MPI, and high performance computing</li>
17-
<li class="ui item"> Instructors who want to provide students with compelling hands-on experiences as part of the coursework they develop</i>
18-
</ul>
15+
<div class="ui item"> Students/Researchers/Practitioners who want to complement their learning with hands-on experience with distributed-memory programming, message-passing, MPI, and high performance computing</div>
16+
<div class="ui item"> Instructors who want to provide students with compelling hands-on experiences as part of the coursework they develop</div>
17+
</div>
1918

2019
</div>
2120

@@ -25,13 +24,13 @@ Target audience
2524
Prerequisites
2625
</h3>
2726

28-
<ul class="ui list">
29-
<li class="ui item">Access to a Linux (virtual) machine</li>
30-
<li class="ui item">Some Computer Science background (i.e., a few courses)</li>
31-
<li class="ui item">Basic C programming skills (i.e., a 1-semester course)</li>
32-
<li class="ui item">Elementary Linux command-line skills</li>
33-
<li class="ui item">Access to MPI documentation/tutorials</li>
34-
</ul>
27+
<div class="ui list bulleted">
28+
<div class="ui item">Access to a Linux (virtual) machine</div>
29+
<div class="ui item">Some Computer Science background (i.e., a few courses)</div>
30+
<div class="ui item">Basic C programming skills (i.e., a 1-semester course)</div>
31+
<div class="ui item">Elementary Linux command-line skills</div>
32+
<div class="ui item">Access to MPI documentation/tutorials</div>
33+
</div>
3534

3635
</div>
3736

@@ -48,12 +47,12 @@ Learning Objectives
4847
programs that run on distributed-memory architectures, using the MPI standard.</b>
4948

5049
Specific learning objectives include:
51-
<ul class="ui list">
52-
<li class="ui item"> Learn the fundamentals of the MPI API</li>
53-
<li class="ui item"> Understand general distributed-memory programming and learn standard solutions</li>
54-
<li class="ui item"> Learn how to implement distributed-memory programs, going from traditional "rigid" programs to more "dynamic" programs</li>
55-
<li class="ui item"> Understand and experience performance trade-offs when implementing and executing distributed-memory programs on ranges of distributed-memory platforms</li>
56-
</ul>
50+
<div class="ui list bulleted">
51+
<div class="ui item"> Learn the fundamentals of the MPI API</div>
52+
<div class="ui item"> Understand general distributed-memory programming and learn standard solutions</div>
53+
<div class="ui item"> Learn how to implement distributed-memory programs, going from traditional "rigid" programs to more "dynamic" programs</div>
54+
<div class="ui item"> Understand and experience performance trade-offs when implementing and executing distributed-memory programs on ranges of distributed-memory platforms</div>
55+
</div>
5756
</div>
5857

5958

@@ -67,11 +66,11 @@ While many curricular materials have been developed for teaching message-passing
6766
this CourseWare relies on the use of _simulation_, which has the following advantages:
6867

6968

70-
<ul class="ui list">
71-
<li class="ui list"> No need to have access to a distributed-memory platform</li>
72-
<li class="ui list"> Ability to run many experiments quickly and reproducibly on one's own computer</li>
73-
<li class="ui list"> Ability to explore arbitrary "what if?" scenarios, in particular to experience performance trade-offs first-hand</li>
74-
</ul>
69+
<div class="ui list bulleted">
70+
<div class="ui item"> No need to have access to a distributed-memory platform</div>
71+
<div class="ui item"> Ability to run many experiments quickly and reproducibly on one's own computer</div>
72+
<div class="ui item"> Ability to explore arbitrary "what if?" scenarios, in particular to experience performance trade-offs first-hand</div>
73+
</div>
7574

7675
This CourseWare uses
7776
<a href="http://simgrid.gforge.inria.fr/simgrid/latest/doc/group__SMPI__API.html">SMPI</a> (Simulated MPI),

_config.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Dependencies
2-
markdown: redcarpet
3-
highlighter: pygments
2+
#markdown: redcarpet
3+
#highlighter: pygments
4+
5+
markdown: kramdown
6+
kramdown:
7+
hard_wrap: false
8+
input: GFM
9+
syntax_highlighter: pygments
10+
411

512
# Permalinks
613
permalink: pretty

_includes/head.html

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<!-- Semantic UI, JQuery, etc. -->
1616
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/semantic/semantic.min.css">
1717
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/public/basics.css">
18+
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/public/syntax.css">
1819

1920
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
2021
<script src="{{ site.baseurl }}/semantic/components/accordion.js"></script>

index.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ navigate: false
66
---
77

88
<div class="ui container raised segment padded">
9-
<font size=+1>
109

1110
<p class="ui">
1211
SMPI CourseWare is a set of hands-on pedagogic materials focused on teaching high performance computing and distributed memory computing in simulation. This is
@@ -23,8 +22,7 @@ to be included into existing courses.
2322

2423
<p class="ui">
2524
Using the navigation bar on the left you can see the specific learning objectives, and explore the covered topics. Each topic consists of
26-
short tutorial information and of many hands-on activities. Topic #0 is a good place to start :)
25+
short tutorial information and of many hands-on activities. Topic #0 is a good place to start.
2726
</p>
2827

29-
</font>
3028
</div>

public/syntax.css

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
.highlight { background: #ffffff; }
2+
.highlight .c { color: #999988; font-style: italic } /* Comment */
3+
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
4+
.highlight .k { font-weight: bold } /* Keyword */
5+
.highlight .o { font-weight: bold } /* Operator */
6+
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
7+
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
8+
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
9+
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
10+
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
11+
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
12+
.highlight .ge { font-style: italic } /* Generic.Emph */
13+
.highlight .gr { color: #aa0000 } /* Generic.Error */
14+
.highlight .gh { color: #999999 } /* Generic.Heading */
15+
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
16+
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
17+
.highlight .go { color: #888888 } /* Generic.Output */
18+
.highlight .gp { color: #555555 } /* Generic.Prompt */
19+
.highlight .gs { font-weight: bold } /* Generic.Strong */
20+
.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
21+
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
22+
.highlight .kc { font-weight: bold } /* Keyword.Constant */
23+
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
24+
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
25+
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
26+
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
27+
.highlight .m { color: #009999 } /* Literal.Number */
28+
.highlight .s { color: #d14 } /* Literal.String */
29+
.highlight .na { color: #008080 } /* Name.Attribute */
30+
.highlight .nb { color: #0086B3 } /* Name.Builtin */
31+
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
32+
.highlight .no { color: #008080 } /* Name.Constant */
33+
.highlight .ni { color: #800080 } /* Name.Entity */
34+
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
35+
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
36+
.highlight .nn { color: #555555 } /* Name.Namespace */
37+
.highlight .nt { color: #000080 } /* Name.Tag */
38+
.highlight .nv { color: #008080 } /* Name.Variable */
39+
.highlight .ow { font-weight: bold } /* Operator.Word */
40+
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
41+
.highlight .mf { color: #009999 } /* Literal.Number.Float */
42+
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
43+
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
44+
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
45+
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
46+
.highlight .sc { color: #d14 } /* Literal.String.Char */
47+
.highlight .sd { color: #d14 } /* Literal.String.Doc */
48+
.highlight .s2 { color: #d14 } /* Literal.String.Double */
49+
.highlight .se { color: #d14 } /* Literal.String.Escape */
50+
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
51+
.highlight .si { color: #d14 } /* Literal.String.Interpol */
52+
.highlight .sx { color: #d14 } /* Literal.String.Other */
53+
.highlight .sr { color: #009926 } /* Literal.String.Regex */
54+
.highlight .s1 { color: #d14 } /* Literal.String.Single */
55+
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
56+
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
57+
.highlight .vc { color: #008080 } /* Name.Variable.Class */
58+
.highlight .vg { color: #008080 } /* Name.Variable.Global */
59+
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
60+
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<div class="ui top attached tabular menu">
2+
<a class="item active" data-tab="second/a">2A</a>
3+
<a class="item" data-tab="second/b">2B</a>
4+
<a class="item" data-tab="second/c">2C</a>
5+
</div>
6+
<div class="ui bottom attached tab segment active" data-tab="second/a">2A</div>
7+
<div class="ui bottom attached tab segment" data-tab="second/b">2B</div>
8+
<div class="ui bottom attached tab segment" data-tab="second/c">2C</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<div class="ui top attached tabular menu">
2+
<a class="item active" data-tab="second/a">2A</a>
3+
<a class="item" data-tab="second/b">2B</a>
4+
<a class="item" data-tab="second/c">2C</a>
5+
</div>
6+
<div class="ui bottom attached tab segment active" data-tab="second/a">2A</div>
7+
<div class="ui bottom attached tab segment" data-tab="second/b">2B</div>
8+
<div class="ui bottom attached tab segment" data-tab="second/c">2C</div>

topic_basics_of_distributed_memory_programming/about.html

-61
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
/*
3+
* compute_julia_pixel(): compute RBG values of a pixel in a
4+
* particular Julia set image.
5+
*
6+
* In:
7+
* (x,y): pixel coordinates
8+
* (width, height): image dimensions
9+
* tint_bias: a float to "tweak" the tint (1.0 is "no tint")
10+
* Out:
11+
* rgb: an already-allocated 3-byte array into which R, G, and B
12+
* values are written.
13+
*
14+
* Return:
15+
* 0 in success, -1 on failure
16+
*
17+
*/
18+
19+
int compute_julia_pixel(int x, int y, int width, int height, float tint_bias, unsigned char *rgb) {
20+
21+
// Check coordinates
22+
if ((x < 0) || (x >= width) || (y < 0) || (y >= height)) {
23+
fprintf(stderr,"Invalid (%d,%d) pixel coordinates in a %d x %d image\n", x, y, width, height);
24+
return -1;
25+
}
26+
27+
// "Zoom in" to a pleasing view of the Julia set
28+
float X_MIN = -1.6, X_MAX = 1.6, Y_MIN = -0.9, Y_MAX = +0.9;
29+
float float_y = (Y_MAX - Y_MIN) * (float)y / height + Y_MIN ;
30+
float float_x = (X_MAX - X_MIN) * (float)x / width + X_MIN ;
31+
32+
// Point that defines the Julia set
33+
float julia_real = -.79;
34+
float julia_img = .15;
35+
36+
// Maximum number of iteration
37+
int max_iter = 300;
38+
39+
// Compute the complex series convergence
40+
float real=float_y, img=float_x;
41+
int num_iter = max_iter;
42+
while (( img * img + real * real < 2 * 2 ) && ( num_iter > 0 )) {
43+
float xtemp = img * img - real * real + julia_real;
44+
real = 2 * img * real + julia_img;
45+
img = xtemp;
46+
num_iter--;
47+
}
48+
49+
// Paint pixel based on how many iterations were used, using some funky colors
50+
float color_bias = (float) num_iter / max_iter;
51+
rgb[0] = (num_iter == 0 ? 200 : - 500.0 * pow(tint_bias, 1.2) * pow(color_bias, 1.6));
52+
rgb[1] = (num_iter == 0 ? 100 : -255.0 * pow(color_bias, 0.3));
53+
rgb[2] = (num_iter == 0 ? 100 : 255 - 255.0 * pow(tint_bias, 1.2) * pow(color_bias, 3.0));
54+
55+
return 0;
56+
}

topic_basics_of_distributed_memory_programming/index.html

+10-29
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,27 @@
22

33

44
<div class="ui pointing secondary menu">
5-
<a class="item active" data-tab="first">About</a>
5+
<a class="item active" data-tab="first">Introduction</a>
66
<a class="item " data-tab="second">Activity #1</a>
77
<a class="item" data-tab="third">Activity #2</a>
88
<a class="item" data-tab="fourth">Activity #3</a>
99
</div>
10+
1011
<div class="ui tab segment active" data-tab="first">
11-
{% include_relative topic_basics_of_distributed_memory_programming/about.html %}
12+
{% include_relative topic_basics_of_distributed_memory_programming/introduction.html %}
1213
</div>
14+
15+
1316
<div class="ui tab segment " data-tab="second">
14-
<div class="ui top attached tabular menu">
15-
<a class="item active" data-tab="second/a">2A</a>
16-
<a class="item" data-tab="second/b">2B</a>
17-
<a class="item" data-tab="second/c">2C</a>
18-
</div>
19-
<div class="ui bottom attached tab segment active" data-tab="second/a">2A</div>
20-
<div class="ui bottom attached tab segment" data-tab="second/b">2B</div>
21-
<div class="ui bottom attached tab segment" data-tab="second/c">2C</div>
17+
{% include_relative topic_basics_of_distributed_memory_programming/sequential.html %}
2218
</div>
19+
2320
<div class="ui tab segment" data-tab="third">
24-
<div class="ui top attached tabular menu">
25-
<a class="item" data-tab="third/a">3A</a>
26-
<a class="item" data-tab="third/b">3B</a>
27-
<a class="item" data-tab="third/c">3C</a>
28-
</div>
29-
<div class="ui bottom attached tab segment" data-tab="third/a">3A</div>
30-
<div class="ui bottom attached tab segment" data-tab="third/b">3B</div>
31-
<div class="ui bottom attached tab segment" data-tab="third/c">3C</div>
21+
{% include_relative topic_basics_of_distributed_memory_programming/1D.html %}
3222
</div>
23+
3324
<div class="ui tab segment" data-tab="fourth">
34-
<div class="ui top attached tabular menu">
35-
<a class="item" data-tab="third/a">3A</a>
36-
<a class="item" data-tab="third/b">3B</a>
37-
<a class="item" data-tab="third/c">3C</a>
38-
</div>
39-
<div class="ui bottom attached tab segment" data-tab="third/a">3A</div>
40-
<div class="ui bottom attached tab segment" data-tab="third/b">3B</div>
41-
<div class="ui bottom attached tab segment" data-tab="third/c">3C</div>
25+
{% include_relative topic_basics_of_distributed_memory_programming/2D.html %}
4226
</div>
4327

4428

45-
<!--</div>-->
46-
47-

0 commit comments

Comments
 (0)