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