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

Minor modifications to Monio::readState for HofX #29

Merged
merged 6 commits into from
Jan 5, 2024

Conversation

phlndrwd
Copy link
Collaborator

@phlndrwd phlndrwd commented Nov 30, 2023

In HofX tests there is a current need to pre-allocate fields that do not exist in the model, but which are populated as part of a variable transformation process. This use-case had not previously been tested in this version of MONIO and has indicated the need to check for fields that are not available in the state file. This PR introduces that check, and generates a warning message if reading is skipped.

Test outputs in MONIO, and with LFRic-Lite and LFRic-JEDI (on feature/hofx_io_compare): http://fcm1/cylc-review/taskjobs/punderwo/?suite=hofx_io_comapare_02

…ot previously been approached with Monio directly before current work in LFRic-JEDI.
Copy link
Contributor

@mo-joshuacolclough mo-joshuacolclough left a comment

Choose a reason for hiding this comment

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

Looks good!

@DJDavies2
Copy link
Contributor

This isn't building on EXZ:

/home/h01/david.davies/cylc-run/monio-29/share/mo-bundle/monio/src/monio/Utils.cc: In function 'std::string monio::utils::exec(const std::string&)':
/home/h01/david.davies/cylc-run/monio-29/share/mo-bundle/monio/src/monio/Utils.cc:64:25: error: aggregate 'std::array<char, 128> buffer' has incomplete type and cannot be defined
64 | std::array<char, 128> buffer;
| ^~~~~~
gmake[2]: *** [monio/src/CMakeFiles/monio.dir/build.make:300: monio/src/CMakeFiles/monio.dir/monio/Utils.cc.o] Error 1

@DJDavies2
Copy link
Contributor

DJDavies2 commented Dec 13, 2023

Maybe add

#include <array>

?

@DJDavies2
Copy link
Contributor

Maybe add

#include

?

I'm completely lost; I am trying to write #include <array>, but it won't show the <array>

@phlndrwd
Copy link
Collaborator Author

phlndrwd commented Dec 13, 2023

This isn't building on EXZ:

/home/h01/david.davies/cylc-run/monio-29/share/mo-bundle/monio/src/monio/Utils.cc: In function 'std::string monio::utils::exec(const std::string&)': /home/h01/david.davies/cylc-run/monio-29/share/mo-bundle/monio/src/monio/Utils.cc:64:25: error: aggregate 'std::array<char, 128> buffer' has incomplete type and cannot be defined 64 | std::array<char, 128> buffer; | ^~~~~~ gmake[2]: *** [monio/src/CMakeFiles/monio.dir/build.make:300: monio/src/CMakeFiles/monio.dir/monio/Utils.cc.o] Error 1

Thanks @DJDavies2. Your suggestion is valid from a code linting perspective, but I'm very confused why this would cause a build issue! I've added the include now. I'd be interested to know if it builds now.

@DJDavies2
Copy link
Contributor

If you want to use std::array you need to #include <array>. The real question is why it does compile on other platforms; probably because <array> is included via some other header but there is a different version of libstdc++ on the EXZ. I don't think it is standard conforming to rely on including headers indirectly from other standard library headers, the only reliable thing is to include the header where it is used.

@phlndrwd phlndrwd merged commit e406a1b into develop Jan 5, 2024
4 checks passed
@phlndrwd phlndrwd deleted the feature/hofx_io_compare branch January 5, 2024 14:14
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.

3 participants