Skip to content

Commit 306696f

Browse files
committed
Fix ring diagnostic with mpi
1 parent c544828 commit 306696f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

orbit_tools/ring/diag.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def track(self, params_dict: dict) -> None:
162162
self.history["runtime"] = runtime
163163

164164
# Print update message
165-
if self.verbose and (self._mpi_rank == 0):
165+
if (self._mpi_rank == 0) and self.verbose:
166166
message = f"turn={self.turn:05.0f} t={runtime:0.3f} size={size:05.0f}"
167167
message = "{} xrms={:0.2f}".format(message, x_rms * 1000.0)
168168
message = "{} yrms={:0.2f}".format(message, y_rms * 1000.0)
@@ -171,7 +171,7 @@ def track(self, params_dict: dict) -> None:
171171
sys.stdout.flush()
172172

173173
# Add line to history file
174-
if (self.file is not None) and (self._mpi_rank == 0):
174+
if (self._mpi_rank == 0) and (self.file is not None):
175175
data = [self.history[key] for key in self.history]
176176
line = ""
177177
for i in range(len(data)):

0 commit comments

Comments
 (0)