Skip to content

Conversation

bartgol
Copy link
Contributor

@bartgol bartgol commented Jul 16, 2025

Fix a template overload resolution. Also, add possibility to generate ASCII baselines (for debug purposes only).

[BFB]


Note: the ASCII baselines are NOT to be used for baselines comparison, as we inevitably truncate periodic numbers, causing diffs when they are re-read in. They are just meant to be used for visually inspecting the baselines. For instance, it allowed me to see that one entry was in hex format rather than an integer, which allowed me to spot a bug (where a pointer instead of the pointed value was written).

@bartgol bartgol requested a review from jgfouca July 16, 2025 18:04
@bartgol bartgol self-assigned this Jul 16, 2025
@bartgol bartgol added bug fix PR BFB PR leaves answers BFB EAMxx Issues related to EAMxx labels Jul 16, 2025

template <typename T, typename I>
std::enable_if_t<std::is_integral<I>::value>
write_scalars(std::ofstream& ofile, const T* const data, I N) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The const was preventing the compile to pick this overload for a T=double*. Instead, it picked the variadic template overload below, effectively writing a pointer and an int, rather than an array of T.

The const is also not needed, as the new signature covers it with T=const double.

@bartgol
Copy link
Contributor Author

bartgol commented Jul 16, 2025

The standalone failures are expected (we need to merge the PR and regenerate baselines), while the v1 failures are likely due to #7412 that was merged yesterday. I fired the baseline regen job for v1 tests, and I will re-run the v1 tests for this PR, just to be sure. If all is good, I will merge.

bartgol added a commit that referenced this pull request Jul 16, 2025
…(PR #7524)

Fix a template overload resolution. Also, add possibility
to generate ASCII baselines (for debug purposes only).

[BFB]
@bartgol bartgol merged commit 6529e7f into master Jul 16, 2025
12 of 23 checks passed
@bartgol bartgol deleted the bartgol/eamxx/fix-physics-baselines-writing branch July 16, 2025 23:34
bartgol added a commit that referenced this pull request Jul 17, 2025
bartgol added a commit that referenced this pull request Jul 17, 2025
Similar to p3_run_and_cmp as done in #7524

[BFB]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BFB PR leaves answers BFB bug fix PR EAMxx Issues related to EAMxx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants