Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe...
Transcript of Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe...
![Page 1: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/1.jpg)
Introduction Documentation Correctness Performance
Strategies for correctness, performance anddocumentation in research software
Albert Solernou
RSE 2017, Manchester.
8th Sep, 2017
![Page 2: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/2.jpg)
Introduction Documentation Correctness Performance
Contents
1 Introduction
2 Documentation
3 Correctness
4 Performance
![Page 3: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/3.jpg)
Introduction Documentation Correctness Performance
Contents
1 Introduction
2 Documentation
3 Correctness
4 Performance
![Page 4: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/4.jpg)
Introduction Documentation Correctness Performance
Background
FFEA: continuum mechanicsfor biomolecules
ρDuDt
= ∇( σv + σe + π ) + f
viscous stress
elastic stress
thermal noise
external forces
Finite Element Method leads to:
Mdudt
= −Ku + E + N + O
a Langevin matrix equation.
Initial situation:
Proposed works:develop new methodologiesfor interactionsimprove the performance formany body simulations
Challenges:learn cont. mech. & FEMsurvive a new code
![Page 5: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/5.jpg)
Introduction Documentation Correctness Performance
Contents
1 Introduction
2 Documentation
3 Correctness
4 Performance
![Page 6: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/6.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codeMarkdown for the restDocumenting morepackagesOnline availability
![Page 7: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/7.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codedescribe variables,methods & classesnavigate through thecodegreat for developers!
Markdown for the restDocumenting morepackagesOnline availability
![Page 8: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/8.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codedescribe variables,methods & classesnavigate through thecodegreat for developers!
Markdown for the restDocumenting morepackagesOnline availability
![Page 9: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/9.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codedescribe variables,methods & classesnavigate through thecodegreat for developers!
Markdown for the restDocumenting morepackagesOnline availability
![Page 10: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/10.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codedescribe variables,methods & classesnavigate through thecodegreat for developers!
Markdown for the restDocumenting morepackagesOnline availability
![Page 11: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/11.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codedescribe variables,methods & classesnavigate through thecodegreat for developers!
Markdown for the restDocumenting morepackagesOnline availability
![Page 12: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/12.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codedescribe variables,methods & classesnavigate through thecodegreat for developers!
Markdown for the restDocumenting morepackagesOnline availability
![Page 13: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/13.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codeMarkdown for the rest
file formatskeyword referencegeneral usagetutorial
Documenting morepackagesOnline availability
![Page 14: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/14.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codeMarkdown for the rest
file formatskeyword referencegeneral usagetutorial
Documenting morepackagesOnline availability
![Page 15: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/15.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codeMarkdown for the rest
file formatskeyword referencegeneral usagetutorial
Documenting morepackagesOnline availability
![Page 16: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/16.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codeMarkdown for the rest
file formatskeyword referencegeneral usagetutorial
Documenting morepackagesOnline availability
![Page 17: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/17.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codeMarkdown for the restDocumenting morepackages
FFEA Toolsbuilt inside FFEA/docautomated withCMake
Online availability
![Page 18: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/18.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codeMarkdown for the restDocumenting morepackages
FFEA Toolsbuilt inside FFEA/docautomated withCMake
Online availability
![Page 19: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/19.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codeMarkdown for the restDocumenting morepackages
FFEA Toolsbuilt inside FFEA/docautomated withCMake
Online availability
![Page 20: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/20.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codeMarkdown for the restDocumenting morepackagesOnline availability
readthedocs.orgdesigned for Sphinxand Mkdocsworked with Doxygen!
![Page 21: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/21.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codeMarkdown for the restDocumenting morepackagesOnline availability
readthedocs.orgdesigned for Sphinxand Mkdocsworked with Doxygen!
![Page 22: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/22.jpg)
Introduction Documentation Correctness Performance
Documenting FFEA
Doxygen for the codeMarkdown for the restDocumenting morepackagesOnline availability
readthedocs.orgdesigned for Sphinxand Mkdocsworked with Doxygen!
![Page 23: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/23.jpg)
Introduction Documentation Correctness Performance
Contents
1 Introduction
2 Documentation
3 Correctness
4 Performance
![Page 24: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/24.jpg)
Introduction Documentation Correctness Performance
analytical testing
testing throughshort trajectories:
proof physics
learned a lot
more affordablethan unit tests
many bugs fixed
Steric repulsion Energy contributions
Bending & Stretching Energy distribution & Diffusion
![Page 25: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/25.jpg)
Introduction Documentation Correctness Performance
Correctness & Usability
Random Number Generators:
Mersenne-Twisterhuge period: 219937 − 1parallel issuesfails testU011
RNGStreams2:long period: 2191
251 independent streamspasses testU01restarting is possible
Automatic version labelling:
A Git hook saves the previousCommit ID.
CMake configures the sorces:
if it finds Git→get the latest Commit IDotherwise→use the previous Commit ID
[1] P. L’Ecuyer & R. Simard, ACM Trans Math Soft (TOMS), 33(4):22 (2007)[2] P. L’Ecuyer et al. Oper Res, 50(6):1073-1075 (2002)
![Page 26: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/26.jpg)
Introduction Documentation Correctness Performance
Contents
1 Introduction
2 Documentation
3 Correctness
4 Performance
![Page 27: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/27.jpg)
Introduction Documentation Correctness Performance
Parallel approach
Iteratively:calculate forcessolve:
Mpqdvq
dt= −Kpqvq+Ep+Np+Op
update the positions
Orthogonal work distribution:n2 interactions in Opare fully distributedeach thread works on a body:
calculates Kpq, Ep and Npsolves the equations ofmotiontakes the time step
C++11 threads update:update neighbour listswrite to files
![Page 28: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/28.jpg)
Introduction Documentation Correctness Performance
Optimisation & Performance
Optimisation works:
remove calls to pow
extensive refactoring
split n2 interactions in cells (linkedlists)
adjust OMP loops & schedules
remove some OMP Criticalsections (at the cost of computingmore)
allocate memory to the rightNUMA node
use C++11 threads for serial tasks
strong scaling, 32 HT cores:
256-core SGI UV2000:
![Page 29: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/29.jpg)
Introduction Documentation Correctness Performance
Optimisation & Performance
Optimisation works:
remove calls to pow
extensive refactoring
split n2 interactions in cells (linkedlists)
adjust OMP loops & schedules
remove some OMP Criticalsections (at the cost of computingmore)
allocate memory to the rightNUMA node
use C++11 threads for serial tasks
strong scaling, 32 HT cores:
256-core SGI UV2000:
![Page 30: Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown](https://reader034.fdocuments.us/reader034/viewer/2022050503/5f9552aa8c0fef5db153daab/html5/thumbnails/30.jpg)
Introduction Documentation Correctness Performance
Acknowledgements
FFEA team
Sarah A. HarrisDaniel J. ReadOliver G. HarlenBenjamin Hanson
Robert WelchRobin A. Richarson
Thank you!