• Stars
    star
    132
  • Rank 274,205 (Top 6 %)
  • Language Vim Snippet
  • License
    Other
  • Created over 7 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Lesson materials for an Introduction to High Performance Computing in the tradition of Software Carpentry

Intro to HPC

This lesson teaches the basics of interacting with high-performance computing (HPC) clusters through the command line

Build Status

Using this material

NOTE: This is not Carpentries boilerplate! Please read carefully.

  1. Follow the instructions found in The Carpentries' example lesson to create a repository for your lesson. Install Ruby, Make, and Jekyll following the instructions here.

  2. For easier portability, we use snippets of text and code to capture inputs and outputs that are host- or site-specific and cannot be scripted. These are stored in a library _includes/snippets_library, with subdirectories matching the pattern InstitutionName_ClusterName_scheduler. If your cluster is not already present, please copy (cp -r) the closest match as a new folder under snippets_library.

    • We have placed snippets in files with the .snip extension, to make tracking easier. These files contain Markdown-formatted text, and will render to HTML when the lesson is built.
    • Code snippets are placed in subdirectories that are named according to the episode they appear in. For example, if the snippet is for episode 12, then it will be in a subdirectory called 12.
    • In the episodes source, snippets are included using Liquid scripting include statements. For example, the first snippet in episode 12 is included using {% include /snippets/12/info.snip %}.
  3. Edit _config_options.yml in your snippets folder. These options set such things as the address of the host to log in to, definitions of the command prompt, and scheduler names. You can also change the order of the episodes, or omit episodes, by editing the configuration block under episode_names in this file.

  4. Set the environment variable HPC_JEKYLL_CONFIG to the relative path of the configuration file in your snippets folder:

    export HPC_JEKYLL_CONFIG=_includes/snippets_library/.../_config_options.yml
  5. Preview the lesson locally, by running make serve. You can then view the website in your browser, following the links in the output (usually, https://localhost:4000). Pages will be automatically regenerated every time you write to them.

  6. If there are discrepancies in the output, edit the snippet file containing it, or create a new one and customize.

  7. Add your snippet directory name to the GitHub Actions configuration file, .github/workflows/test_and_build.yml.

  8. Check out a new branch(git checkout -b new_branch_name), commit your changes, and push to your fork of the repository. If you're comfortable sharing, please file a Pull Request against our upstream repo. We would love to have your site config for the Library.

  9. To maintain compatibility, please do not merge your new branch into your fork's gh-pages branch. Instead, wait until your pull request has been merged upstream, then pull down the upstream version. Otherwise, your repository will diverge from ours, and pull requests you make in the future will probably not be accepted.

Deploying a Customized Lesson

The steps above will help you port the default HPC Intro lesson to your specific cluster, but the changes will only be visible on your local machine. To build a website for a specific workshop or instance of the lesson, you'll want to make a stand-alone copy.

Template Your Customized Repository

This will let you create an exact duplicate of your fork. Without this, GitHub won't let you create a second fork of a repository on the same account.

  1. On GitHub, go to your repository's Settings.
  2. Under the repository name, check the "Template Repository" box.
  3. Go to the Code tab.
  4. Click the new button to Use This Template.
  5. Fill in a name, like yyyy-mm-dd-hpc-intro.
  6. Check the Include all branches box.
  7. Go!

Merge Your Customized Branch

If your snippets are already included in the snippet library, skip this step.

  1. On GitHub, find the drop-down menu of branches. It should be all the way to the left of the "Use This Template" button.
  2. From the list, select the branch containing your site customization.
  3. There should be a bar above the list of repository contents with the branch name, stating "This branch is x commits ahead, y commits behind gh-pages" or similar. To the right of that, click the button to Create Pull Request.
  4. Make sure that the source and destination repositories at the top of the new PR are both your current duplicate of hpc-intro, not the upstream.
  5. Create the pull request, then click the Merge button. You can delete the customization branch when it's done.

Modify _config.yml

GitHub builds sites using the top-level _config.yml, only, but you want the values set in the snippet library.

  1. Open a copy of your _includes/snippet_library/Institution_Cluster_scheduler/_config_options.yml
  2. On GitHub, open the top-level _config.yml for editing.
  3. Copy your _config_options.yml, overwriting the values under the SITE specific configuration section of the top-level _config.yml. Leave the rest as-is.
  4. Commit the change.
  5. Back on the Code tab, there should be a timer icon, a green check, or a red X next to the latest commit hash. If it's a timer, the site is building; give it time.
  6. If the symbol is a red x, something went wrong. Click it to open the build log, and attempt to correct the error. Follow GitHub's troubleshooting guide, and double-check the values in _config.yml ar ecorrect and complete.
  7. Once you see a green check, your website will be available for viewing at https://your-github-account.github.io/name-of-the-repository.

Lesson Outlines

The following list of items is meant as a guide on what content should go where in this repo. This should work as a guide where you can contribute. If a bullet point is prefixed by a file name, this is the lesson where the listed content should go into. This document is meant as a concept map converted into a flow of learning goals and questions. Note, again, that it is possible, when building your actual lesson, to re-order these files, or omit one or more of them.

User profiles of people approaching high-performance computing from an academic and/or commercial background are provided to help guide planning and decision-making.

  1. Why use a cluster? (20 minutes)

    • Brief, concentrate on the concepts not details like interconnect type, etc.
    • Be able to describe what a compute cluster (HPC/HTC system) is
    • Explain how a cluster differs from a laptop, desktop, cloud, or "server"
    • Identify how an compute cluster could benefit you.
    • Jargon busting
  2. Working on a remote HPC system (35 minutes)

    • Understand the purpose of using a terminal program and SSH
    • Learn the basics of working on a remote system
    • Know the differences of between login and compute nodes
    • Objectives: Connect to a cluster using ssh; Transfer files to and from the cluster; Run the hostname command on a compute node of the cluster.
    • Potential tools: ssh, ls, hostname, logout, nproc, free, scp, man, wget
  3. Working with the scheduler (1 hour 15 minutes)

    • Know how to submit a program and batch script to the cluster (interactive & batch)
    • Use the batch system command line tools to monitor the execution of your job.
    • Inspect the output and error files of your jobs.
    • Potential tools: shell script, sbatch, squeue -u, watch, -N, -n, -c, --mem, --time, scancel, srun, --x11 --pty,
    • Extras: --mail-user, --mail-type,
    • Remove? watch
    • Later lessons? -N -n -c
  4. Accessing software via Modules (45 minutes)

    • Understand the runtime environment at login
    • Learn how software modules can modify your environment
    • Learn how modules prevent problems and promote reproducibility
    • Objectives: how to load and use a software package.
    • Tools: module avail, module load, which, echo $PATH, module list, module unload, module purge, .bashrc, .bash_profile, git clone, make
    • Remove: make, git clone,
    • Extras: .bashrc, .bash_profile
  5. Transferring files with remote computers (30 minutes)

    • Understand the (cognitive) limitations that remote systems don't necessarily have local Finder/Explorer windows
    • Be mindful of network and speed restrictions (e.g. cannot push from cluster; many files vs one archive)
    • Know what tools can be used for file transfers, and transfer modes (binary vs text)
    • Objective: Be able to transfer files to and from a computing cluster.
    • Tools: wget, scp, rsync (callout), mkdir, FileZilla,
    • Remove: dos2unix, unix2dos,
    • Bonus: gzip, tar, dos2unix, cat, unix2dos, sftp, pwd, lpwd, put, get
  6. Running a parallel job (1 hour)

    • Introduce message passing and MPI as the fundamental engine of parallel software
    • Walk through a simple Python program for estimation of Ï€
    • Use mpi4py to parallelize the program
    • Write job submission scripts & run the job on a cluster node
    • Tools: nano, sbatch, squeue
  7. Using resources effectively (40 minutes)

    • Understand how to look up job statistics
    • Learn how to use job statistics to understand the health of your jobs
    • Learn some very basic techniques to monitor / profile code execution.
    • Understand job size and resource request implications.
    • Tools: fastqc, sacct, ssh, top, free, ps, kill, killall (note that some of these may not be appropriate on shared systems)
  8. Using shared resources responsibly (20 minutes)

    • Discuss the ways some activities can affect everyone else on the system

Nascent lesson ideas

  1. Playing friendly in the cluster (psteinb: the following is very tricky as it is site dependent, I personally would like to see it in _extras)

    • Understanding resource utilisation
    • Profiling code - time, size, etc.
    • Getting system stats
    • Consequences of going over
  2. Filesystems and Storage: objectives likely include items from @psteinb's Shared Filesystem lesson:

    • Understand the difference between a local and shared / network filesystem
    • Learn about high performance / scratch filesystems
    • Raise attention that misuse (intentional or not) of a common file system negatively affects all users very quickly.
    • Possible tools: echo $TEMP, ls -al /tmp, df, quota
  3. Advanced Job Scripting and Submission:

    • Checking status of jobs (squeue, bjobs etc.), explain different job states and relate to scheduler basics
    • Cancelling/deleting a job (scancel, bkill etc.)
    • Passing options to the scheduler (log files)
    • Callout: Changing a job's name
    • Optional Callout: Send an email once the job completes (not all sites support sending emails)
    • for a starting point, see this for reference
  4. Filesystem Zoo:

    • execute a job that collects node information and stores the output to /tmp
    • ask participants where the output went and why they can't see it
    • execute a job that collects node information and stores the output to /shared or however your shared file system is called
    • for a starting point, see this

More Repositories

1

geospatial-python

Introduction to Geospatial Raster and Vector Data with Python
159
star
2

proposals

Open an issue in this repository to share Carpentries-style lessons and lesson ideas.
88
star
3

python-testing

Python Testing and Continuous Integration
Python
56
star
4

python-intermediate-development

"Intermediate Research Software Development Skills (Python)" Lesson Material
Python
51
star
5

introduction-to-conda-for-data-scientists

Introduction to Conda for (Data) Scientists
Python
47
star
6

docker-introduction

Reproducible Computational Environments using Containers
Python
44
star
7

SDC-BIDS-fMRI

fMRI Imaging Analysis
Jupyter Notebook
41
star
8

lc-webscraping

Introduction to web scraping
Python
35
star
9

targets-workshop

Pre-alpha {targets} workshop
R
33
star
10

deep-learning-intro

Learn Deep Learning with Python
Jupyter Notebook
30
star
11

machine-learning-novice-sklearn

A Carpentry style lesson on machine learning with Python and scikit-learn.
Jupyter Notebook
28
star
12

bioc-intro

Bioconductor data science introduction
R
28
star
13

SDC-BIDS-sMRI

Structural Neuroimaging Analysis in Python
Jupyter Notebook
27
star
14

shell-extras

Extra Unix Shell Material
Python
26
star
15

python-packaging-publishing

Packaging and Publishing with Python
Python
24
star
16

SDC-BIDS-dMRI

Introduction to dMRI
Jupyter Notebook
23
star
17

workflows-nextflow

Workflow management with Nextflow and nf-core
Nextflow
22
star
18

SDC-BIDS-IntroMRI

Introduction to MRI and BIDS
Jupyter Notebook
21
star
19

ml4bio-workshop

Materials for a workshop introducing machine learning to biologists
Jupyter Notebook
21
star
20

lesson-gpu-programming

GPU Programming with Python and CUDA.
R
20
star
21

bioc-rnaseq

Analysis and Interpretation of Bulk RNA-Seq Data using Bioconductor
R
18
star
22

bioc-project

Introduction to the Bioconductor project
R
18
star
23

machine-learning-librarians-archivists

Introduction to AI for GLAM
Python
17
star
24

snakemake-novice-bioinformatics

Introduction to Snakemake for Bioinformatics
Python
16
star
25

jekyll-pages-novice

Building Websites with Jekyll & GitHub Pages.
HTML
16
star
26

julia-novice

A lesson exploring the Julia language
Julia
15
star
27

python-humanities-lesson

Python for Humanities
13
star
28

intro-to-modern-fortran

Introduction to Modern Fortran
R
13
star
29

reproducible-publications-quarto

Introduction to Reproducible Publications with Quarto
Python
12
star
30

swc_github_flow

Instructions for contributing the to free and open source materials for teaching foundational computational and data science skills to researchers maintained by The Carpentries at https://software-carpentry.org/lessons/ https://librarycarpentry.org/lessons/ and http://datacarpentry.org/lessons/
12
star
31

high-dimensional-stats-r

High-dimensional statistics with R
HTML
12
star
32

pangenomics

Pangenome Analysis in Prokaryotes Lesson
Python
11
star
33

python-text-analysis

Text Analysis with Python
Python
11
star
34

cwl-novice-tutorial

Introduction to Workflows with Common Workflow Language
HTML
11
star
35

singularity-introduction

An introduction to singularity
Python
11
star
36

lesson-parallel-python

Parallel Programming in Python
Python
10
star
37

fair-research-software

A course on tools and practices for open, sustainable and FAIR (Findable, Accessible, Interoperable and Reusable) research software
Python
10
star
38

intro-data-viz

a Carpentries-style lesson introducing the basics of data visualization
9
star
39

task-management

CW24 Hack Day project - Carpentries-style lesson "Task Management for Humans as Self Care"
8
star
40

open-science-with-r

Carpentry-style lesson on how to use R, RStudio together with git & Github to promote Open Science practices.
Python
8
star
41

python-business

Python for Business
HTML
8
star
42

data-science-ai-senior-researchers

Introduction to Data Science and AI for senior researchers
Python
8
star
43

fair-bio-practice

FAIR in (biological) practice
Jupyter Notebook
8
star
44

managing-computational-projects

Managing Open and Reproducible Computational Projects
R
8
star
45

lc-xml

Library Carpentry: XML - not currently maintained.
HTML
7
star
46

template

A blank starting point for new lessons in The Carpentries Incubator
Python
7
star
47

genome-mining

Genome Mining in Prokaryotes
Python
7
star
48

sage-lesson

SageMath Software Carpentry Lesson
Jupyter Notebook
7
star
49

lesson-ideas

Repo to capture ideas about new Data Carpentry lessons or new versions of existing lessons
7
star
50

markdown-intro

Introduction to Markdown
HTML
6
star
51

scientific-metadata

Introduction to the Fundamentals of Scientific Metadata
6
star
52

sql-humanities-lesson

SQL for Humanities
Python
6
star
53

quarto-project-example

Project Example for the Lesson: Introduction to Reproducible Publications with Quarto
JavaScript
6
star
54

jupyter_maps

Interactive Maps in the Jupyter Notebook
HTML
6
star
55

git-novice-branch-pr

Version Control with Git
HTML
5
star
56

capstone-novice-spreadsheet-biblio

From a Spreadsheet to a Database
Python
5
star
57

foundational-computer-skills

Foundational Computer Skills
Python
5
star
58

julia-data-workflow

Learn Julia workflows for data-intensive research
HTML
5
star
59

data-harvesting-for-agriculture

Data Harvesting for Agriculture
HTML
5
star
60

carpentries-incubator.org

HTML
5
star
61

Data-Science-for-Docs

Data Science For Practicing Clinicians
HTML
5
star
62

python_packaging

A lesson on Python packaging and publishing, built using the Carpentries Workbench
R
5
star
63

lesson-R-packaging

R Packaging
5
star
64

pymarc_basics

Material for a lesson introducing PyMARC
Python
5
star
65

gap-lesson

Programming with GAP
Python
5
star
66

python-interactive-data-visualizations

Creating Interactive Data Visualizations with Python
Jupyter Notebook
5
star
67

statistical-probabilistic-programming-r

Introduction to Probabilistic Programming
R
5
star
68

jupyter-notebooks-intro

Introduction to Jupyter notebooks
Python
4
star
69

OpenRefine-humanities-lesson

Open Refine for Humanities
Python
4
star
70

twitter-with-twarc

Introduction to Harvesting Twitter Data with Twarc
Jupyter Notebook
4
star
71

life-sciences-workshop

Life Sciences Workshop
HTML
4
star
72

machine-learning-novice-python

Introduction to Machine Learning with Python
Python
4
star
73

python-intermediate-inflammation

A template software project for use in Intermediate Research Software Development Skills In Python course. Contact: @anenadic
Python
4
star
74

study-groups

The Carpentries Lesson Development Study Groups
HTML
4
star
75

R-ecology-lesson

ARCHIVED - Data Analysis and Visualization in R for Ecologists
R
3
star
76

statistical-thinking-public-health

Statistical thinking for public health
Python
3
star
77

machine-learning-responsible-python

Introduction to responsible machine learning with Python
Python
3
star
78

blogging-with-hugo-and-github-pages

Carpentries Incubator lesson to learn how to build blog sites with Hugo and GitHub Pages
HTML
3
star
79

statistical-inference-for-biology

Statistical Inference for Biology
HTML
3
star
80

fair-explainable-ml

Fair and explainable ML workshop
Jupyter Notebook
3
star
81

fair-data-management-agriculture

FAIR Data Management for Long-term Agriculture Experiments
3
star
82

spreadsheet-humanities-lesson

Data Organization in Spreadsheets for Humanities
Python
3
star
83

statistics-r-public-health

Statistical analysis in R for public health.
Python
3
star
84

git-Rstudio-course

Git Using RStudio
Python
3
star
85

frictionless-data-agriculture

Frictionless Data for Agriculture Research
Python
3
star
86

r-ml-tabular-data

A Data-Carpentry-style lesson on some ML techniques in R
Python
3
star
87

citable-software

Making Code Citable
Python
2
star
88

intro-image-classification-cnn

new lesson on image classification with convolutional neural networks
Python
2
star
89

iot-novice

An introduction to the Internet of things using a motorcontroller and sensors
2
star
90

python-modeling-power-consumption

Modeling Time Series Data for Engineers
2
star
91

gpu-speedups

GPU Speedups in Python
Python
2
star
92

r-for-artists

R for Artists
Python
2
star
93

lc-litsearchr

Library Carpentry: Introduction to R and litsearchr
TeX
2
star
94

hpc-workflows

Creating HPC Workflows using Snakemake
R
2
star
95

latex-novice-typesetting

Typesetting in LaTeX
Python
2
star
96

scrna-seq-analysis

Single-cell RNA Sequencing Data Analysis
Python
2
star
97

rna-seq-data-for-ml

RNA-Seq: Data Readiness for Machine Learning Applications
R
2
star
98

Indigenous-Data-Sovereignty

Introduces the concepts and framework of Indigenous Data Sovereignty and Governance.
2
star
99

java-intro

An Introduction to Java Programming
2
star
100

r-geospatial-urban

Geospatial Data Carpentry with R for Urbanists
HTML
2
star