diff --git a/hysop/backend/host/python/operator/custom.py b/hysop/backend/host/python/operator/custom.py index 25f8f48fbdeaccf6e8bc276d714aa7bc93076cf8..7c756e89a1a08f00d9da581bd276d5a44d943665 100644 --- a/hysop/backend/host/python/operator/custom.py +++ b/hysop/backend/host/python/operator/custom.py @@ -57,7 +57,9 @@ class PythonCustomOperator(HostOperator): if not it[1] is None: is_input, (field, td, req) = it min_ghosts = (max(g, self._ghosts) for g in req.min_ghosts.copy()) + max_ghosts = (min(g, self._ghosts) for g in req.max_ghosts.copy()) req.min_ghosts = min_ghosts + req.max_ghosts = max_ghosts return requirements @debug diff --git a/hysop/simulation.py b/hysop/simulation.py index 817b72e413efe8e85e87213a4c7b6df7d17397f0..9c5eb491ba01b088768e8cfad5e11401d86f1bf9 100644 --- a/hysop/simulation.py +++ b/hysop/simulation.py @@ -224,16 +224,17 @@ class Simulation(object): for (io_params, params, kwds) in self._parameters_to_write: if self.mpi_params.rank == io_params.io_leader: if (io_params.fileformat is IO.ASCII): - kwds = kwds.copy() - f = kwds.pop('file') - formatter = kwds.pop('formatter') - values = npw.asarray(tuple(map(lambda x: x.item() if x.size == 1 else x, - (p() for p in params)))) - values = npw.array2string(values, max_line_width=npw.inf, - formatter=formatter, legacy='1.13', **kwds) - values = '\n'+values[1:-1] - f.write(values) - f.flush() + if ((self.current_iteration % io_params.frequency) == 0): + kwds = kwds.copy() + f = kwds.pop('file') + formatter = kwds.pop('formatter') + values = npw.asarray(tuple(map(lambda x: x.item() if x.size == 1 else x, + (p() for p in params)))) + values = npw.array2string(values, max_line_width=npw.inf, + formatter=formatter, legacy='1.13', **kwds) + values = '\n'+values[1:-1] + f.write(values) + f.flush() else: msg = 'Unknown format {}.'.format(fileformat) raise ValueError(msg)