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

Feature: Logging Updates #501

Open
wants to merge 160 commits into
base: develop
Choose a base branch
from
Open

Feature: Logging Updates #501

wants to merge 160 commits into from

Conversation

gardner48
Copy link
Member

Follow on to utilities added in #499

  • Make info logging output in the integrators more consistent
  • Update parser for MRI methods
  • Add function to extract lists of data for plotting
  • Add example scripts using log parser

@balos1
Copy link
Member

balos1 commented Jun 10, 2024

Checkout https://github.com/LLNL/sundials/blob/feature/nls-switching-v7-gs/src/sundials/sundials_logger_impl.h#L35. Now that we have C99 we can change all the logging statements in the code to use a variadic macro and it makes the logging statements much cleaner and gets rid of the repetitive preprocessor checks. My intent was to bring this over from that branch. I can do that here if you think it looks good.

@gardner48
Copy link
Member Author

Checkout https://github.com/LLNL/sundials/blob/feature/nls-switching-v7-gs/src/sundials/sundials_logger_impl.h#L35. Now that we have C99 we can change all the logging statements in the code to use a variadic macro and it makes the logging statements much cleaner and gets rid of the repetitive preprocessor checks. My intent was to bring this over from that branch. I can do that here if you think it looks good.

I was going to ask if you still had the variadic macros from the original logging implementation on another branch. I think switching over to those would be great.

It would also be nice to have an "If" version of the macros i.e., something like SUNLogInfoIf that takes an additional boolean input to change cases like

#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO
      if (kflag != ARK_SUCCESS)
      {
        SUNLogInfo(ARK_LOGGER, __func__, "end-step-attempt", "status = failed solve, kflag = %i", kflag);
      }
#endif

into something like

SUNLogInfoIf(kflag != ARK_SUCCESS, ARK_LOGGER __func__, "end-step-attempt", "status = failed solve, kflag = %i", kflag);

@balos1
Copy link
Member

balos1 commented Jun 13, 2024

@gardner48 The "if" version sounds like a nice addition as well.

Steven-Roberts
Steven-Roberts previously approved these changes Oct 15, 2024
Copy link
Collaborator

@drreynolds drreynolds left a comment

Choose a reason for hiding this comment

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

This looks great; I provided a few suggestions for minor typos, but otherwise this can be approved.

doc/shared/sundials/Logging.rst Outdated Show resolved Hide resolved
doc/shared/sundials/Logging.rst Outdated Show resolved Hide resolved
Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu>
@gardner48 gardner48 mentioned this pull request Oct 18, 2024
Copy link
Member

@balos1 balos1 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. Just a couple quick fixes needed.

test/unit_tests/problems/kpr.hpp Outdated Show resolved Hide resolved
balos1
balos1 previously approved these changes Oct 22, 2024
gardner48 added a commit to sundials-codes/answers that referenced this pull request Oct 22, 2024
drreynolds
drreynolds previously approved these changes Oct 29, 2024
test/unit_tests/ida/CXX_serial/ida_test_kpr.cpp Outdated Show resolved Hide resolved
test/unit_tests/idas/CXX_serial/idas_test_kpr.cpp Outdated Show resolved Hide resolved
Fix typos in comments

Co-authored-by: Cody Balos <balos1@llnl.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants