-
Notifications
You must be signed in to change notification settings - Fork 33
Add slic macros that log once per call site #1831
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
Merged
+1,220
−762
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
356d790
Reduce code duplication across slic macros
bmhan12 695690d
Reduce code duplication for slic_macros test
bmhan12 6a02d68
Add SLIC_WARNING_*_ONCE macros
bmhan12 c26ff2b
Add SLIC_INFO_*_ONCE macros
bmhan12 34d861b
Add SLIC_DEBUG_*_ONCE macros; additional slic_macros test refactoring
bmhan12 d0fce67
Add additional test
bmhan12 d599b9d
Fix slic once logic, add more tests to verify behavior
bmhan12 2a3887f
Reduce code duplication for slic_macros_parallel; SCOPED_TRACE for fa…
bmhan12 625ea7b
release fixes
bmhan12 4ad8d8c
not pretty - turn clang-format on/off to keep __LINE__ as expected
bmhan12 fe4dbb5
Got a ONCE unit test working for slic_macros_parallel
bmhan12 ada5e6f
Add SLIC_*_ONCE tests to slic_macros_parallel; correct two call-site …
bmhan12 33bc5de
fix unused for release builds
bmhan12 bcbb29c
Update docs
bmhan12 db812a9
update note
bmhan12 530fbf3
List of lists formatting
bmhan12 d772001
Add SLIC_*_CONTAINER macro to table
bmhan12 e7340f4
Merge branch 'develop' into feature/han12/slic_once
bmhan12 dcfd1c0
Merge branch 'develop' into feature/han12/slic_once
bmhan12 2f48c1c
Keep do-while
bmhan12 c66c22f
Merge branch 'develop' into feature/han12/slic_once
bmhan12 575d98b
fix note
bmhan12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,38 +111,76 @@ functions are called. | |
|
|
||
| The table below details the built-in SLIC macros as well as some notes about when they are collective calls: | ||
|
|
||
| +----------------------------+------------------------------------------------+----------------------------------------------------------------------------+ | ||
| | Macro | Availability | Collective status | | ||
| +============================+================================================+============================================================================+ | ||
| | | ``SLIC_ASSERT`` | | Only available in debug configurations | | Collective by default. | | ||
| | | ``SLIC_ASSERT_MSG`` | | (i.e. when `AXOM_DEBUG` is defined). | | Collective after calling ``slic::enableAbortOnError()``. | | ||
| | | | | Not available in device code. | | No longer collective after calling ``slic::disableAbortOnError()``. | | ||
| +----------------------------+------------------------------------------------+----------------------------------------------------------------------------+ | ||
| | | ``SLIC_CHECK`` | | Only available in debug configurations | | Not collective by default. | | ||
| | | ``SLIC_CHECK_MSG`` | | (i.e. when `AXOM_DEBUG` is defined). | | Collective after ``slic::debug::checksAreErrors`` is set to ``true``, | | ||
| | | | | Not available in device code. | | defaults to ``false``. | | ||
| +----------------------------+------------------------------------------------+----------------------------------------------------------------------------+ | ||
| | | ``SLIC_DEBUG`` | | Only available in debug configurations | | Never | | ||
| | | ``SLIC_DEBUG_IF`` | | (i.e. when `AXOM_DEBUG` is defined) | | | | ||
| | | ``SLIC_DEBUG_ROOT`` | | | | | | ||
| | | ``SLIC_DEBUG_ROOT_IF`` | | | | | | ||
| +----------------------------+------------------------------------------------+----------------------------------------------------------------------------+ | ||
| | | ``SLIC_INFO`` | | Always | | Never | | ||
| | | ``SLIC_INFO_IF`` | | | | | | ||
| | | ``SLIC_INFO_ROOT`` | | | | | | ||
| | | ``SLIC_INFO_ROOT_IF`` | | | | | | ||
| | | ``SLIC_INFO_TAGGED`` | | | | | | ||
| +----------------------------+------------------------------------------------+----------------------------------------------------------------------------+ | ||
| | | ``SLIC_ERROR`` | | Always | | Collective by default. | | ||
| | | ``SLIC_ERROR_IF`` | | | | Collective after calling ``slic::enableAbortOnError()``. | | ||
| | | ``SLIC_ERROR_ROOT`` | | | | No longer collective after calling ``slic::disableAbortOnError()`` | | ||
| | | ``SLIC_ERROR_ROOT_IF`` | | | | | | ||
| +----------------------------+------------------------------------------------+----------------------------------------------------------------------------+ | ||
| | | ``SLIC_WARNING`` | | Always | | Not collective by default. | | ||
| | | ``SLIC_WARNING_IF`` | | | | Collective after calling ``slic::enableAbortOnWarning()``. | | ||
| | | ``SLIC_WARNING_ROOT`` | | | | No longer collective after calling ``slic::disableAbortOnWarning()`` | | ||
| | | ``SLIC_WARNING_ROOT_IF`` | | | | | | ||
| +----------------------------+------------------------------------------------+----------------------------------------------------------------------------+ | ||
| .. list-table:: SLIC macro availability and collective behavior | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bmhan12 thank you for this. Much better way to make a table in sphinx -- avoid lining up all the characters across rows and columns 🥇 |
||
| :header-rows: 1 | ||
| :widths: 28 34 38 | ||
|
|
||
| * - Macro | ||
| - Availability | ||
| - Collective status | ||
|
|
||
| * - ``SLIC_ASSERT`` | ||
| ``SLIC_ASSERT_MSG`` | ||
| - - Only available in debug configurations (i.e. when ``AXOM_DEBUG`` is defined) | ||
| - Not available in device code | ||
| - - Collective by default | ||
| - Collective after calling ``slic::enableAbortOnError()`` | ||
| - No longer collective after calling ``slic::disableAbortOnError()`` | ||
|
|
||
| * - ``SLIC_CHECK`` | ||
| ``SLIC_CHECK_MSG`` | ||
| - - Only available in debug configurations (i.e. when ``AXOM_DEBUG`` is defined) | ||
| - Not available in device code | ||
| - - Not collective by default | ||
| - Collective after ``slic::debug::checksAreErrors`` is set to ``true``, defaults to ``false`` | ||
|
|
||
| * - ``SLIC_DEBUG`` | ||
| ``SLIC_DEBUG_IF`` | ||
| ``SLIC_DEBUG_ROOT`` | ||
| ``SLIC_DEBUG_ROOT_IF`` | ||
| ``SLIC_DEBUG_PRINT_CONTAINER`` | ||
| ``SLIC_DEBUG_ONCE`` | ||
| ``SLIC_DEBUG_IF_ONCE`` | ||
| ``SLIC_DEBUG_ROOT_ONCE`` | ||
| ``SLIC_DEBUG_ROOT_IF_ONCE`` | ||
| ``SLIC_DEBUG_PRINT_CONTAINER_ONCE`` | ||
| - - Only available in debug configurations (i.e. when ``AXOM_DEBUG`` is defined) | ||
| - - Never | ||
|
|
||
| * - ``SLIC_INFO`` | ||
| ``SLIC_INFO_IF`` | ||
| ``SLIC_INFO_ROOT`` | ||
| ``SLIC_INFO_ROOT_IF`` | ||
| ``SLIC_INFO_TAGGED`` | ||
| ``SLIC_INFO_ONCE`` | ||
| ``SLIC_INFO_IF_ONCE`` | ||
| ``SLIC_INFO_ROOT_ONCE`` | ||
| ``SLIC_INFO_ROOT_IF_ONCE`` | ||
| ``SLIC_INFO_TAGGED_ONCE`` | ||
| - - Always | ||
| - - Never | ||
|
|
||
| * - ``SLIC_ERROR`` | ||
| ``SLIC_ERROR_IF`` | ||
| ``SLIC_ERROR_ROOT`` | ||
| ``SLIC_ERROR_ROOT_IF`` | ||
| - - Always | ||
| - - Collective by default | ||
| - Collective after calling ``slic::enableAbortOnError()`` | ||
| - No longer collective after calling ``slic::disableAbortOnError()`` | ||
|
|
||
| * - ``SLIC_WARNING`` | ||
| ``SLIC_WARNING_IF`` | ||
| ``SLIC_WARNING_ROOT`` | ||
| ``SLIC_WARNING_ROOT_IF`` | ||
| ``SLIC_WARNING_ONCE`` | ||
| ``SLIC_WARNING_IF_ONCE`` | ||
| ``SLIC_WARNING_ROOT_ONCE`` | ||
| ``SLIC_WARNING_ROOT_IF_ONCE`` | ||
| - - Always | ||
| - - Not collective by default | ||
| - Collective after calling ``slic::enableAbortOnWarning()`` | ||
| - No longer collective after calling ``slic::disableAbortOnWarning()`` | ||
|
|
||
| Doxygen generated API documentation on Macros can be found here: `SLIC Macros <../../../../../doxygen/html/slic__macros_8hpp.html>`_ | ||
|
|
||
|
|
@@ -157,6 +195,7 @@ Consider the following rules of thumb when choosing from the above logging macro | |
| (i.e. their messages will not get logged), while `SLIC_INFO` macros are always available. | ||
| * The `SLIC_*_ROOT` variants can help reduce logging verbosity when called in an MPI application, especially if all | ||
| MPI ranks are expected to have the same data (for example, if a value was broadcast from one rank to all the other ranks). | ||
| * The `SLIC_*_ONCE` variants can help reduce logging verbosity when only the first invocation at a call-site is necessary. | ||
|
|
||
|
|
||
| .. ############################################################################# | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.