Summary and Schedule
This workshop is an introduction to parallel programming in Chapel. This material is designed for Day 2 of HPC Carpentry.
By the end of this workshop, students will know:
- the basic syntax of Chapel codes,
- how to run single-locale Chapel codes,
- how to write task-parallel codes for a shared-memory compute node,
- how to run multi-locale Chapel codes,
- how to write domain-parallel codes for a distributed-memory cluster.
NOTE: This is the draft HPC Carpentry release. Comments and feedback are welcome.
Setup Instructions | Download files required for the lesson | |
Duration: 00h 00m | 1. Introduction to Chapel |
“What is Chapel and why is it
useful?” :::::::::::::::::::::::::::::::::::::::::::::::: |
Duration: 00h 30m | 2. Basic syntax and variables |
“How do I write basic Chapel
code?” :::::::::::::::::::::::::::::::::::::::::::::::: |
Duration: 01h 00m | 3. Ranges and arrays |
“What is Chapel and why is it
useful?” :::::::::::::::::::::::::::::::::::::::::::::::: |
Duration: 02h 30m | 4. Conditional statements |
“How do I add conditional logic to my
code?” :::::::::::::::::::::::::::::::::::::::::::::::: |
Duration: 04h 00m | 5. Getting started with loops |
“How do I run the same piece of code
repeatedly?” :::::::::::::::::::::::::::::::::::::::::::::::: |
Duration: 05h 30m | 6. Procedures |
“How do I write
functions?” :::::::::::::::::::::::::::::::::::::::::::::::: |
Duration: 05h 45m | 7. Using command-line arguments |
“How do I use the same program for multiple
use-cases?” :::::::::::::::::::::::::::::::::::::::::::::::: |
Duration: 07h 15m | 8. Measuring code performance |
“How do I know how fast my code
is?” :::::::::::::::::::::::::::::::::::::::::::::::: |
Duration: 08h 45m | 9. Intro to parallel computing |
“How does parallel processing
work?” :::::::::::::::::::::::::::::::::::::::::::::::: |
Duration: 10h 15m | 10. Fire-and-forget tasks |
“How do we execute work in
parallel?” :::::::::::::::::::::::::::::::::::::::::::::::: |
Duration: 11h 45m | 11. Synchronising tasks |
“How should I access my data in
parallel?” :::::::::::::::::::::::::::::::::::::::::::::::: |
Duration: 13h 15m | 12. Task parallelism with Chapel |
“How do I write parallel code for a real use
case?” :::::::::::::::::::::::::::::::::::::::::::::::: |
Duration: 14h 45m | 13. Running code on multiple machines |
“What is a locale?” :::::::::::::::::::::::::::::::::::::::::::::::: |
Duration: 17h 45m | 14. Domains and data parallelism |
“How do I store and manipulate data across multiple
locales?” :::::::::::::::::::::::::::::::::::::::::::::::: |
Duration: 20h 45m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
We highly recommend running Chapel on an HPC cluster. Alternatively, you can run Chapel on your computer, but don’t expect a multi-node speedup since you have only one node.
Software Setup
Details
This section describes installing Chapel on your own computer. Before proceeding, please double-check that your workshop instructors do not already provide Chapel on an HPC cluster.
Go to the website https://docs.docker.com/docker-for-windows/install/ and
download the Docker Desktop installation file. Double-click on the
Docker_Desktop_Installer.exe
to run the installer. During
the installation process, enable Hyper-V Windows Feature on the
Configuration page, and wait for the installation to complete. At this
point you might need to restart your computer.
Eventually you want to run https://hub.docker.com/r/chapel/chapel Docker image.
The quickest way to get started with Chapel on MacOS is to install it via Homebrew. If you don’t have Homebrew installed (skip this step if you do), open Terminal.app and type
BASH
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Next, proceed to installing Chapel:
At https://github.com/chapel-lang/chapel/releases scroll to the first “Assets” section (you might need to click on “Show all assets”) and pick the latest precompiled Chapel package for your Linux distribution. For example, with Ubuntu 22.04 you can do: