From a014e6140daf99740d9a534ead1c2eda0eda8f9b Mon Sep 17 00:00:00 2001 From: Theo Steininger Date: Sun, 23 Jul 2017 01:29:05 +0200 Subject: [PATCH] Now, only rank==0 produces plotly plots. --- nifty/plotting/plotter/plotter_base.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/nifty/plotting/plotter/plotter_base.py b/nifty/plotting/plotter/plotter_base.py index 139cb2d5..16c2cfec 100644 --- a/nifty/plotting/plotter/plotter_base.py +++ b/nifty/plotting/plotter/plotter_base.py @@ -86,17 +86,20 @@ class PlotterBase(Loggable, object): for field in fields] # create plots - plots_list = [] - for slice_list in utilities.get_slice_list(data_list[0].shape, axes): - plots_list += \ - [[self.plot.at(self._parse_data(current_data, - field, - spaces)) - for (current_data, field) in zip(data_list, fields)]] - - figures = [self.figure.at(plots, title=title) for plots in plots_list] - - self._finalize_figure(figures, path=path) + if rank == 0: + plots_list = [] + for slice_list in utilities.get_slice_list(data_list[0].shape, + axes): + plots_list += \ + [[self.plot.at(self._parse_data(current_data, + field, + spaces)) + for (current_data, field) in zip(data_list, fields)]] + + figures = [self.figure.at(plots, title=title) + for plots in plots_list] + + self._finalize_figure(figures, path=path) def _get_data_from_field(self, field, spaces, data_extractor): for i, space_index in enumerate(spaces): -- GitLab