File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,14 @@ def resources_subfields(cls) -> List[Argument]:
139139class SlurmJobArray (Slurm ):
140140 """Slurm with job array enabled for multiple tasks in a job"""
141141 def gen_script_header (self , job ):
142+ if job .fail_count > 0 :
143+ # resubmit jobs, check if some of tasks have been finished
144+ job_array = []
145+ for ii , task in enumerate (job .job_task_list ):
146+ task_tag_finished = (pathlib .PurePath (task .task_work_path )/ (task .task_hash + '_task_tag_finished' )).as_posix ()
147+ if not self .context .check_file_exists (task_tag_finished ):
148+ job_array .append (ii )
149+ return super ().gen_script_header (job ) + "\n #SBATCH --array=%s" % ("," .join (map (str , job_array )))
142150 return super ().gen_script_header (job ) + "\n #SBATCH --array=0-%d" % (len (job .job_task_list )- 1 )
143151
144152 def gen_script_command (self , job ):
You can’t perform that action at this time.
0 commit comments