30
Introduction Documentation Correctness Performance Strategies for correctness, performance and documentation in research software Albert Solernou RSE 2017, Manchester. 8th Sep, 2017

Strategies for correctness, performance and …...Documenting FFEA Doxygen for the code describe variables, methods & classes navigate through the code great for developers! Markdown

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Introduction Documentation Correctness Performance

Acknowledgements

FFEA team

Sarah A. HarrisDaniel J. ReadOliver G. HarlenBenjamin Hanson

Robert WelchRobin A. Richarson

Thank you!