@@ -97,8 +97,7 @@ def do_submit(self, job):
9797 ):
9898 # server network error, retry 3 times
9999 raise RetrySignal (
100- "Get error code %d in submitting with job: %s . message: %s"
101- % (ret , job .job_hash , err_str )
100+ f"Get error code { ret } in submitting with job: { job .job_hash } . message: { err_str } "
102101 )
103102 elif (
104103 "Job violates accounting/QOS policy" in err_str
@@ -109,8 +108,7 @@ def do_submit(self, job):
109108 # job number exceeds, skip the submitting
110109 return ""
111110 raise RuntimeError (
112- "command %s fails to execute\n error message:%s\n return code %d\n "
113- % (command , err_str , ret )
111+ f"command { command } fails to execute\n error message:{ err_str } \n return code { ret } \n "
114112 )
115113 subret = stdout .readlines ()
116114 # --parsable
@@ -145,13 +143,11 @@ def check_status(self, job):
145143 ):
146144 # retry 3 times
147145 raise RetrySignal (
148- "Get error code %d in checking status with job: %s . message: %s"
149- % (ret , job .job_hash , err_str )
146+ f"Get error code { ret } in checking status with job: { job .job_hash } . message: { err_str } "
150147 )
151148 raise RuntimeError (
152- "status command %s fails to execute."
153- "job_id:%s \n error message:%s\n return code %d\n "
154- % (command , job_id , err_str , ret )
149+ f"status command { command } fails to execute."
150+ f"job_id:{ job_id } \n error message:{ err_str } \n return code { ret } \n "
155151 )
156152 status_line = stdout .read ().decode ("utf-8" ).split ("\n " )[- 2 ]
157153 status_word = status_line .split ()[- 1 ]
@@ -255,7 +251,7 @@ def gen_script_header(self, job):
255251 return super ().gen_script_header (job ) + "\n #SBATCH --array={}" .format (
256252 "," .join (map (str , job_array ))
257253 )
258- return super ().gen_script_header (job ) + "\n #SBATCH --array=0-%d " % (
254+ return super ().gen_script_header (job ) + "\n #SBATCH --array=0-%s " % (
259255 math .ceil (len (job .job_task_list ) / slurm_job_size ) - 1
260256 )
261257
@@ -333,13 +329,11 @@ def check_status(self, job):
333329 ):
334330 # retry 3 times
335331 raise RetrySignal (
336- "Get error code %d in checking status with job: %s . message: %s"
337- % (ret , job .job_hash , err_str )
332+ f"Get error code { ret } in checking status with job: { job .job_hash } . message: { err_str } "
338333 )
339334 raise RuntimeError (
340- "status command %s fails to execute."
341- "job_id:%s \n error message:%s\n return code %d\n "
342- % (command , job_id , err_str , ret )
335+ f"status command { command } fails to execute."
336+ f"job_id:{ job_id } \n error message:{ err_str } \n return code { ret } \n "
343337 )
344338 status_lines = stdout .read ().decode ("utf-8" ).split ("\n " )[:- 1 ]
345339 status = []
0 commit comments