Summary and Schedule
Pomona College HPC Workshop Series
This workshop is part of the Pomona College Research Computing Workshop Series, adapted from Automation and Make by Software Carpentry.
Cluster: sagehen.hpc.pomona.edu Web Portal: OnDemand Support: its-hpc@pomona.edu
Make is available on the Sagehen HPC cluster by default. Automating your analysis pipelines with Make is especially valuable for reproducible HPC workflows.
Adapted for Pomona College by Andrew Wilson, ITS Research Computing. Licensed under CC-BY 4.0.
Make is a tool which can run commands to read files, process these files in some way, and write out the processed files. For example, in software development, Make is used to compile source code into executable programs or libraries, but Make can also be used to:
- run analysis scripts on raw data files to get data files that summarize the raw data;
- run visualization scripts on data files to produce plots; and to
- parse and combine text files and plots to create papers.
Make is called a build tool - it builds data files, plots, papers, programs or libraries. It can also update existing files if desired.
Make tracks the dependencies between the files it creates and the files used to create these. If one of the original files (e.g. a data file) is changed, then Make knows to recreate, or update, the files that depend upon this file (e.g. a plot).
There are now many build tools available, all of which are based on the same concepts as Make.
Prerequisites
In this lesson we use make from the Unix Shell. Some
previous experience with using the shell to list directories, create,
copy, remove and list files and directories, and run simple scripts is
necessary.
Setup
In order to follow this lesson, you will need to download some files. Please follow instructions on the setup page.
Acknowledgments
Developed by Andrew Wilson, Director of Research Computing and Digital Scholarship at Pomona College, with Andrei Motchenko, who tested, edited and produced screenshots for the workshop series.
| Setup Instructions | Download files required for the lesson | |
| Duration: 00h 00m | 1. Introduction | How can I make my results easier to reproduce? |
| Duration: 00h 25m | 2. Makefiles | How do I write a simple Makefile? |
| Duration: 01h 05m | 3. Automatic Variables | How can I abbreviate the rules in my Makefiles? |
| Duration: 01h 20m | 4. Dependencies on Data and Code | How can I write a Makefile to update things when my scripts have changed rather than my input files? |
| Duration: 01h 40m | 5. Pattern Rules | How can I define rules to operate on similar files? |
| Duration: 01h 50m | 6. Variables | How can I eliminate redundancy in my Makefiles? |
| Duration: 02h 10m | 7. Functions | How else can I eliminate redundancy in my Makefiles? |
| Duration: 02h 35m | 8. Self-Documenting Makefiles | How should I document a Makefile? |
| Duration: 02h 45m | 9. Conclusion | What are the advantages and disadvantages of using tools like Make? |
| Duration: 03h 20m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
Running on Sagehen HPC (recommended at Pomona)
This workshop runs equally well on a personal laptop or on Sagehen, Pomona College’s research computing cluster. To use Sagehen:
- Sign in at https://ondemand.hpc.pomona.edu using your Pomona credentials and DUO MFA at https://duo.pomona.edu.
- Open Clusters > Sagehen Shell Access for a browser-based bash terminal.
-
makeis available on every Sagehen node, so you can build and re-run pipelines directly on the cluster — including from inside a SLURM batch job. - Cecil Sagehen’s lab teammates often keep their pipelines under
/bigdata/lab/<labname>/pipelines/so the Makefile and its outputs are versioned alongside the data.
Files
You need to download some files to follow this lesson:
Download make-lesson.zip.
Move
make-lesson.zipinto a directory which you can access via your bash shell.Open a Bash shell window.
Navigate to the directory where you downloaded the file.
Unpack
make-lesson.zip:
$ unzip make-lesson.zip
- Change into the
make-lessondirectory:
$ cd make-lesson
Software
You also need to have the following software installed on your computer to follow this lesson:
GNU Make
Linux
Make is a standard tool on most Linux systems and should already be
available. Check if you already have Make installed by typing
make -v into a terminal.
One exception is Debian, and you should install Make from the
terminal using sudo apt-get install make.
OSX
You will need to have Xcode installed (download from the Apple website). Check if
you already have Make installed by typing make -v into a
terminal.
Windows
Use the Software Carpentry Windows installer.
Python
Python2 or Python3, Numpy and Matplotlib are required. They can be installed separately, but the easiest approach is to install Anaconda which includes all of the necessary python software.