geodynamics / Rayleigh

Rayleigh: Pseudo-spectral MHD
GNU General Public License v3.0
59 stars 48 forks source link

IO Bug Fix #510

Closed feathern closed 2 months ago

feathern commented 2 months ago

This fixes a subtle bug in Rayleigh. When opening a file for parallel I/O, Rayleigh records the error code. It was intended that if a nonzero error code was found, so that the file_open variable remained false, no subsequent file operations would be performed. A check on the file_open variable was missing, however, for everything but the operations related to writing the file header data. This PR fixes this bug.

I've been emailing with @illorenzo7 and the NASA HECC staff about this already today, so I'm assigning the review to him.

-Nick

p.s. I also removed a commented line of debugging code.

feathern commented 2 months ago

It's not actually the same conditional. One is (responsible and file_open), while the other is just (file_open). The "responsible" node writes the header information (timestep, time, record number) for the record, so we don't want all processors doing it. Also, I'm really just trying to patch something problematic quickly right now -- we need to work on various aspects of this at the hackathon (such as the 'wait' feature we discussed). -Nick