Skip to content

Commit d51a2cf

Browse files
authored
Merge pull request #59 from LLNL/task/rhornung67/fix-readme-links
Proofread pass
2 parents 10076f6 + d5690ab commit d51a2cf

File tree

17 files changed

+165
-119
lines changed

17 files changed

+165
-119
lines changed

Intro_Tutorial/README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# RAJA Portability Suite Intro Tutorial
22

3-
Welcome to the RAJA Portability Suite Intro tutorial. In this tutorial you will learn
4-
how to write an simple application that can target different hardware
5-
architectures using the RAJA and Umpire libraries.
3+
Welcome to the RAJA Portability Suite Intro tutorial. In this tutorial, you
4+
will learn how to use RAJA and Umpire to write simple platform portable code
5+
that can be compiled to target different hardware architectures.
66

77
## Lessons
88

9-
You can find lessons in the lessons subdirectory. Each lesson has a README file
10-
which will introduce new concepts and provide instructions to move forward.
11-
12-
Each lesson builds upon the previous one, so if you get stuck, you can look at
13-
the next lesson to see the complete code. Additionally, some tutorials have
14-
solutions folder with a provided solution.
9+
Lessons are in the `lessons` subdirectory. Each lesson has a README file
10+
that introduces new concepts and provides instructions to complete the lesson.
11+
Each lesson builds on the previous ones to allow you to practice using RAJA
12+
and Umpire capabilities and to reinforce the content.
1513

14+
Lessons contain source files with missing code and instructions for you to fill
15+
in the missing parts along with solution files that contain the completed
16+
lesson code. If you get stuck, you can diff the lesson and solution files to see
17+
the code that the lesson is asking you to fill in.
Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,48 @@
1-
# Lesson 1
1+
# Lesson 1: BLT and CMake
22

3-
In this lesson you will learn how to use BLT and CMake to build an executable.
3+
In this lesson, you will learn how to use BLT and CMake to configure a
4+
software project to build. RAJA and Umpire use BLT and CMake as their build
5+
systems, and so does this tutorial.
46

