Skip to content

Commit 9bcb6f0

Browse files
committed
TL: mini fix for edge cases
1 parent 020dbdc commit 9bcb6f0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pySDC/helpers/fieldsIO.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,6 @@ def setHeader(self, nVar, coords):
417417
coords = self.setupCoords(*coords)
418418
self.header = {"nVar": int(nVar), "coords": coords}
419419
self.nItems = nVar * self.nDoF
420-
if self.MPI_ON:
421-
self.MPI_SETUP()
422420

423421
@property
424422
def hInfos(self):
@@ -573,6 +571,8 @@ def MPI_WRITE_AT_ALL(self, offset, data: np.ndarray):
573571
data : np.ndarray
574572
Data to be written in the binary file.
575573
"""
574+
if self.mpiType is None:
575+
self.MPI_SETUP()
576576
self.mpiFile.Set_view(disp=offset, etype=self.mpiType, filetype=self.mpiFileType)
577577
self.mpiFile.Write_all(data)
578578

@@ -588,6 +588,8 @@ def MPI_READ_AT_ALL(self, offset, data: np.ndarray):
588588
data : np.ndarray
589589
Array on which to read the data from the binary file.
590590
"""
591+
if self.mpiType is None:
592+
self.MPI_SETUP()
591593
self.mpiFile.Set_view(disp=offset, etype=self.mpiType, filetype=self.mpiFileType)
592594
self.mpiFile.Read_all(data)
593595

0 commit comments

Comments
 (0)