@@ -228,6 +228,11 @@ def submit(self, job: Job) -> None:
228228 self ._set_job_status (job , JobStatus (JobState .QUEUED ,
229229 metadata = {'native_id' : job .native_id }))
230230 except subprocess .CalledProcessError as ex :
231+ if logger .isEnabledFor (logging .DEBUG ):
232+ with submit_file_path .open ('r' ) as submit_file :
233+ script = submit_file .read ()
234+ logger .debug ('Job %s: submit script is: %s' % (job .id , script ))
235+
231236 raise SubmitException (ex .output ) from None
232237
233238 self ._queue_poll_thread .register_job (job )
@@ -497,7 +502,7 @@ def _create_script_context(self, job: Job) -> Dict[str, object]:
497502 def _format_duration (self , d : timedelta ) -> str :
498503 # the default is hh:mm:ss, with hh not limited to 24; this is the least ambiguous
499504 # choice
500- return '%s:%s:%s' % (d .total_seconds () // 3600 , (d .seconds // 60 ) % 60 , d .seconds % 60 )
505+ return '%s:%s:%s' % (int ( d .total_seconds () ) // 3600 , (d .seconds // 60 ) % 60 , d .seconds % 60 )
501506
502507 def _run_command (self , cmd : List [str ]) -> str :
503508 res = subprocess .run (cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE , text = True )
@@ -562,7 +567,11 @@ def _read_aux_files(self, job: Job, status: JobStatus) -> None:
562567 if status .message is None :
563568 # only read output from submit script if another error message is not
564569 # already present
565- status .message = self ._read_aux_file (job , '.out' )
570+ out = self ._read_aux_file (job , '.out' )
571+ if out :
572+ launcher = self ._get_launcher_from_job (job )
573+ if launcher .is_launcher_failure (out ):
574+ status .message = launcher .get_launcher_failure_message (out )
566575 logger .debug ('Output from launcher: %s' , status .message )
567576 else :
568577 self ._delete_aux_file (job , '.out' )
0 commit comments