Skip to content

Commit

Permalink
added optional flush option to custom pp function (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomangano committed Feb 10, 2022
1 parent 84fe7ed commit e761f10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions baseclasses/solvers/BaseSolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def printModifiedOptions(self):
modifiedOptions = self.getModifiedOptions()
self.pp(modifiedOptions)

def pp(self, obj):
def pp(self, obj, flush=False):
"""
This method prints ``obj`` (via pprint) on the root proc of ``self.comm`` if it exists.
Otherwise it will just print ``obj``.
Expand All @@ -236,6 +236,6 @@ def pp(self, obj):
"""
if (self.comm is not None and self.comm.rank == 0) or self.comm is None:
if isinstance(obj, str):
print(obj)
print(obj, flush=flush)
else:
pprint(obj)

0 comments on commit e761f10

Please sign in to comment.