Skip to content

Commit e43840d

Browse files
authored
Merge pull request #108 from uvarc/staging
Big merge
2 parents 6f4d070 + 2af615c commit e43840d

File tree

338 files changed

+5015
-870
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

338 files changed

+5015
-870
lines changed

content/courses/containers-for-hpc/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title : "Software Containers for HPC"
44
summary: "An Introduction to using and building software containers."
55
authors: [rs]
66
categories: ["Containers","HPC"]
7-
tags: [containers, hpc]
7+
tags: [Containers, HPC]
88
toc: true
99
type: book
1010
weight: 1

content/courses/containers-for-hpc/building-apptainer.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ While our container is functional, there is room for improvement. We shall look
292292

293293
### 1. Clean up
294294

295-
Package managers usually leave behind some cache files after installation that can be safely removed. Dependending on your application, they can easily accumulate up to several GBs.
295+
Package managers usually leave behind some cache files after installation that can be safely removed. Depending on your application, they can easily accumulate up to several GBs.
296296

297297
{{< code-snippet >}}Bootstrap: docker
298298
From: ubuntu:22.04
@@ -424,7 +424,7 @@ A container registry is a repository for container images. Here we examine two p
424424
425425
The Apptainer/Singularity SIF is supported by Docker Hub. Register for a free account.
426426
427-
{{< info >}}Replace "myname" with your actual user name in the following commands.{{< /info >}}
427+
{{< info >}}Replace "myname" with your actual username in the following commands.{{< /info >}}
428428
429429
Login:
430430
```bash
@@ -486,7 +486,7 @@ Your project requires PyTorch 2.1.2, Numpy, Seaborn, and Pandas. Write the corre
486486
487487
Hints:
488488
- Find the appropriate base image from [here](https://hub.docker.com/r/pytorch/pytorch/tags).
489-
- Pull the base image and examine it first. Does it already provide some of the packages?
489+
- Pull the base image and examine it first. Does it already provide some packages?
490490
491491
{{< info >}}While PyTorch runs on a GPU, you do not need to build the container on a GPU.{{< /info >}}
492492
@@ -507,7 +507,7 @@ Your project requires R 4.3.2, dplyr, ggplot2, and RcppGSL. Write the correspond
507507
508508
Hints:
509509
- Pick an appropriate base image - there are two viable choices here.
510-
- Pull the base image and examine it first. Does it already provide some of the packages?
510+
- Pull the base image and examine it first. Does it already provide some packages?
511511
- In the definition file, install CRAN packages via `R -e "install.packages('...')"`.
512512
- Load the three packages. Do they all succeed? If not, how can you fix it?
513513

content/courses/containers-for-hpc/building-docker.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ ENTRYPOINT fortune | cowsay | lolcat
167167

168168
### 1. Clean up
169169

170-
Almost all package managers leave behind some cache files after installation that can be safely removed. Dependending on your application, they can easily accumulate up to several GBs. Let's see what happens if we try to clean up the cache in a separate `RUN` statement.
170+
Almost all package managers leave behind some cache files after installation that can be safely removed. Depending on your application, they can easily accumulate up to several GBs. Let's see what happens if we try to clean up the cache in a separate `RUN` statement.
171171

172172
```dockerfile
173173
FROM ubuntu:22.04

content/courses/containers-for-hpc/minimal.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ LightGBM is a gradient boosting framework that uses tree based learning algorith
303303

304304
## Exercise: `fortune` from scratch
305305

306-
This exercise illustrates how we can cherrypick files from the package manager that are essential to the application.
306+
This exercise illustrates how we can cherry-pick files from the package manager that are essential to the application.
307307

308308
1. The Ubuntu base image shall be our basis of comparison. Copy the Dockerfile and build the image.
309309

