Instructor Notes
Workshop Overview
Total Time: 2.5 hours (90 min teaching + 60 min exercises) Target Audience: Researchers and students using Sagehen HPC cluster Difficulty: Intermediate (assumes basic Linux command-line knowledge) Format: Hands-on with live coding and exercises
Learning Progression
The workshop builds from simple (loading modules) to complex (managing project-wide reproducibility):
- Lmod Basics:Foundation: what modules are, why they exist
- Finding Software:Practical: how to discover and learn about modules
- Managing Modules:Complex workflows: multiple modules, saved collections
- Conda Environments:Shift to package management for Python/R
- Pip and Venv:Alternative approaches and when to use them
- Best Practices:Reproducibility and professional workflows
Each episode builds on previous knowledge without being strictly prerequisite; instructors can skip episodes or reorder based on audience needs.
Pre-Workshop Checklist
1 week before: - Confirm all learners have Sagehen
accounts and SSH access - Test SSH connections from your teaching
location (account for network restrictions) - Verify modules listed in
setup guide are current: - module avail r:should show
r/4.2.2, r/4.2.3, r/4.4.1, r/4.5.1 (D) -
module avail miniconda3:should show py311, py312, py313
versions (py313_26.3.2-2 D) - module avail cuda:should show
cuda/11.8.0, 12.0.0, 12.2.1 (D) - Test conda environment creation:
conda create -n testenv python=3.10 works - Prepare a demo
conda environment for live examples
1 day before: - Test all example commands on a live
Sagehen account - Create sample environments and collections - Verify
module save and module restore work as
documented - Confirm disk quota is not an issue on your demo account
Episode 1: Lmod Basics (20 min)
Key Points to Emphasize
Why modules matter on shared systems:Concrete example: “Without modules, if you install R 4.2 globally, anyone needing R 3.6 is stuck. Modules solve this.”
Environment vs. Installation:“Loading a module doesn’t install software. It modifies your environment so you can use pre-installed software.”
-
Clarity on PATH:Learners struggle with abstract “PATH” concept. Show it:
Teaching Tips
-
Live Demo First: Spend 5 minutes demonstrating
module avail,module load,module list -
Have them repeat: Have each learner run
module load randmodule listin their terminal -
Show what changed: Before and after
which Ris powerful visual proof - Avoid theory: Keep explanation of LD_LIBRARY_PATH brief; most learners don’t need details
Episode 2: Finding Software (20 min)
Key Points to Emphasize
-
Filtering with patterns:
module avail ris much faster than scrolling full list - module help is crucial:Always check before loading unfamiliar modules
- Defaults matter:Why r/4.2.3 loads when you just say “r”
Teaching Tips
-
Demo grep with module avail:
BASH
$ module avail cuda # built-in substring filter (there is no gcc module) cuda/11.8.0 cuda/12.0.0 cuda/12.2.1This is powerful; it shows programmatic discovery without needing GUI tools.
Show module help output:Live example is better than reading documentation
Emphasize contacting support:If software isn’t there, they should ask, not work around it
Episode 3: Managing Modules (25 min)
Key Points to Emphasize
- module swap is cleaner than unload+load:Safety and explicit intent
- Collections save time and prevent errors:Show the time savings
- Job scripts require explicit loads:This is critical for reproducibility
Teaching Tips
-
Live demo of saving/restoring:
BASH
$ module load r openblas miniconda3 $ module save myworkflow $ module purge $ module list # Verify empty $ module restore myworkflow $ module list # Verify restoredThis is faster and more convincing than explanation.
-
Show job script in detail:
- Explain why
module purgecomes first - Show that the exact module loading matters
- Run a real example:
sbatch minimal_job.shand show output
- Explain why
Walk through a complex workflow: Quantum chemistry pipeline might need gcc → gamess → R. Show dependency ordering.
Exercise Troubleshooting
Problem: module save fails with
“permission denied” - Solution: Check if
.lmod.d directory exists: ls -la ~/.lmod.d/ -
Workaround: Manually create:
mkdir -p ~/.lmod.d
Problem: module restore doesn’t load
anything - Solution: Verify collection was saved:
module --list-collections - Common cause:
Saved as different name than trying to restore
Episode 4: Conda Environments (35 min)
Key Points to Emphasize
- Conda is for packages, modules are for applications:Clear separation
- Never install in base on shared systems:This is a hard rule for HPC
- Reproducibility through export:environment.yml is not optional
Teaching Tips
-
Live environment creation:
-
Show the disk space issue:
Real numbers are more persuasive than warnings about disk space.
-
Export and recreate locally:
Exercise Troubleshooting
Problem: conda: command not found after
loading miniconda3 - Solution: Module didn’t load
correctly. Try: module load miniconda3 again -
Check: which conda should show
/opt/lmod/miniconda3/...
Problem: conda create fails:
“Collecting package metadata” - Solution: This is
normal; wait for it or check internet connection -
Note: Creating large environments (many packages) can
take 5+ minutes
Problem: Package installation is slow - Solution: Normal on first install with many dependencies. Be patient. Can take 10+ minutes for scipy, pandas, etc.
Common Mistakes
- Installing numpy into base: Remind them: “You’re sharing base with the system. Don’t install into it.”
-
Forgetting
conda activate: They load an environment but don’t activate it. Show howwhich pythonchanges after activation. - Not exporting: “If you don’t export, you can’t reproduce this 6 months from now.”
Episode 5: Pip and Venv (15 min)
Key Points to Emphasize
- Conda vs. pip trade-offs:Conda better for science, pip for web dev
- Both are valid:Choose based on your project, not religion
- Combining them works:Conda for base environment, pip for additional packages
Teaching Tips
-
Quick venv demo:
BASH
$ python -m venv quicktest $ source quicktest/bin/activate (quicktest) $ pip install requests (quicktest) $ pip freeze > requirements.txt (quicktest) $ deactivateFast and shows the lightweight nature.
-
Emphasize the choice:
- Use conda if: complex dependencies, conda-forge packages needed, shared system
- Use venv if: pure Python packages only, minimal overhead needed, web development
- Use both: conda base, pip for additional packages
Episode 6: Best Practices (15 min)
Key Points to Emphasize
- Reproducibility requires explicit configuration:No magic, no assumptions
- Disk management prevents quota disasters:Regular cleanup is essential
- Documentation saves future you:Comments in job scripts matter
Teaching Tips
-
Show a bad job script, then good:
Bad:
Good:
BASH
#!/bin/bash #SBATCH --job-name=analysis #SBATCH --time=01:00:00 #SBATCH --cpus-per-task=4 #SBATCH --mem=16G # Clean state and load required modules module purge module load openblas/0.3.25 module load r/4.5.1 module load miniconda3 # Activate data analysis environment conda activate myanalysis # Run analysis Rscript analysis.R python analysis.py -
Disk quota demo:
BASH
$ quota_check.sh $ du -sh --apparent-size ~/.conda/envs/* $ conda clean --all # Show cleanup in actionNote: Bare
quotais unreliable on BeeGFS; always usequota_check.sh. Project structure example: Show them a real repository with environment.yml, job scripts, README
Timing and Pacing
| Episode | Teaching | Exercise | Total |
|---|---|---|---|
| 1. Lmod Basics | 15 min | 5 min | 20 min |
| 2. Finding Software | 10 min | 10 min | 20 min |
| 3. Managing Modules | 15 min | 10 min | 25 min |
| 4. Conda Environments | 20 min | 15 min | 35 min |
| 5. Pip/Venv | 10 min | 5 min | 15 min |
| 6. Best Practices | 10 min | 5 min | 15 min |
| TOTAL | 80 min | 50 min | 130 min |
Note: Timings are targets. Adjust based on: - Audience background (more time for beginners) - System responsiveness (conda operations take time) - Interest level (best practices can expand for engaged group)
Technical Considerations
Network Issues
If participants are off-site and VPN is slow: - Pre-create conda environments if possible - Avoid large package installations during exercises - Have backup examples pre-recorded to show if live demo fails
Engagement Strategies
- Pair programming:Learners work in pairs, one codes, one watches and comments
- Challenges with increasing difficulty:Episode 1 is very basic; Episode 6 is complex
- Real-world examples:Reference actual research workflows: genomics, ML, quantum chemistry
- Frequent breaks:Every 30 minutes, give people a 2-minute break
- Ask questions:“What would happen if we loaded this module twice?” engages critical thinking
Facilitating Challenges
Each episode has multiple challenges. Recommended approach:
- Read the challenge aloud:Ensure everyone understands
- Give time to work:5-10 minutes of silence while they work
- Circulate:Check if anyone is stuck
- Show solutions:But have people explain their approach first
- Discuss variations:“What if we changed this parameter?”
Assessment
No formal exam, but check understanding through:
- Challenges: Can they complete tasks independently?
- Questions: Do they ask good diagnostic questions?
- Troubleshooting: Can they identify and fix problems?
By end of workshop, learners should: - [ ] Confidently load and unload modules - [ ] Create conda environments and export them - [ ] Write reproducible job scripts with modules - [ ] Understand when to use conda vs. pip vs. venv - [ ] Know how to get help when things break
Post-Workshop Resources
Point learners to: - Sagehen user guide: https://pomona-college.github.io/ - Lmod docs: https://lmod.readthedocs.io/ - Conda docs: https://docs.conda.io/ - Support email: its-hpc@pomona.edu - This workshop: Can be repeated, materials available online
Troubleshooting Common Workshop Issues
Few people show up
- Still run it; provide individual attention
- Offer to schedule follow-up 1:1 sessions
- Record it for asynchronous learning
Many people have connection issues
- Switch to live demonstration only (no hands-on)
- Offer follow-up session for individual troubleshooting
- Provide pre-recorded demos
Someone finds a module isn’t available
- Check on the spot:
module avail modulename - If not there, explain: “We can request it from its-hpc@pomona.edu”
- Move on; don’t get stuck on one person’s missing software
Improving for Next Time
After the workshop: - Collect feedback:Ask what was most useful, what was confusing - Note timing:Did you finish on time? Which episodes rushed? - Module updates:Check if any modules have changed; update slides - Success stories:Ask participants follow-up: “Did this help your research?”
Use feedback to refine the workshop for next iteration.