Clone wiki

upcxx / events / SC20

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).

Tutorial at the SC20 registration site
On-demand stream of the UPC++ Tutorial (registration required)


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.

See Using UPC++ on NERSC Cori, OLCF Summit, and ALCF Theta

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

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

  1. Install or find a working UPC++ environment (see above)

  2. Download the tutorial content, which includes the starter files for exercises. The tutorial content is available in all of the following places:

  3. Navigate to the exercises directory (possibly tutorials/2020-11/exercises)

  4. The sections below describe each example in more detail

Exercise 0

Exercise 0 just tests you have a working UPC++ environment.

From the exercises directory of the tutorial materials, type this command to build and run hello world:

make run-ex0

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 found This means the UPC++ install was not found in your environment. You can either add the UPC++ bin directory to your $PATH variable, or set environment variable to the root of the UPC++ install: export UPCXX_INSTALL=/path/to/upcxx/install/tree

  • 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-ex0 Assuming this fixes your problem, use a similar command for running the subsequent exercises (replacing run-ex0 with run-ex1, etc.)

Exercise 1

Working source file: ex1.cpp in exercises directory

Make command: make run-ex1 in exercises directory

Exercise 1 slide

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

Exercise 2

Working source file: ex2.cpp in exercises directory

Make command: make run-ex2 in exercises directory

Exercise 2 slide

Correct Output:

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

Exercise 3

Working source file: ex3.hpp in exercises directory

Make command: make run-ex3 in exercises directory

Exercise 3 slide

Correct Output:

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.

Search for EXERCISE in the file for detailed instructions.

Make command: make run-ex4 in exercises directory

Correct Output:

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...

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!

Back to UPC++ Home