UPC++ SC20 Virtual Tutorial
The Pagoda project is pleased to present a half-day UPC++ Tutorial at the virtual SC20 conference in November. The virtual format of SC this year means the tutorials are presented on an earlier, non-conflicting day and are less than half as expensive to attend relative to previous years. The tutorial will include interactive hands-on exercises along with an introduction to the UPC++ library and in-depth case studies of three applications using UPC++. Speakers notably include Professor Katherine Yelick, a highly distinguished lecturer and internationally recognized and decorated researcher.
When: Live virtual session was recorded on Tues Nov 10th, and is now available for on-demand streaming by anyone registered for afternoon tutorials (registration ends Dec 7th).
To register for the tutorial, visit the SC20 registration site, register for either the tutorials afternoon pass or tutorials two-day pass, and be sure to select the UPC++ tutorial on Tuesday afternoon. Registration fees start at $25 for students and $150 for ACM/IEEE members.
Setting up UPC++
There are several ways to access a working UPC++ environment:
Installs on the major DOE centers
We maintain public installs of UPC++ at several DOE centers.
Download and install from source
UPC++ supports a wide range of UNIX-like systems and architectures, ranging from supercomputers to laptops, including Linux, macOS and Windows 10 (via WSL).
Visit the UPC++ download page for links to download and install UPC++ on your own system.
Docker containers with UPC++
We're providing a Linux Docker container for the UPC++ tutorial.
Assuming you have a Linux-compatible Docker environment, you can get a working UPC++ environment with the following command:
docker run -it --rm upcxx/sc20-linux-amd64
The UPC++ commands are
upcxx (compiler wrapper) and
upcxx-run (run wrapper), and the home directory contains the tutorial exercises and some example codes.
Getting Started with the Library
For training materials to get started using UPC++, see the UPC++ Training Page
Day of Tutorial
- Live stream for the UPC++ Tutorial (registration required)
- Tutorial Slides (PDF)
- Tutorial Evaluation on the SC site - Please take a moment to tell us what you loved about the UPC++ tutorial. It makes a BIG difference to our ability to repeat this tutorial in future years!
The tutorial runs for 4 hours, and consists of several pre-recorded presentations interspersed with live sessions for Q&A and time for working hands-on exercises, plus short breaks.
Within the live stream, you should see a "Questions" tab on your screen, where those attending the live broadcast are encouraged to type questions. We will be answering them either immediately in text or by the speakers during a live session. There is also a "Discussion" tab, but we are NOT monitoring it for questions.
Setting up the Hands-on Exercises
Install or find a working UPC++ environment (see above)
Download the tutorial content, which includes the starter files for exercises. The tutorial content is available in all of the following places:
- Inside the Docker container above (Docker users can skip this step)
- Download the archive for this tutorial: tar gzipped or zip file
- Git clone from this BitBucket repository
- Extract from SC20 Tutorial Notes archive (800MB, login required)
- Credentials were provided in email around Nov 4 titled "SC20 Tutorial Notes Download Available"
Navigate to the
The sections below describe each example in more detail
Exercise 0 just tests you have a working UPC++ environment.
exercises directory of the tutorial materials, type this command to build and run hello world:
This will build and run hello world using the default network backend. Note that on batch scheduled supercomputers this must be run inside a batch session.
You should see output similar to:
/usr/local/upcxx/bin/upcxx -Wall ex0.cpp -o ex0 /usr/local/upcxx/bin/upcxx-run -n 4 ./ex0 Hello world from process 1 out of 4 processes Hello world from process 2 out of 4 processes Hello world from process 3 out of 4 processes Hello world from process 0 out of 4 processes
make: upcxx: Command not foundThis means the UPC++ install was not found in your environment. You can either add the UPC++
bindirectory to your
$PATHvariable, or set environment variable to the root of the UPC++ install:
Job spawn failures (e.g.
ssh: connect to host foo port 22: Connection refused). If you failed to launch a distributed job, the simplest resolution for the purposes of the tutorial exercises is to recompile for the single-node SMP backend, using the command:
env UPCXX_NETWORK=smp make clean run-ex0Assuming this fixes your problem, use a similar command for running the subsequent exercises (replacing
Working source file:
ex1.cpp in exercises directory
make run-ex1 in exercises directory
Correct Output: Output lines in a correct solution should be ordered by rank.
output.txt : Hello from process 0 out of 4 Hello from process 1 out of 4 Hello from process 2 out of 4 Hello from process 3 out of 4
Working source file:
ex2.cpp in exercises directory
make run-ex2 in exercises directory
Running 1-d Jacobi on 4 procs, iters=100 global_domain_sz=1024 Running jacobi_rget... result = 51900 PASSED Running jacobi_rput... result = 51900 PASSED SUCCESS
Working source file:
ex3.hpp in exercises directory
make run-ex3 in exercises directory
erase() SUCCESS update() SUCCESS
Extra Credit: Exercise 4
If you finish early, there is an optional exercise 4 (not explicitly covered during the presentation). This exercise asks you to fill in code for a more advanced version of a distributed hash table that uses RMA to accelerate transfers of large value data (exploiting zero-copy RDMA on systems where that's available).
Working source file:
ex4.hpp in exercises directory.
EXERCISE in the file for detailed instructions.
make run-ex4 in exercises directory
Constructing a DistrRMAMap<uint64_t,uint64_t>... Inserting 100 key/value pairs from each of 4 ranks, with value sizes 8..800000 bytes... Inserts complete! Now issuing 100 finds from 4 ranks to verify... Find complete! Testing insert collision... SUCCESS
Thanks for attending the UPC++ Tutorial!!!
Please take a moment to fill out a Tutorial Evaluation on the SC site and tell us what you loved about the UPC++ tutorial. It makes a BIG difference to our ability to repeat this tutorial in future years!