Full text
The Reasonable Performance Computing SIG Knowledge Base Robert Chisholm, Peter Heywood
The right tool for the job?
Typical research code author ●Domain expert ○They know lots about their field ●Self-taught programmers ○Bad habits ●Short of time ○Just need the code to work ●Often working with inherited code ○May not be familiar with entire codebase �� 🔬
This leads to coding traps ●Often unnoticed in code thatʼs in use for many years by many users ●Common traps found across vastly different projects ●Potentially unreasonably poor performance Managing uniques with an array Most common mistake. With enough data 1000x speedup possible. Rather than a set
Just use HPC! ●It will run faster on HPC, right? ○There can be friction getting started with HPC ○Single-threaded performance may be slower on HPC ○Often challenging to utilise parallel, distributed or GPUs Gemini 2.5 Flash
FFEA - A recent case study (26th August) ●Fluctuating Finite Element Analysis (Molecular Modelling Software) ●C++ & OpenMP ●Development began 2010 ●9 authors ○PhD Students ○Postdoc Research Associates ●~12 publications Representative of much research software https://ffea.bitbucket.io/
FFEA - A recent case study (26th August) ●Asked to review itʼs performance ●Sent an example of a current userʼs workload. ●Models a bundle of “rods” ./ffea myofilaments.ffea Runtime 312 seconds
FFEA - A recent case study (26th August) ●Re-compile for gprof (basic C/C++ profiler) cmake -DCMAKE_C_FLAGS=-pg -DCMAKE_CXX_FLAGS=-pg -DCMAKE_EXE_LINKER_FLAGS=-pg -DCMAKE_SHARED_LINKER_FLAGS=-pg -DUSE_OPENMP=OFF .. cmake --build . ●Then profile ./ffea myofilaments.ffea gprof ffea gmon.out > analysis.txt
FFEA - A recent case study (26th August) The results: Flat profile: Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls ms/call ms/call name 53.94 2.12 2.12 36497000 0.00 0.00 rod::Rod::Rod(rod::Rod const&) 19.85 2.90 0.78 72994000 0.00 0.00 std::vector<...>* std::__do_uninit_copy<...>(...) 11.45 3.35 0.45 36497000 0.00 0.00 rod::Rod::~Rod() 2.29 3.44 0.09 20715750 0.00 0.00 rod::get_element_midpoint(...) 1.78 3.51 0.07 18073000 0.00 0.00 rod::Rod::get_p(int, std::array<float, 3ul>&, bool) ...
FFEA - A recent case study (26th August) The significance: ●This mistake was introduced in February 2018 ○Identified 7.5 years later ●About an hourʼs work to identify and address ○It took me longer to workout how to run the example ●Central to all simulations using Rods ○10x speedup can be assumed broad ●The full simulation previously took “a week” to run. ○Now less than 11 hours.
How can we enable researchers to catch and address similar problems sooner?
Develop Training ●Profiling & Optimisation (Python) ○Carpentries style short-course ○Introduced here last year ○Now in beta status! ○Maintained by Jost Migenda (KCL) and myself https://github.com/carpentries-incubator/pando-python https://doi.org/10.5281/zenodo.16902755
Develop Training - Doesnʼt Scale ●It took a month to develop less than a dayʼs worth of training. ○More time then spent refining/updating it with feedback. ●It only covers the most general Python ○We stopped teaching C++ at Sheffield because there wasnʼt enough interest. ●Itʼs not possible to create a bespoke training for every combination of languages and libraries used in research.
SIG-RPC Knowledge Base https://sig-rpc.github.io/ ●Mini guides ○Profiler how-toʼs ○Performance patterns ●Quick to write ●Easy to understand* *in theory
Profilers ●Short high-level profiling intro ●Filtered by ○Language ○“Style” ●Suggested Sections: ○Quickstart ○Interpreting output ○Limitations
Optimisations ●Filtered by ○Language ○“Subcategory” ●Suggested Sections: ○Description ○Example benchmark ○Technical Detail
Easy to Maintain & Extend ●Static Jekyll website ●Guides written in markdown ○YAML header; priority, authors, name, language, style, website ○Markdown body ■<!-- more --> create the fold
How can you contribute?
Task 1: Reviewing Find an existing guide: ●Is it correct? ●Is it appropriate for a less technical audience? ●Are any important details missing? Create a GitHub issue/fill in a paper form. Current authors have all been highly-technical, so itʼs possible weʼve missed the mark.