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

Remove Eigen functionality for matrices. #731

Merged
merged 1 commit into from
May 12, 2023
Merged

Conversation

1uc
Copy link
Collaborator

@1uc 1uc commented Apr 19, 2023

HighFive hasn't been respecting that Eigen uses Fortran order, as a result it's been writing Eigen::Matrix to file as if the data were C order. It's been consistently reading datasets back into Eigen::Matrix has if it already was in Fortran order.

This error is symmetric, i.e., if one writes an Eigen::Matrix to disk via core HighFive and then reads that dataset back into an Eigen::Matrix the outcome is correct (which has been check in CI).

More information can be found at:
#532

HighFive hasn't been respecting that Eigen uses Fortran order, as a
result it's been writing `Eigen::Matrix` to file as if the data were C
order. It's been consistently reading datasets back into `Eigen::Matrix`
has if it already was in Fortran order.

This error is symmetric, i.e., if one writes an `Eigen::Matrix` to disk
via core HighFive and then reads that dataset back into an
`Eigen::Matrix` the outcome is correct (which has been check in CI).

More information can be found at:
#532
@1uc 1uc force-pushed the remove-core-eigen branch from 60386eb to c6fa2ec Compare April 19, 2023 19:47
@codecov
Copy link

codecov bot commented Apr 19, 2023

Codecov Report

Merging #731 (c6fa2ec) into master (be68bd0) will increase coverage by 0.26%.
The diff coverage is 93.33%.

@@            Coverage Diff             @@
##           master     #731      +/-   ##
==========================================
+ Coverage   82.43%   82.70%   +0.26%     
==========================================
  Files          67       66       -1     
  Lines        4514     4515       +1     
==========================================
+ Hits         3721     3734      +13     
+ Misses        793      781      -12     
Impacted Files Coverage Δ
include/highfive/bits/H5Converter_misc.hpp 86.64% <90.00%> (+0.80%) ⬆️
tests/unit/tests_high_five_base.cpp 99.66% <100.00%> (ø)

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

@1uc 1uc marked this pull request as ready for review April 19, 2023 20:13
@pramodk pramodk requested a review from alkino April 19, 2023 20:24
Comment on lines +632 to +633
"HighFive has been broken for Eigen::Matrix. Please check "
"https://github.com/BlueBrain/HighFive/issues/532.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"HighFive has been broken for Eigen::Matrix. Please check "
"https://github.com/BlueBrain/HighFive/issues/532.");
"HighFive has been broken for Eigen::Matrix. "
"Please use H5Easy or open a PR. See "
"https://github.com/BlueBrain/HighFive/issues/532.");

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's unfortunately not that simple. Just switching to H5Easy isn't going to fix the issue of existing files. The point of breaking this is to make people check the ticket so that they understand how they're affected by this issue.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You could say "Please use H5Easy to write NEW data. Note that old data may be 'corrupted'"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure I understand what you want to achieve by suggestion H5Easy as an alternative, it's not a drop in replacement (Vectors serialized from core are 2D; while Easy strips the singleton dimension).

I would like the message to read that they need to go read a full length piece of text; and then figure out how this affects them.

The point is to end the indecision.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's fine, you can keep what you had.

// and write it to a file
int main(void) {
try {
Eigen::MatrixXd matrix(nrows, ncols);
Copy link
Collaborator

Choose a reason for hiding this comment

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

In stead of removing, you could use a row-major example for the moment. We can then revert one someone had the time to fix HighFive

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, git revert works quite well. I don't want there to be anything suggesting that reading or writing Eigen::Matrix from core HighFive is sensible.

const int ncols = 3;

try {
Eigen::MatrixXd mat(nrows, ncols);
Copy link
Collaborator

Choose a reason for hiding this comment

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

See other example

dset.write(mat);

Eigen::MatrixXd result;
dset.read(result);
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would always be good to add an assertion

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think I understand. What should be asserted here? This is an example we presented in a poster as PASC.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a detail that caught my eye. I just wanted to say just to make sure that example never diverge an assertion would not have hurt ;). But indeed, never mind

@1uc
Copy link
Collaborator Author

1uc commented Apr 26, 2023

@tdegeus Thank you for your time and comments!

@alkino alkino merged commit 30acbaa into master May 12, 2023
@alkino alkino deleted the remove-core-eigen branch May 12, 2023 08:33
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.

3 participants