-
Notifications
You must be signed in to change notification settings - Fork 48
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
Bug Fix: Checkpoint file size #528
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rationale makes sense to me, but I have a question about the implementation, see above.
src/IO/Parallel_IO.F90
Outdated
@@ -1573,6 +1574,11 @@ Subroutine Write_Data(self,disp,file_unit,filename) | |||
If (present(filename)) Then | |||
! The file is not open. We must create it. | |||
If (self%output_rank) Then | |||
If (present(clear_existing)) Then | |||
If (clear_existing) Then | |||
Call MPI_File_delete(filename, MPI_INFO_NULL, ierr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you are currently doing this unconditionally no matter if the file is present or not. Can MPI_File_delete handle the case if the file is not present? Or is it only called if the file exists and I missed the place where that is checked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed this might be easier if you call MPI_FILE_set_size(funit, 0, ierr)
after the call to MPI_FILE_OPEN
, this would avoid the case where you dont know if the file already exists (because MPI_FILE_OPEN
just created it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to go now, thanks for making the change. Feel free to merge at any time when you are comfortable with the tests on Pleiades.
OK, this looks good and fixes the bug I was encountering. |
This fixes a bug in Rayleigh where a checkpoint file can appear to be too large if the file existed and was overwritten in a subsequent run with lower resolution. This PR ensures that the file is deleted before being written to, preventing this bug.