How to read xdmf file in paraview if the program collapsed?

Hello!

I am writing results into xdmf file in every tilmestep. I noteiced that if I break down the program when it is running, paraview cannot read the result, even if some results have been written.

I mean the program may stop before the final time step, how to visualize the results which have been calculated?

Does this happen even when using the XDMFFile with its context manager? E.g.

# Some code...

with dolfinx.io.XDMFFile(comm, "file.xdmf", "w") as f:
    # do things with f

# resume other code