Skip to content

Do not print file headers when restarting#106

Merged
danielhollas merged 3 commits intomasterfrom
file-headers
Apr 3, 2022
Merged

Do not print file headers when restarting#106
danielhollas merged 3 commits intomasterfrom
file-headers

Conversation

@danielhollas
Copy link
Copy Markdown
Contributor

Aside from being nicer, this will also enable to more easily test that we get the same results when restarting.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 1, 2022

Codecov Report

Merging #106 (6851dec) into master (183ddcd) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #106      +/-   ##
==========================================
+ Coverage   87.10%   87.13%   +0.02%     
==========================================
  Files          41       41              
  Lines        5793     5805      +12     
==========================================
+ Hits         5046     5058      +12     
  Misses        747      747              
Impacted Files Coverage Δ
src/init.F90 70.15% <ø> (ø)
src/tera_mpi_api.F90 99.40% <ø> (ø)
src/utils.F90 100.00% <ø> (ø)
src/vinit.F90 97.72% <ø> (ø)
src/files.F90 99.27% <100.00%> (+0.06%) ⬆️

@danielhollas danielhollas requested a review from suchanj April 1, 2022 18:04
@suchanj
Copy link
Copy Markdown
Contributor

suchanj commented Apr 3, 2022

Well I did not mind having the headers there to remind me restart was needed. However with properly functioning code they should not be needed so feel free to go ahead.

@danielhollas danielhollas merged commit 45a1689 into master Apr 3, 2022
@danielhollas danielhollas deleted the file-headers branch April 3, 2022 19:28
@danielhollas
Copy link
Copy Markdown
Contributor Author

@suchanj good point, that was also a reason why I didn't mind them. This commit makes it easier to process the files, since one can just skip the first line, and don't worry about anything extra. But my main motivation here was for tests.

Specifically, I wanted to be able to easily test whether restarted simulation gives the same result as the continuous simulation. Now I can do something like this:

mv tests/CMD/intput.in2 tests/MORSE/intput.in
sed -i 's/irest=1/irest=0/' tests/MORSE/input.in && rm tests//restart.xyz.*.ref
make test TEST=MORSE

and see whether the test passes. Previously the extra header lines would mess that up.
I already previously noticed a small issue with SH restart, will open an issue and fix next week.

Nevertheless, with the refactor done here we can easily go back if we want.

@danielhollas danielhollas restored the file-headers branch April 5, 2022 21:54
@danielhollas danielhollas deleted the file-headers branch April 5, 2022 21:55
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.

2 participants