Skip to content

Conversation

@reneSchm
Copy link
Member

@reneSchm reneSchm commented Jan 9, 2025

Changes and Information

Please briefly list the changes (main added features, changed items, or corrected bugs) made:

  • Update to C++20
  • Add a framework with an thread safe Timer.
  • Used via ScopedTimer, it should guarantee that the timers use the correct thread.
  • Timers are aggregated via TimeRegistrar, and can be evaluated.

If need be, add additional information and what the reviewer should look out for in particular:

  • What is missing from the framework:
    • A way to disable timers. Disabling during runtime is intentionally not implemented, as it creates some overhead for start/stop methods. A compile time disable could be implemented using e.g. the Tag.
    • CPU timers. The current impl. only supports wall clock (std::steady_clock or omp_get_wtime).
    • Instancing the same Timer multiple times. This is a deliberate trade-off, as using static thread_local Timers enables thread safety and using the CT map.
  • Please check the naming. In particular, an alternative for ScopedTimer would be AutoTimer, as the prefix "auto" is somewhat commonly used to describe classes that use their lifetime as switch on/off (e.g. auto_mutex). Also the TimerRegistrar could perhaps use a new name.

Merge Request - Guideline Checklist

Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.

Checks by code author

  • Every addressed issue is linked (use the "Closes #ISSUE" keyword below)
  • New code adheres to coding guidelines
  • No large data files have been added (files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • Tests are added for new functionality and a local test run was successful (with and without OpenMP)
  • Appropriate documentation for new functionality has been added (Doxygen in the code and Markdown files if necessary)
  • Proper attention to licenses, especially no new third-party software with conflicting license has been added
  • (For ABM development) Checked benchmark results and ran and posted a local test above from before and after development to ensure performance is monitored.

Checks by code reviewer(s)

  • Corresponding issue(s) is/are linked and addressed
  • Code is clean of development artifacts (no deactivated or commented code lines, no debugging printouts, etc.)
  • Appropriate unit tests have been added, CI passes, code coverage and performance is acceptable (did not decrease)
  • No large data files added in the whole history of commits(files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • On merge, add 2-5 lines with the changes (main added features, changed items, or corrected bugs) to the merge-commit-message. This can be taken from the briefly-list-the-changes above (best case) or the separate commit messages (worst case).

Closes #17

@reneSchm reneSchm changed the title Timing framework 17 Timing framework Jan 9, 2025
@reneSchm reneSchm force-pushed the 17-time-measurement branch from 964bf5d to 3ca277c Compare March 17, 2025 12:58
@reneSchm reneSchm marked this pull request as ready for review April 29, 2025 14:52
@codecov
Copy link

codecov bot commented May 8, 2025

Codecov Report

Attention: Patch coverage is 98.76543% with 3 lines in your changes missing coverage. Please review.

Project coverage is 97.20%. Comparing base (febb82d) to head (9d0ff65).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
cpp/memilio/timer/timer_registrar.h 92.30% 2 Missing ⚠️
cpp/memilio/utils/logging.h 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1179      +/-   ##
==========================================
- Coverage   97.21%   97.20%   -0.02%     
==========================================
  Files         156      167      +11     
  Lines       14674    14915     +241     
==========================================
+ Hits        14266    14498     +232     
- Misses        408      417       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@HenrZu HenrZu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is incredibly good and well structured. I only have one comment in the BasicTimer. Otherwise, i have read through the whole doc and found a few typos. The doc helped a lot to understand the structure. Great work :)

A readme in the time dir would be helpful. Tests and Readthedocs documentation is also missing (as you said before :) )

@reneSchm reneSchm requested a review from HenrZu May 15, 2025 10:45
@reneSchm reneSchm self-assigned this May 15, 2025
Copy link
Contributor

@HenrZu HenrZu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great :) Only short comments/suggestions.

I'm still unsure about the namespace, which is better :D But we should keep it consistent. So either we name the directory in timing, or the namespace in mio::time.

@HenrZu HenrZu linked an issue May 21, 2025 that may be closed by this pull request
2 tasks
@HenrZu
Copy link
Contributor

HenrZu commented May 21, 2025

i just linked the issue for the bump of the c++ version. Could you also update the c++ version here:

  • docs/source/development.rst
  • pycode/memilio-generation/memilio/generation/ast.py

reneSchm and others added 3 commits May 22, 2025 12:48
@reneSchm reneSchm requested a review from HenrZu May 22, 2025 14:26
@reneSchm reneSchm merged commit c97abeb into main May 26, 2025
56 of 57 checks passed
@reneSchm reneSchm deleted the 17-time-measurement branch May 26, 2025 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bump C++ standard from 17 to 20 Time measurement

3 participants