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

Fixes convergence/papi logger for distributed vectors #1147

Merged
merged 10 commits into from
Nov 3, 2022

Conversation

MarcelKoch
Copy link
Member

This PR fixes the use of the convergence and papi logger with distributed vector. The record logger is not affected by the addition of the distributed types. The stream logger requires significantly more effort to also enable it for distributed types and should probably better be handled in a new logger.

This can wait until #1133 is merged.

@MarcelKoch MarcelKoch self-assigned this Oct 19, 2022
@ginkgo-bot ginkgo-bot added mod:core This is related to the core module. reg:build This is related to the build system. reg:testing This is related to testing. labels Oct 19, 2022
@MarcelKoch MarcelKoch force-pushed the fix-residual-logging branch from ee5f7b4 to 8e173f9 Compare October 24, 2022 14:11
@MarcelKoch MarcelKoch changed the base branch from distributed-develop to fix-distmtx-create-from-linop October 24, 2022 14:12
@pratikvn
Copy link
Member

@MarcelKoch, I think this can also be included in the release ?

@MarcelKoch
Copy link
Member Author

@pratikvn Yes, but I didn't want to create more pressure with the release than there currently is.

Copy link
Member

@pratikvn pratikvn left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the fix.

@pratikvn
Copy link
Member

Yes, but I think this is simple enough to review and probably an important one to have to allow users to log convergence data, which is probably one of the most important thing that users care about when using the solvers.

@pratikvn pratikvn added 1:ST:ready-for-review This PR is ready for review 1:ST:high-importance This issue/PR is of high importance and must be addressed as soon as possible. type:logger This is related to the logger class. is:bugfix This fixes a bug labels Oct 25, 2022
std::is_const<T>::value,
const experimental::distributed::Vector<ValueType>,
experimental::distributed::Vector<ValueType>>;
f(dynamic_cast<type*>(linop), std::forward<Args>(args)...);
Copy link
Member

Choose a reason for hiding this comment

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

it should check whether dynamic_cast<type*>(linop) is a nullptr

Copy link
Member Author

Choose a reason for hiding this comment

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

Could you expand on that? I don't think any of the two branches makes sense in that case, so I could only throw. Is that your suggestion?

Copy link
Member

Choose a reason for hiding this comment

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

yes, it is. when the linop can not be the type, it will pass the nullptr and lead segmentation fault, I think

Copy link
Member

Choose a reason for hiding this comment

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

Agree with Mike here, there should be a check which throws if somehow the cast result is a nullptr. Users or other could use this function in completely unrelated contexts (T not distributed::Vector or anything like that).

@MarcelKoch MarcelKoch requested a review from yhmtsai October 31, 2022 13:18
Copy link
Member

@yhmtsai yhmtsai left a comment

Choose a reason for hiding this comment

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

LGTM. only need to throw the error when the type is incorrect

@MarcelKoch MarcelKoch force-pushed the fix-distmtx-create-from-linop branch 2 times, most recently from cf467ef to f3ff338 Compare November 1, 2022 21:26
Base automatically changed from fix-distmtx-create-from-linop to develop November 1, 2022 21:33
@MarcelKoch MarcelKoch force-pushed the fix-residual-logging branch from e612ebc to bf7be95 Compare November 1, 2022 21:37
@MarcelKoch
Copy link
Member Author

format!

@MarcelKoch MarcelKoch removed the 1:ST:ready-for-review This PR is ready for review label Nov 2, 2022
@MarcelKoch MarcelKoch added the 1:ST:ready-to-merge This PR is ready to merge. label Nov 2, 2022
std::is_const<T>::value,
const experimental::distributed::Vector<ValueType>,
experimental::distributed::Vector<ValueType>>;
f(dynamic_cast<type*>(linop), std::forward<Args>(args)...);
Copy link
Member

Choose a reason for hiding this comment

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

Agree with Mike here, there should be a check which throws if somehow the cast result is a nullptr. Users or other could use this function in completely unrelated contexts (T not distributed::Vector or anything like that).

- formatting
- fixes tests
- test for nullptr/wrong type

Co-authored-by: Yuhsiang M. Tsai <yhmtsai@gmail.com>
Co-authored-by: Terry Cojean <terry.cojean@kit.edu>
@MarcelKoch MarcelKoch force-pushed the fix-residual-logging branch from 61eed09 to 22523f6 Compare November 2, 2022 10:52
@MarcelKoch
Copy link
Member Author

format!

ginkgo-bot and others added 2 commits November 2, 2022 11:13
Co-authored-by: Marcel Koch <marcel.koch@kit.edu>
@ginkgo-bot
Copy link
Member

Note: This PR changes the Ginkgo ABI:

Functions changes summary: 0 Removed, 0 Changed, 4 Added functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

For details check the full ABI diff under Artifacts here

Copy link
Member

@tcojean tcojean left a comment

Choose a reason for hiding this comment

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

LGTM. From my side, I think this can be merged.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 3, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

50.0% 50.0% Coverage
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Base: 91.47% // Head: 91.57% // Increases project coverage by +0.09% 🎉

Coverage data is based on head (64f7458) compared to base (9242dd3).
Patch coverage: 93.50% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1147      +/-   ##
===========================================
+ Coverage    91.47%   91.57%   +0.09%     
===========================================
  Files          535      536       +1     
  Lines        46287    46308      +21     
===========================================
+ Hits         42343    42408      +65     
+ Misses        3944     3900      -44     
Impacted Files Coverage Δ
core/distributed/helpers.hpp 90.00% <66.66%> (-10.00%) ⬇️
core/test/log/convergence.cpp 90.90% <90.47%> (-9.10%) ⬇️
core/test/mpi/distributed/matrix.cpp 94.68% <96.29%> (+0.08%) ⬆️
core/log/convergence.cpp 100.00% <100.00%> (+4.54%) ⬆️
core/test/mpi/distributed/helpers.cpp 100.00% <100.00%> (ø)
include/ginkgo/core/distributed/matrix.hpp 85.00% <100.00%> (-1.96%) ⬇️
reference/base/index_set_kernels.cpp 94.20% <0.00%> (+0.08%) ⬆️
core/test/base/iterator_factory.cpp 100.00% <0.00%> (+32.43%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@MarcelKoch MarcelKoch merged commit a7d9574 into develop Nov 3, 2022
@MarcelKoch MarcelKoch deleted the fix-residual-logging branch November 3, 2022 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1:ST:high-importance This issue/PR is of high importance and must be addressed as soon as possible. 1:ST:ready-to-merge This PR is ready to merge. is:bugfix This fixes a bug mod:core This is related to the core module. reg:build This is related to the build system. reg:testing This is related to testing. type:logger This is related to the logger class.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants