Better Scientific Software
a tutorial presented at
The International Conference for High-Performance Computing, Networking, Storage, and Analysis (SC21)
on 8:00 am - 5:00 pm CST Monday 15 November 2021
Presenters: David E. Bernholdt (Oak Ridge National Laboratory), Anshu Dubey (Argonne National Laboratory), Patricia A. Grubel (Los Alamos National Laboratory), Rinku K. Gupta (Argonne National Laboratory), and Gregory R. Watson (Oak Ridge National Laboratory)
Helper: David M. Rogers (Oak Ridge National Laboratory)
This page provides detailed information specific to the tutorial event above. Expect updates to this page up to, and perhaps shortly after, the date of the tutorial. Pages for other tutorial events can be accessed from the main page of this site.
Quick Links
- Playlist (YouTube)
- Presentation Slides (FigShare)
- Hands-On Code Repository (GitHub)
On this Page
- Description
- Agenda
- Presentation Slides
- Hands-On Exercises
- Other Software-Related Events at SC21
- Stay in Touch
- Resources from Presentations
- Requested Citation
- Acknowledgements
Description
Computational science and engineering (CSE) is in the midst of an extremely challenging period created by the confluence of disruptive changes in computing architectures, demand for greater scientific reproducibility, sustainability, and quality, and new opportunities for greatly improved simulation capabilities, especially through coupling physics and scales. These challenges demand increased investments in scientific software development and improved practices. Focusing on improved developer productivity and software sustainability is both urgent and essential. Key practices include code refactoring, flexible and extensible design, thoughtful testing, attention to reproducibility at all stages, and effective collaboration around code.
This tutorial presents software practices, processes, and tools explicitly tailored for CSE and HPC. Goals are improving the productivity of those who develop CSE software and increasing the sustainability of software artifacts. Topics include the software processes for (small) teams, including agile processes, collaboration via version control workflows, reproducibility, and scientific software design, refactoring, and testing.
Agenda
Time (CST) | Module | Title | Presenter |
---|---|---|---|
8:00 AM | 0 | Introduction and Setup | David E. Bernholdt (ORNL) |
8:10 AM | 1 | Motivation and Overview of Best Practices in HPC Software Development | Patricia A. Grubel (LANL) |
8:30 AM | 2 | Git Workflows | Patricia A. Grubel (LANL) |
9:00 AM | 3 | Agile Methodologies | Rinku K. Gupta (ANL) |
9:30 AM | 4 | Scientific Software Design | David E. Bernholdt (ORNL) |
10:00 AM | Break with optional discussion or hands-on activities | ||
10:30 AM | 5 | Agile Methodologies Redux | Rinku K. Gupta (ANL) |
10:45 AM | 6 | Improving Reproducibility Through Better Software Practices | David E. Bernholdt (ORNL) |
11:30 AM | Hands-on & Discussion | ||
12:00 PM | Lunch break with optional discussion or hands-on activities | ||
1:00 PM | 7 | Software Testing Introduction | Gregory R. Watson (ORNL) |
1:30 PM | 8 | Continuous Integration | Gregory R. Watson (ORNL) |
1:55 PM | 9 | Testing Complex Software | Anshu Dubey (ANL) |
2:15 PM | 10 | Refactoring Scientific Software | Anshu Dubey (ANL) |
3:00 PM | Break with optional discussion or hands-on activities | ||
3:30 PM | 11 | Summary | David E. Bernholdt (ORNL) |
3:45 PM | Hands-on & Discussion | ||
5:00 PM | Adjourn |
Presentation Slides
The latest version of the slides will always be available at https://doi.org/10.6084/m9.figshare.16556628.
Note that these files may include additional slides that will not be discussed during the tutorial, but questions are welcome.
- Version History:
- v2: Minor updates to five of the slide decks
- intro: added DavidR as helper
- git-workflows: fix minor typo
- reproducibility: add external links to two slides
- testing-introduction2: minor changes to code examples for different directory location
- summary: Add year to covid slides
- v1: Initial publication
- v2: Minor updates to five of the slide decks
Hands-On Exercises
Introduction
The hands-on exercises for this tutorial are based around a simple numerical model using the one-dimensional heat equation. The example is described briefly in the repository’s README file, and in greater detail in the ATPESC Hands-On lesson. The ATPESC version focuses on the numerical aspects of the model.
But for this tutorial, we’re focused on how to make the software better from a quality perspective, so you don’t need to understand the math to do these exercises.
For the purposes of these hands-on exercises, you should imagine you’ve inherited an early version of the hello-numerical-world software from a colleague who’s left the project, and you’ve been assigned to get it into better shape so that it can be used in the next ATPESC summer school.
The repository you’ll be working with is: bssw-tutorial/hello-numerical-world-2021-11-15-sc.
Note: most of the screenshots will refer to the generic “hello-numerical-world” repository rather than the one specifically for this event.
List of Hands-On Exercises
Note that not every presentation module has exercises (yet).
- Setting up the Prerequisites. Setup the accounts needed for these exercises.
- Git Workflows. You’ll fork our hello-numerical-world repository, create a feature branch, and make a pull request
- Agile Methodologies. You’ll use GitHub issues and project boards to setup a simple “personal kanban” board.
- Agile Redux. You’ll create epic, story, and task issues for the refactoring task and track them on a kanban board
- Software Testing. You’ll use an example project to try out using test driven development to add new functionality to a project
- Continuous Integration. You’ll establish a simple continuous integration workflow and then refine it, adding code coverage assessment
- Refactoring Scientific Software. You’ll perform a small, well-defined refactoring exercise
Other Software-Related Events at SC21
If you’re interested in this tutorial, you might be interested in this list of other software-related events taking place in the SC21 conference. And remember that since much of SC21’s content will be available on-demand, you may be able to “catch up” with events that you miss.
Stay in Touch
-
After the tutorial please feel free to email questions or feedback to the BSSw tutorial team at bssw-tutorial@lists.mcs.anl.gov.
-
If you want to do the hands-on exercises, we’re happy to provide feedback on your pull requests and issues, even after the end of the tutorial.
-
To find out about future events organized by the IDEAS Productivity Project, you can subscribe to our mailing list (usually ~2 messages/month).
-
For monthly updates on the Better Scientific Software site, subscribe to our monthly digest.
Resources from Presentations
Links from the tutorial presentations are listed here for convenience
- Module 0: Introduction and Setup
- Module 1: Motivation and Overview of Best Practices in HPC Software Development
- Best Practices for Scientific Computing
- Good Enough Practices in Scientific Computing
- Linux Foundation Core Infrastructure Initiative (CII) Best Practices Badging Program
- Rate Your Project Assesment Tool
- Progress Tracking Card (PTC) Examples
- Productivity and Sustainability Improvement Planning
- Better Scientific Software (BSSw)
- Module 2: Git Workflows
- Atlassian/BitBucket (Comparing Workflows)
- How to code review in a Pull Request
- Testing and Code Review Practices in Research Software Development (webinar) (previously linked to
ideas-productivity.org/events/hpc-best-practices-webinars/#webinar044) - Git Flow (Driessen’s Original Blog)
- GitHub Flow (previously linked to
scottchacon.com/2011/08/31/github-flow.html) - GitLab Flow (previously linked to
docs.gitlab.com/ee/topics/gitlab_flow.html) - Trilinos
- Open MPI
- FleCSI
- Module 3: Agile Methodologies
- Module 4: Scientific Software Design
- The Exascale Computing Project (ECP)
- Findings from the ECP Performance Portability Panel Series
- SC20 Tutorial: Better Scientific Software
- Performance Portability and the Exascale Computing Project
- Kokkos Lecture Series
- Related paper: A Design Proposal for a Next Generation Scientific Software Framework
- Related webinar: Software Design for Longevity with Performance Portability
- Module 5: Agile Methodologies Redux
- Module 6: Improving Reproducibility Through Better Software Practices
- Toward a Compatible Reproducibility Taxonomy for Computational and Computing Sciences (updated 2022-03-31 with DOI link)
- Reproducibility and Replicability in Science (updated 2022-03-31 with DOI link)
- Many Psychology Findings Not as Strong as Claimed
- The War Over Supercooled Water
- Researchers Find Bug in Python Script May Have Affected Hundreds of Studies
- National Science Foundation Data Management Plan Requirements
- SC21 Reproducibility Initiative
- ACM Transactions on Mathematical Software (TOMS)
- ACM Artifact Review and Badging
- http://fursin.net/reproducibility.html
- National Information Standards Organization (NISO) on Reproducibility and Badging
- Floating Point Analysis Tools
- Code Ocean (Cloud platforms - publish and reproduce research code and data)
- DOIs and hosting of data, code, documents:
- The FAIR Guiding Principles for Scientific Data Management and Stewardship. Mark D. Wilkinson, et al. 2016
- FAIR4RS (previously linked to
www.rd-alliance.org/groups/fair-research-software-fair4rs-wg) - Editorial: ACM TOMS Replicated Computational Results Initiative. Michael A. Heroux. 2015
- Enhancing Reproducibility for Computational Methods. Victoria Stodden, Marcia McNutt, David H. Bailey, Ewa Deelman, Yolanda Gil, Brooks Hanson, Michael A. Heroux, John P.A. Ioannidis, Michela Taufer Science (09 Dec 2016), pp. 1240-1241. DOI: 10.1126/science.aah6168
- Simple experiments in reproducibility and technical trust by Mike Heroux and students (work in progress)
- What every scientist should know about floating-point arithmetic. David Goldberg.
- Module 7: Software Testing Introduction
- In the face of uncertainties, NNSA seeks verification and validation
- Python Build and Test Framework: pyscaffold.org
- Build-Link-Test CMake Framework: llnl-blt.readthedocs.io
- Static Source Analysis (C++): clang-tidy
- Static Source Analysis (python): flake8 and pylint (updated 2022-03-31 due to dead link)
- Code Coverage Webservices: codecov and coveralls
- Tutorials for code coverage: Online Tutorial, Another example
- Development Practices Survey Article
- CMake Tutorial
- CMake add-test command documentation
- Verification and Validation in Scientific Computing
- Working Effectively with Legacy Code
- Module 8: Continuous Integration
- Module 9: Testing Complex Software
- Useful resources on testing (formerly linked to
ideas-productivity.org/resources/howtos/) - Related articles:
- Useful resources on testing (formerly linked to
- Module 10: Refactoring Scientific Software
- Module 11: Summary
- COVID-19 epidemiology saga
- https://doi.org/10.25561/77482
- https://www.nicholaslewis.org/imperial-college-uk-covid-19-numbers-dont-seem-to-add-up/
- https://www.nature.com/articles/d41586-020-01003-6
- https://www.foxnews.com/world/imperial-college-britain-coronavirus-lockdown-buggy-mess-unreliable
- https://www.telegraph.co.uk/technology/2020/05/16/coding-led-lockdown-totally-unreliable-buggy-mess-say-experts/
- https://github.com/mrc-ide/covid-sim/
- https://philbull.wordpress.com/2020/05/10/why-you-can-ignore-reviews-of-scientific-code-by-commercial-software-developers/amp/
- http://doi.org/10.5281/zenodo.3865491
- Productivity and Sustainability Improvement Planning
- https://rateyourproject.org/
- Progress Tracking Card Catalog
- Better Scientific Software web site
- Write to the tutorial authors
- IDEAS Productivity mailing list
- Better Scientific Software site
- COVID-19 epidemiology saga
Requested Citation
The requested citation the overall tutorial is:
David E. Bernholdt, Anshu Dubey, Patricia A. Grubel, Rinku K. Gupta, and Gregory R. Watson, Better Scientific Software tutorial, in The International Conference for High-Performance Computing, Networking, Storage, and Analysis (SC21), St. Louis, Missouri and online, 2021. DOI: 10.6084/m9.figshare.16556628.
Individual modules may be cited as Speaker, Module Title, in Better Scientific Software tutorial…
Acknowledgements
This tutorial is produced by the IDEAS Productivity project.
This work was supported by the U.S. Department of Energy Office of Science, Office of Advanced Scientific Computing Research (ASCR), and by the Exascale Computing Project (17-SC-20-SC), a collaborative effort of the U.S. Department of Energy Office of Science and the National Nuclear Security Administration.