Skip to content

ttg tutorial 2 8 23

Thomas Herault edited this page Feb 6, 2023 · 7 revisions

Template Task Graph: a Task Programming Paradigm for Irregular Applications

Date, time, and location

February 8, 2023, 2pm CST to 3:30pm CST

On zoom: https://uoregon.zoom.us/j/98206254246?pwd=SnpvaEdzZmxVTnZlMXVHZ1p0NjFWdz09

Abstract

The PaRSEC team will highlight the Template Task Graph (TTG) programming paradigm, the concepts, benefits and requirement of the programming approach as well as the practical aspects necessary to start using TTG on various platforms to write portable task-based applications. The team will provide direct support during the tutorial as well as through GitHub and a mailing list after the tutorial.

What are Template Task Graphs?

Template Task Graphs have been developed to enable a straightforward expression of task parallelism for algorithms working on irregular and unbalanced data sets. The TTG Application Programming Interface employs C++ templates to build an abstract representation of the task graph, and schedule it on distributed resources. It offers a scalable and efficient API to port complex applications on top of task-based runtime systems to gain access to asynchronous progress, computation/communication overlap, and efficient use of all computing resources available on the target system. In this tutorial, we will introduce TTG and its main concepts and features through a variety of applications, ranging from well-known regular to irregular and data dependent examples.

The tutorial, which features many hands-on examples, presents how to install TTG on the ECP platforms and other environments, how to integrate TTG with your application using CMake, how to express task-based data-dependent algorithms for irregular datasets using TTG, and how to integrate these task-based algorithms inside existing applications.

Target audience

The tutorial is available to everyone, and participants from any background are welcome to attend. A basic knowledge of C++ and templates will be helpful for participants who wish to try the hands-on.

Tutorial material

Tutorial Sources

  • Download the tutorial sources from here: ECP-Feb-23.tgz

  • Create a directory in which you will host the tutorial code (we call this directory TUTORIALDIR from now on)

  • Move the downloaded file from your browser Download directory into TUTORIALDIR

  • extract the tutorial sources in TUTORIALDIR: tar xzvf ECP-Feb-23.tgz

Docker Image

If you need to, install docker following your Operating System instructions

Note for Linux systems: if you install docker via a package manager, it may be needed to add your user to the docker group and logout/login again (or su - $USER to force the OS to process login in the new shell) to make this change visible.

Use therault/ttg-tutorial-23-02-08:latest from the docker hub. From the TUTORIALDIR directory, run the following commands:

  • docker pull therault/ttg-tutorial-23-02-08:latest to download the docker image (only needed once)

  • docker run --name ttg-tutorial -it --rm -v $PWD/:/home/tesse/tutorial therault/ttg-tutorial-23-02-08

This last command will open a shell inside the docker image. You can compile and run the tests from this shell. You cannot edit files in this shell, as no editor has been installed. However, the host directory from which you launched the docker run command is mounted in the docker image under the PATH /home/tesse/tutorial. You can thus create and edit files from your host, using your preferred IDE, and compile and run tests inside the container.

We use VSCode and the 'Dev Containers' add-on to streamline this integration: after launching the docker run command, while letting it run, launch VSCode, install the Dev Containers add-on, Open the tutorial folder on the host. Get the VSCode command prompt (Ctl-Shift-P on linux, Cmd-Shift-P on Mac) and type 'Dev Containers: attach to running container'; select the ttg-tutorial container. You can now use VSCode as your IDE to create files, edit them, compile and run things directly in the container.

The --rm flag in the docker run command will automatically delete the container at the end of the session. Files in the tutorial directory will be preserved, but others will be lost. Remove the --rm flag and manage the containers manually if you want to edit files outside the tutorial/ directory inside the container.

Alternatively, compile and install TTG.

Follow the TTG installation instructions

Slides

ECP-Feb-23.pdf