Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions pySDC/helpers/fieldsIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,6 @@ def setHeader(self, nVar, coords):
coords = self.setupCoords(*coords)
self.header = {"nVar": int(nVar), "coords": coords}
self.nItems = nVar * self.nDoF
if self.MPI_ON:
self.MPI_SETUP()

@property
def hInfos(self):
Expand All @@ -440,8 +438,6 @@ def readHeader(self, f):
gridSizes = np.fromfile(f, dtype=np.int32, count=dim)
coords = [np.fromfile(f, dtype=np.float64, count=n) for n in gridSizes]
self.setHeader(nVar, coords)
if self.MPI_ON:
self.MPI_SETUP()

def reshape(self, fields: np.ndarray):
"""Reshape the fields to a N-d array (inplace operation)"""
Expand Down Expand Up @@ -539,7 +535,7 @@ def MPI_ROOT(self):
return True
return self.comm.Get_rank() == 0

def MPI_SETUP(self):
def MPI_SETUP_FILETYPE(self):
"""Setup subarray masks for each processes"""
self.mpiType = MPI_DTYPE(self.dtype)
self.mpiFileType = self.mpiType.Create_subarray(
Expand All @@ -556,6 +552,8 @@ def MPI_FILE_OPEN(self, mode):
"a": MPI.MODE_WRONLY | MPI.MODE_APPEND,
}[mode]
self.mpiFile = MPI.File.Open(self.comm, self.fileName, amode)
if self.mpiType is None:
self.MPI_SETUP_FILETYPE()

def MPI_WRITE(self, data):
"""Write data (np.ndarray) in the binary file in MPI mode, at the current file cursor position."""
Expand Down
Loading