@@ -328,8 +328,12 @@ def _log_output(self, stop_data=None):
328
328
output = self .get_output (remove = True )
329
329
if self .output_limit :
330
330
output = "" .join (output .splitlines (True )[- self .output_limit :])
331
+
332
+ log = self .log .debug
333
+ if stop_data and stop_data .get ("exit_code" , 0 ) != 0 :
334
+ log = self .log .warning
331
335
if output :
332
- self . log . debug ( f "Output for { self . identifier } :\n { output } " )
336
+ log ( "Output for %s :\n %s" , self . identifier , output )
333
337
334
338
335
339
class ControllerLauncher (BaseLauncher ):
@@ -795,6 +799,11 @@ def _notice_engine_stopped(self, data):
795
799
796
800
self .notify_stop (self .stop_data )
797
801
802
+ def _log_output (self , stop_data = None ):
803
+ # avoid double-logging output, already logged by each engine
804
+ # that will be a lot if all 100 engines fail!
805
+ pass
806
+
798
807
def get_output (self , remove = False ):
799
808
"""Get the output of all my child Launchers"""
800
809
for identifier , launcher in self .launchers .items ():
@@ -867,9 +876,13 @@ def start(self, n=1):
867
876
868
877
def _log_output (self , stop_data ):
869
878
"""Try to log mpiexec error output, if any, at warning level"""
870
- super ()._log_output ()
871
- if self .log .getEffectiveLevel () <= logging .DEBUG :
879
+ super ()._log_output (stop_data )
880
+
881
+ if stop_data and self .stop_data .get ("exit_code" , 0 ) != 0 :
882
+ # if this is True, super()._log_output would have already logged the full output
883
+ # no need to extract from MPI
872
884
return
885
+
873
886
output = self .get_output (remove = False )
874
887
mpiexec_lines = []
875
888
0 commit comments