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

Logger + Timer updates #133

Merged
merged 26 commits into from
Nov 26, 2024
Merged

Logger + Timer updates #133

merged 26 commits into from
Nov 26, 2024

Conversation

Simkern
Copy link
Collaborator

@Simkern Simkern commented Nov 25, 2024

  • Added an optional output to logger_setup to return the file identifier of the created logfile.
  • Added an optional input to logger_setup which closes previously opened logfiles if present, allowing finer logfile control for more complicated applications. The default behaviour of logger_setup is now that all open logfiles are removed from the active list and closed (with the exception of stdout).
  • Created and deployed a timing module for Lightkrylov: Lightkrylov_timing.
    • lightkrylov_timer : The fundamental timer type that records the cpu time. Referenced by name.
    • abstract_watch: Abstract type that gathers all the individual timers throughout the toolbox and centralizes manipulation. Includes functionalities to add and remove timers, start, stop, pause and reset each timer by name. The extended type requires only definitions for the initalization (choose default timers and private elements) and finalization (compute averages and print results).
    • lightkrylov_watch: Global timer interface for lightkrylov, extends abstract_watch.
    • Timings are only recorded if the global timer is initialized. This creates a private list of timers for all major subroutines by name and subsequently triggers timing when they are called throughout the toolbox. The internal system timers are gathered into sections by source file for convenience and cannot be removed by the user.
    • Using a finalization routine, the timing information for all routines that were called during execution is presented.
    • The user has the possibility to add their own timers, again referenced by name, that will also be displayed at finalization.
    • The module lightkrylov_timing exposes the global timer object global_lightkrylov_logger.
  • Added default timers for the basic abstract types of lightkrylov:
    • abstract_linop: 2 timers, matvec_timer and rmatvec_timer for direct and adjoint matvec calls. The timing is automatically triggered in the matvec wrapper.
    • abstract_system: eval_timer for the time for the residual evaluation. The timing is automatically triggered in the eval wrapper.

@Simkern Simkern requested a review from loiseaujc November 25, 2024 15:07
@loiseaujc loiseaujc merged commit 6e11b8b into dev Nov 26, 2024
12 checks passed
@loiseaujc loiseaujc deleted the logger_timing_update branch November 26, 2024 10:01
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.

2 participants