Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing API Profiling #2013

Open
fsimonis opened this issue Apr 23, 2024 · 0 comments
Open

Missing API Profiling #2013

fsimonis opened this issue Apr 23, 2024 · 0 comments
Labels
enhancement A new feature, a new functionality of preCICE (from user perspective)

Comments

@fsimonis
Copy link
Member

fsimonis commented Apr 23, 2024

Please describe the problem you are trying to solve.

Currently, only a subset of the API functions show up in the profiling, namely:

  • construction
  • initialize
  • advance
  • finalize

We further annotate the time spent in the solver.

  • solver.initialize
  • solver.advance

However, this time still includes preCICE API calls, which can be interesting for the user to know the runtime of.

  • setMeshVertex / setMeshVertices
  • setMesh (Singular + Plural)
  • readData (which may perform interpolation)
  • writeData
  • writeGradientData
  • getVertexIDsAndCoordinates

Downside is that this will make already inefficient singular versions even slower. (setMeshVertex, single-vertex reads and writes)

Describe the solution you propose.

Add events to the API calls (after rough input validation).
Big upside of using names in the API calls is that we can now directly use them to name the events:

Example for readData: Event e{fmt::format("readData.{}_{}", meshName, dataName)};

Describe alternatives you've considered

Only profile internals. The API layer is mostly pretty cheap and non-allocating.

For example: readData can be a copy if the t exists, a copy if we extrapolate, or an expensive BSpline interpolation with possible computation. The interpolation and the computation are more interesting measurements than the API itself.

Additional context

The user can also be the author of bindings, who may want to profile extra functionality e.g. in readData.
I had to manually add these events for precice/python-bindings#202

The attached trace-v3.json of this discourse post contains some of these events.

@fsimonis fsimonis added the enhancement A new feature, a new functionality of preCICE (from user perspective) label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature, a new functionality of preCICE (from user perspective)
Projects
None yet
Development

No branches or pull requests

1 participant