5-
RAJA and Umpire use BLT and CMake as their build systems, and we recommend them
6-
for other applications, like this tutorial! CMake uses information in a set of
7-
CMakeLists.txt files to generate files to build your project. In this case,
8-
we will be using the `make` program to actually compile everything.
7+
[CMake](https://cmake.org/) is a common tool for building C++ projects and is
8+
used throughout the world. It uses information in `CMakeLists.txt` files located in a software project to generate configuration files to build a code project
9+
on a particular system. Then, a utility like `make` can be used to compile
10+
the code.
911

10-
BLT provides a set of CMake macros that make it easy to write CMake code for HPC
11-
applications targetting multiple hardware architectures.
12+
[BLT](https://github.com/LLNL/blt) provides a foundation of CMake macros and
13+
other tools that simplify the process of Building, Linking, and Testing high
14+
performance computing (HPC) applications. In particular, BLT establishes best
15+
practices for using CMake.
1216

13-
We won't give you a full CMake/BLT tutorial here, just enough to get things moving.
17+
The goal with this lesson is not to give you a full CMake/BLT tutorial. We
18+
want to give you enough information to help get you started configuring and
19+
building the code in this tutorial.
1420

15-
Our top-level CMakeLists.txt file describes the project, sets up some options,
16-
and then calls `add_subdirectory` so that CMake looks for more CMakeLists.txt
17-
files.
21+
Our top-level [CMakeLists.txt file](https://github.com/LLNL/raja-suite-tutorial/blob/main/CMakeLists.txt) describes this project, sets some options,
22+
and then calls `add_subdirectory`, telling CMake to look in sub-directories for
23+
more CMakeLists.txt files.
1824

19-
https://github.com/LLNL/raja-suite-tutorial/blob/main/CMakeLists.txt
20-
21-
In this lesson directory, we have a CMakeLists.txt file that will describe our
25+
In this lesson directory, we have a CMakeLists.txt file that describes our
2226
application. We use the `blt_add_executable` macro to do this.
2327

24-
The macro takes two (or more) arguments, and the two we care about at the moment
25-
are `NAME` where you provide the executable name, and `SOURCES` where you list
26-
all the source code files that make up your application:
28+
The macro takes two (or more) arguments, and the two most important
29+
are `NAME` where you provide the name of the executable to be generated, and
30+
`SOURCES` where you list all the source code files to compile to generate the
31+
executable:
2732

2833
```
2934
blt_add_executable(
3035
NAME 01_blt_cmake
3136
SOURCES 01_blt_cmake.cpp)
3237
```
3338

34-
For now, we have filled these out for you, but in later lessons you will need to
35-
make some edits yourself.
36-
37-
For a full tutorial on BLT, please see: https://llnl-blt.readthedocs.io/en/develop/tutorial/index.html
39+
For more information on BLT, please refer to the [BLT User Guide and Tutorial](https://llnl-blt.readthedocs.io/en/develop/tutorial/index.html).
3840

3941
## Building the Lessons
4042

41-
We have already run CMake for you in this container to generate the make-based
42-
build system. So now you can compile and run the first lesson.
43+
We have already run CMake for you in the container used for this tutorial
44+
to generate the make-based build system. So you are ready to compile and run
45+
the first lesson.
4346

4447
First, open the VSCode terminal (Shift + ^ + `), and then move to the
4548
build directory:
@@ -49,7 +52,7 @@ $ cd build
4952
```
5053

5154
Compiling your project in a different directory than the source code is a best
52-
practice when using CMake. Once you are in the build directory, you can use the
55+
practice when using CMake. Once you are in the build directory, you can use the
5356
`make` command to compile the executable:
5457

5558
```
@@ -65,5 +68,4 @@ Hello, world!
6568
```
6669

6770
In the next lesson, we will show you how to add RAJA and Umpire as dependencies
68-
to the application.
69-
71+
to an application.

Intro_Tutorial/lessons/02_raja_umpire/README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
# Lesson 2
1+
# Lesson 2: RAJA and Umpire as Build Dependencies
22

33
In this lesson, you will learn how to add RAJA and Umpire as dependencies
44
to your application.
55

6-
Like the previous lesson, we have a CMakeLists.txt file that will describe our
7-
application using the `blt_add_executable` macro.
6+
RAJA and Umpire are included in this project as **targets** that we tell CMake
7+
our application depends on: [RAJA and Umpire Depend](https://github.com/LLNL/raja-suite-tutorial/blob/main/tpl/CMakeLists.txt).
88

9-
RAJA and Umpire are included in this project (look at tpl/CMakeLists.txt) and so
10-
they exist as "targets" that we can tell CMake our application depends on.
11-
Additionally, since we have configured this project to use CUDA, BLT provides a
12-
`cuda` target to ensure that executables will be built with CUDA support.
13-
14-
The `blt_add_executable` macro has another argument, `DEPENDS_ON`, that you can
15-
use to list dependencies.
9+
Additionally, we can specify other dependency targets, such as CUDA, in the
10+
`blt_add_executable` macro for our application executable. The macro has
11+
an argument for this, `DEPENDS_ON`, that you can use to list dependencies.
1612

1713
```
1814
blt_add_executable(
@@ -21,9 +17,11 @@ blt_add_executable(
2117
DEPENDS_ON )
2218
```
2319

24-
Once you have added the dependencies, uncomment out the RAJA and Umpire header
25-
includes in the source code. Then, you can build and run the lesson as
26-
before. As a reminder, open the VSCode terminal (Shift + ^ + `), and then
20+
In the `CMakeLists.txt` file in this lesson, you will find a `TODO:` comment
21+
asking you to add the RAJA, umpire, and cuda dependencies to build the lesson
22+
code. After you have added the dependencies, uncomment the RAJA and Umpire
23+
header file includes in the source code. Then, you can build and run the lesson.
24+
As a reminder, open the VSCode terminal (Shift + ^ + `), and then
2725
move to the build directory:
2826

2927
```

Intro_Tutorial/lessons/03_umpire_allocator/03_umpire_allocator.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
#include "RAJA/RAJA.hpp"
44
#include "umpire/Umpire.hpp"
55

6+
// TODO: Uncomment this in order to build!
7+
//#define COMPILE
8+
69
int main()
710
{
11+
#if defined(COMPILE)
812
double* data{nullptr};
913

1014
// TODO: allocate an array of 100 doubles using the HOST allocator
@@ -18,5 +22,6 @@ int main()
1822

1923
// TODO: deallocate the array
2024

25+
#endif
2126
return 0;
2227
}

Intro_Tutorial/lessons/03_umpire_allocator/README.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,46 @@
1-
# Lesson 3
1+
# Lesson 3: Umpire Allocators
22

33
In this lesson, you will learn how to use Umpire to allocate memory. The file
4-
`03_umpire_allocator.cpp` contains some `TODO:` comments where you can add code to allocate and
5-
deallocate memory.
4+
`03_umpire_allocator.cpp` contains `TODO:` comments where you will code to
5+
allocate and deallocate memory.
66

77
The fundamental concept for accessing memory through Umpire is the
88
`umpire::Allocator`. An `umpire::Allocator` is a C++ object that can be used to
99
allocate and deallocate memory, as well as query a pointer to get
10-
information about it. (Note: in this lesson, we will see how to query the name of the Allocator!)
10+
information about it. In this lesson, we will see how to query the name of an Allocator.
1111

12-
All `umpire::Allocator` objects are created and managed by Umpire’s
13-
`umpire::ResourceManager`. To create an allocator, first obtain a handle to the
14-
ResourceManager, and then request the Allocator corresponding to the desired
15-
memory resource using the `getAllocator` function:
12+
All `umpire::Allocator` objects are created and managed by the
13+
`umpire::ResourceManager` *Singleton* object. To create an allocator,
14+
first obtain a handle to the ResourceManager, and then request the Allocator
15+
corresponding to the desired memory resource using the `getAllocator` function:
1616

1717
```
1818
auto& rm = umpire::ResourceManager::getInstance();
1919
auto allocator = rm.getAllocator("HOST");
2020
```
2121

2222
The Allocator class provides methods for allocating and deallocating memory. You
23-
can view these methods in the Umpire source code documentation here:
24-
https://umpire.readthedocs.io/en/develop/doxygen/html/classumpire_1_1Allocator.html
23+
can view these methods in the [Umpire AllocatorInterface](https://umpire.readthedocs.io/en/develop/doxygen/html/classumpire_1_1Allocator.html).
2524

26-
To use an Umpire allocator, use the following code, replacing "size in bytes" with
27-
the desired size for your allocation:
25+
To use an Umpire allocator, use the following code, replacing "size in bytes"
26+
with the desired size for your allocation:
2827

2928
```
3029
void* memory = allocator.allocate(size in bytes);
3130
```
3231

33-
Moving and modifying data in a heterogenous memory system can be annoying since you
34-
have to keep track of the source and destination, and often use vendor-specific APIs
35-
to perform the modifications. In Umpire, all data modification and movement, regardless
36-
of memory resource or platform, is done using Operations.
32+
Moving and modifying data in a heterogenous memory system can be subtle
33+
because you have to keep track of the source and destination memory spaces,
34+
and often use vendor-specific APIs to perform the modifications. In Umpire,
35+
all data modification and movement, regardless of memory resource or platform,
36+
is done using **Umpire Operations**.
3737

38-
Next, we will use the `memset` Operator provided by Umpire's Resource Manager to
39-
set the memory we just allocated to zero.
38+
Next, we will use the `memset` Operator provided by Umpire's Resource Manager
39+
to set the memory we just allocated to zero.
4040

4141
Don't forget to deallocate your memory afterwards!
4242

43-
For more details, you can check out the Umpire documentation:
44-
https://umpire.readthedocs.io/en/develop/sphinx/tutorial/allocators.html
43+
For more details, you can check out the [Umpire Allocator Documentation](https://umpire.readthedocs.io/en/develop/sphinx/tutorial/allocators.html).
4544

4645
Once you have made your changes, you can compile and run the lesson:
4746

Intro_Tutorial/lessons/03_umpire_allocator/solution/03_umpire_allocator_solution.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
#include "RAJA/RAJA.hpp"
44
#include "umpire/Umpire.hpp"
55

6+
// TODO: Uncomment this in order to build!
7+
#define COMPILE
8+
69
int main()
710
{
11+
#if defined(COMPILE)
812
double* data{nullptr};
913

1014
// TODO: allocate an array of 100 doubles using the HOST allocator
@@ -23,5 +27,6 @@ int main()
2327
// TODO: deallocate the array
2428
allocator.deallocate(data);
2529

30+
#endif
2631
return 0;
2732
}

Intro_Tutorial/lessons/04_raja_forall/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Lesson Four
1+
# Lesson 4: RAJA Simple Loops
22

33
Data parallel kernels are common in many parallel HPC applications. In a data
44
parallel loop kernel, the processing of data that occurs at each iterate **is

Intro_Tutorial/lessons/05_raja_reduce/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Lesson 5
1+
# Lesson 5: RAJA Reductions
22

33
In lesson 4, we looked at a data parallel loop kernel in which each loop
44
iterate was independent of the others. In this lesson, we consider a kernel

Intro_Tutorial/lessons/06_raja_umpire_host_device/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Lesson 6
1+
# Lesson 6: Host-Device Memory and Device Kernels
22

33
Now, let's learn about Umpire's different memory resources and, in
44
particular, those used to allocate memory on a GPU.

Intro_Tutorial/lessons/07_raja_algs/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Lesson 07
1+
# Lesson 7: RAJA Algorithms
22

33
So far, we've looked at RAJA kernel launch methods, where a user passes a kernel
44
body that defines what an algorithm does at each iterate. RAJA provides
@@ -87,6 +87,9 @@ $ make 07_raja_atomic
8787
$ .bin/07_raja_atomic
8888
```
8989

90+
Additional information about RAJA atomic operation support can be found in
91+
[RAJA Atomic Operations](https://raja.readthedocs.io/en/develop/sphinx/user_guide/tutorial/atomic_histogram.html).
92+
9093
## Parallel Scan
9194

9295
A **scan operation** is an important building block for parallel algorithms. It
@@ -204,3 +207,6 @@ $ .bin/07_raja_scan
204207

205208
Is the result what you expected it to be? Can you explain why the first value
206209
in the output is what it is?
210+
211+
Additional information about RAJA scan operations can be found in
212+
[RAJA Parallel Scan Operations](https://raja.readthedocs.io/en/develop/sphinx/user_guide/tutorial/scan.html).

0 commit comments

Comments
 (0)