@@ -576,7 +576,7 @@ where $A_{mk}, B_{kn}, C_{mn}$ are matrices and $\alpha, \beta$ are constants. F
576576
This exercise illustrates that it is easier to build a minimal container of a static binary.
577577
578578
## Exercise: Linking against LibTorch
579-
LibTorch is the C++ frontend of PyTorch. This exericse is based on the ["Writing a Basic Application"](https://pytorch.org/tutorials/advanced/cpp_frontend.html#writing-a-basic-application) section of the PyTorch tutorial.
579+
LibTorch is the C++ frontend of PyTorch. This exercise is based on the ["Writing a Basic Application"](https://pytorch.org/tutorials/advanced/cpp_frontend.html#writing-a-basic-application) section of the PyTorch tutorial.
580580
581581
1. Select an appropriate base image. (Hint: You will be compiling C++ code.)
582582

content/courses/cpp-introduction/_index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ date : "2021-06-23T00:00:00-05:00"
33
title : "Programming in C++"
44
summary: " This short course is an introduction to programming in C++. Experience programming in some other language is helpful but not required."
55
authors: [kah]
6-
categories: ["Programming","C++"]
7-
tags: [programming, c++]
6+
categories: ["Programming","Compilers"]
7+
tags: [Programming, Compilers, C++]
88
toc: true
99
type: book
1010
weight: 1

content/courses/cpp-introduction/boost.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ One of the most popular add-on libraries for C++, especially numerical or scient
1111

1212
### Installing Boost
1313

14-
Boost uses its own build system on Unix and Mac OS. On Windows there is an experimental CMake system but generally the "bjam" builder is still used.
14+
Boost uses its own build system on Unix and macOS. On Windows there is an experimental CMake system but generally the "bjam" builder is still used.
1515
In all cases, installing Boost requires some familiarity with using a command line.
1616

17-
#### Unix and Mac OS
17+
#### Unix and macOS
1818

19-
On a Linux system, the simplest way to install Boost is to utilize the package manager of the distribution. For example on Ubunutu the command is
19+
On a Linux system, the simplest way to install Boost is to utilize the package manager of the distribution. For example on Ubuntu the command is
2020
```no-highlight
2121
sudo apt install libboost-all-dev
2222
```
@@ -25,9 +25,9 @@ or on Fedora (or Centos 8 and beyond)
2525
sudo dnf install boost
2626
sudo dnf install boost-devel
2727
```
28-
If you do not have superuser (sudo) permission or you wish to install Boost somewhere other than the main system libraries, follow the general [instructions](
28+
If you do not have superuser (sudo) permission, or you wish to install Boost somewhere other than the main system libraries, follow the general [instructions](
2929
https://www.boost.org/doc/libs/1_76_0/more/getting_started/unix-variants.html).
30-
The default prefix for installation from `b2 install` is `/usr/local`. This is true for both Linux and Mac OS. If you wish to install to `/usr/local`, which is normally in the system search paths, you will need to run the installation command with sudo
30+
The default prefix for installation from `b2 install` is `/usr/local`. This is true for both Linux and macOS. If you wish to install to `/usr/local`, which is normally in the system search paths, you will need to run the installation command with sudo
3131
```no-highlight
3232
cd path/to/boost/source
3333
./bootstrap.sh
@@ -59,11 +59,11 @@ Installation on Windows is somewhat more complicated than on Unix variants. Fir
5959

6060
Using Boost is probably simplest with a Makefile. The [example](/courses/cpp-introduction/codes/makefile.windows_boost) is for Windows with a particular choice of location for the boost header files and libraries. Change the locations for `-I` and `-L` as appropriate if they are located elsewhere on your system. Please refer to the earlier [chapter](/courses/cpp-introduction/make) for a review of setting up Makefiles. This example goes with a standard Boost [example](/courses/cpp-introduction/codes/boost_example.cxx).
6161

62-
If you have installed Boost onto a Linux or Mac OS system to a system default search location such as `/usr` or `/usr/local` you will not need to specify the `-I` or `-L` paths at all. The example [makefile](/courses/cpp-introduction/codes/makefile.linux_mac_boost) assumes installation in system paths in the compiler's default search paths.
62+
If you have installed Boost onto a Linux or macOS system to a system default search location such as `/usr` or `/usr/local` you will not need to specify the `-I` or `-L` paths at all. The example [makefile](/courses/cpp-introduction/codes/makefile.linux_mac_boost) assumes installation in system paths in the compiler's default search paths.
6363

6464
## Boost MultiArrays
6565

66-
C-style arrays are widely used but lack some important features, such as the ability to check that index references do not occur outside of the arrays bounds.
66+
C-style arrays are widely used but lack some important features, such as the ability to check whether indexes outside the array bounds are referenced.
6767
The C++ STL array type has more features, but is limited to one dimension. A workaround is to "stack" vectors, since a vector of a vector amounts to a 2-dimensional structure.
6868
```c++
6969
#include <vector>

content/courses/cpp-introduction/building.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ weight: 11
77

88
---
99

10-
The "traditional" development environment for compiled languages was a text editor and a command line. Many programmers continue to use these successfully, but modern tools can greatly improve programmer productivity. Some such tools are especially recommended for the Windows operating system, since it does not support command-line usage as cleanly as Linux or Mac OS.
10+
The "traditional" development environment for compiled languages was a text editor and a command line. Many programmers continue to use these successfully, but modern tools can greatly improve programmer productivity. Some such tools are especially recommended for the Windows operating system, since it does not support command-line usage as cleanly as Linux or macOS.
1111

1212
## Compilers
1313

@@ -30,21 +30,21 @@ Intel has recently released the [oneAPI Toolkits](https://software.intel.com/con
3030

3131
An Integrated Development Environment (IDE) combines an editor and a way to compile and run programs in the environment.
3232
A well-known IDE for Microsoft Windows is Visual Studio. This is available through the Microsoft Store; it is not free for individuals.
33-
Mac OS uses Xcode as its native IDE. Xcode includes some compilers, particularly for Swift, but it can manage several other languages. Available at the App Store and free.
33+
macOS uses Xcode as its native IDE. Xcode includes some compilers, particularly for Swift, but it can manage several other languages. Available at the App Store and free.
3434

3535
A full-featured cross-platform IDE is [Eclipse] (http://www.eclipse.org/). Free.
3636

3737
A lighter-weight IDE for Windows and Linux is [Code::Blocks] (http://www.codeblocks.org/). Free.
3838

3939
Windows programmers using Intel's oneAPI distribution must also install [Visual Studio](https://visualstudio.microsoft.com/).
4040

41-
An increasingly popular IDE is Visual Studio Code ([VSCode](https://code.visualstudio.com/)) from Microsoft. It is also cross-platform, with versions available for Windows, Mac OS, and Linux. It does not support C, C++, or Fortran by default; extensions must be installed to provide syntax highlighting and debugging for those languages. C and C++ are installed with one extension that can be found at the top of the list.
41+
An increasingly popular IDE is Visual Studio Code ([VSCode](https://code.visualstudio.com/)) from Microsoft. It is also cross-platform, with versions available for Windows, macOS, and Linux. It does not support C, C++, or Fortran by default; extensions must be installed to provide syntax highlighting and debugging for those languages. C and C++ are installed with one extension that can be found at the top of the list.
4242

4343
In our examples, we will use a very lightweight IDE called [Geany](https://www.geany.org/) since it is free, easy to install and use, and works on all three platforms. It is more of a programmer's editor than a full-featured IDE, but it does include some build tools.
4444

4545
## Building an Executable
4646

47-
Creating an executable is generally a multi-step process. Of course, the first step is the preparation of a _source file_. The convention for C++ was once a file extension of `.cpp`, but that conflicts with the name of the preprocessor (C PreProcessor) so `.cxx` is increasingly common. We will use `.cxx` but `.cpp` still works.
47+
Creating an executable is generally a multistep process. Of course, the first step is the preparation of a _source file_. The convention for C++ was once a file extension of `.cpp`, but that conflicts with the name of the preprocessor (C PreProcessor) so `.cxx` is increasingly common. We will use `.cxx` but `.cpp` still works.
4848

4949
From each source file, the compiler first produces an _object file_. In Unix these end in `.o`, or `.obj` on Windows.
5050
This is the _compilation_ step.
@@ -54,15 +54,15 @@ If not told otherwise a compiler will attempt to compile and link the source fil
5454

5555
For Unix compilers the `-c` option suppresses linking. The compiler must then be run again to build the executable from the object files.
5656
The linker option `-o` is used to name the binary something other than `a.out`.
57-
Unix and MacOS do not care about file extensions, but Windows will expect an executable to end in `.exe`.
57+
Unix and macOS do not care about file extensions, but Windows will expect an executable to end in `.exe`.
5858

5959
### Command Line
6060

61-
For full control and access to more compiler options, we can build from the command line. For Linux and Mac this is a terminal application. On windows, use a command prompt for gcc. The Intel oneAPI distribution ships with an integrated command prompt in its folder in the applications menu; this command prompt is aware of the location of the compiler executables and libraries.
61+
For full control and access to more compiler options, we can build from the command line. For Linux and Mac this is a terminal application. On Windows, use a command prompt for gcc. The Intel oneAPI distribution ships with an integrated command prompt in its folder in the "applications" menu; this command prompt is aware of the location of the compiler executables and libraries.
6262

6363
**Example**
6464
```
6565
g++ -c mymain.cxx
6666
g++ -c mysub.cxx
6767
```
68-
IDEs generally manage basic compiler options and usually name the executable based on the project name. Our examples of command line usage will all assume a Unix operating system; there are some differences between Linux and MacOS, with larger differences for Windows. On MacOS and especially Windows, using an IDE makes code management simpler. Using Geany as our example, clicking the icon showing a pyramid pointing to a circle will compile the current file without attempting to invoke the linker. The brick icon builds the current file, so it must be possible to create a standalone executable from a single file.
68+
IDEs generally manage basic compiler options and usually name the executable based on the project name. Our examples of command line usage will all assume a Unix operating system; there are some differences between Linux and macOS, with larger differences for Windows. On macOS and especially Windows, using an IDE makes code management simpler. Using Geany as our example, clicking the icon showing a pyramid pointing to a circle will compile the current file without attempting to invoke the linker. The brick icon builds the current file, so it must be possible to create a standalone executable from a single file.

content/courses/cpp-introduction/characters.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ The result is a _buffer overflow_.
9090
To see what can happen, compile and run the following code
9191
{{< code-download file="/courses/cpp-introduction/codes/buffer_oflow.cxx" lang="c++" >}}
9292

93-
Type in a short user name (any string), then type `Eleventy` as your password. It should work as expected. Now try typing a user name that is longer than 10 characters and see what happens.
93+
Type in a short username (any string), then type `Eleventy` as your password. It should work as expected. Now try typing a username that is longer than 10 characters and see what happens.
9494

9595
If using C-style strings and functions, guard against this by using
9696

content/courses/cpp-introduction/classes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Objects _encapsulate_ related concepts and keep them unified. They may _hide_ d
1515
Generally speaking, an object would contain the procedures required to update and maintain its _state_.
1616
In most object-oriented programming languages, objects are abstract concepts that are represented in code by _classes_.
1717

18-
Object-oriented programming (OOP) grew from programming fields that simulated real-world, physical objects and it may be easiest to grasp by thinking of that model. These objects well defined and their interactions could be managed through the _interface_ that each object provided. A user interface is a good example. We have various objects such as figures, text, menus, and so forth. The figures might be one-dimensional (lines, arrows, etc.) or two-dimensional (rectangles, ellipses, etc). They have characteristics such as length/radius, they have a state such as current size, color and location of their centers, and they have behaviors such as moving or rotating. Text has location and the content of the string that it displays. All these objects interact with each other, as the user takes various actions or the program executes.
18+
Object-oriented programming (OOP) grew from programming fields that simulated real-world, physical objects and it may be easiest to grasp by thinking of that model. These objects are well-defined and their interactions can be managed through the _interface_ that each object provided. A user interface is a good example. We have various objects such as figures, text, menus, and so forth. The figures might be one-dimensional (lines, arrows, etc.) or two-dimensional (rectangles, ellipses, etc). They have characteristics such as length/radius, they have a state such as current size, color and location of their centers, and they have behaviors such as moving or rotating. Text has location and the content of the string that it displays. All these objects interact with each other, as the user takes various actions or the program executes.
1919

2020
For another example, return to the Employee struct. The struct collected data about an employee into a unified type. However, actions may be associated with an employee. Salaries could be raised, addresses could be updated, employees could join or quit the company, and so forth. We would implement procedures to carry out these actions and include them in the object.
2121

content/courses/cpp-introduction/conditionals.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ weight: 41
99

1010
A _conditional_ is a programming construct that implements decisions.
1111
* _If_ the weather is good _then_ we will go for a walk, _else_ we will stay inside and watch TV.
12-
* _If_ it is cold enough to snow I will wear my heavy coat, _else if_ it is warmer and just rains I will wear my rainjacket.
12+
* _If_ it is cold enough to snow I will wear my heavy coat, _else if_ it is warmer and just rains I will wear my rain jacket.
1313
The expression following each _if_ or _else_ must be true or false, i.e. a _logical_ expression (in Fortran terminology).
1414

1515
## If - Else If - Else

content/courses/cpp-introduction/console_io.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The standard streams are incorporated with the header
2020
```c++
2121
#include <iostream>
2222
```
23-
The iostream library is part of the C++ standard libraries set and contains _stream objects_ for standard streams. They correspond to the standard streams of Unix or Mac OS. Windows handles console IO differently, but iostream can map the stream objects to its equivalents.
23+
The iostream library is part of the C++ standard libraries set and contains _stream objects_ for standard streams. They correspond to the standard streams of Unix or macOS. Windows handles console IO differently, but iostream can map the stream objects to its equivalents.
2424

2525
{{< table >}}
2626
| cin | standard input |
@@ -30,7 +30,7 @@ The iostream library is part of the C++ standard libraries set and contains _str
3030
{{< /table >}}
3131

3232
The `cin` object is for input; it is a member of the _istream_ (input stream) class. If a console is attached the others all output is to the same device (the screen). They are members of the _ostream_ (output stream) class.
33-
Unix and Mac OS shells can redirect standard output and standard error to separate files.
33+
Unix and macOS shells can redirect standard output and standard error to separate files.
3434
Standard output is for "normal" output whereas standard error is used for error messages.
3535

3636
On Linux cin and cout are buffered, whereas cerr is not.

content/courses/cpp-introduction/containers_templates.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int main() {
3939
}
4040
```
4141

42-
The standard library consists of _containers_, _algorithms_, _iterators_, and a number of general-purpose and numerical sublibraries. A comprehensive list is [here](https://www.cplusplus.com/reference/).
42+
The standard library consists of _containers_, _algorithms_, _iterators_, and a number of general-purpose and numerical sub-libraries. A comprehensive list is [here](https://www.cplusplus.com/reference/).
4343

4444
### Useful Standard Containers
4545

0 commit comments

Comments
 (0)