Skip to content
Snippets Groups Projects
Commit a230b47b authored by Veronique Legrand's avatar Veronique Legrand
Browse files

work in progress: better handling of checkpoints

parent 0fb36a15
No related branches found
No related tags found
No related merge requests found
Pipeline #152402 failed
......@@ -118,7 +118,12 @@ def readsCoverage(inRawDArgs,refseq,inDArgs,fParms,return_dict, core_id,line_sta
p_res=chk_handler.load(core_id,idx_refseq)
gen_len,host_len,termini_coverage, whole_coverage, paired_whole_coverage, phage_hybrid_coverage, host_hybrid_coverage,\
host_whole_coverage, list_hybrid, insert, paired_missmatch, k, count_line, read_match=init_ws(p_res, refseq, inDArgs.hostseq)
host_whole_coverage, list_hybrid, insert, paired_mismatch, k, count_line, read_match=init_ws(p_res, refseq, inDArgs.hostseq)
if p_res==None:
# no existing checkpoint and starting processing of a new sequence
chk_handler.start(count_line,core_id,idx_refseq,termini_coverage,whole_coverage,paired_whole_coverage,\
phage_hybrid_coverage, host_hybrid_coverage, \
host_whole_coverage,list_hybrid,insert,paired_mismatch,count_line,read_match)
if logger!=None:
logger.add_rw(p_res)
test_read_seq = match = 0
......
......@@ -291,6 +291,18 @@ class RCCheckpoint_handler:
host_whole_coverage,list_hybrid,insert,paired_mismatch,reads_tested,read_match)
chkp.save(self.dir_chk,core_id,idx_seq)
# When running on a cluster, ptv may be killed due to timeout. It is possible that in that case, that the processing of sequence n-1 is over
# (there is no more checkpoint for n-1) and ptv has not yet created a checkpoint for sequence n.
# The following method is used for creating a checkpoint at the beginning of processing of sequence n to avoid ptv
# having to restart from the beginning if it is killed due to timeout
def start(self,count_line,core_id,idx_seq,termini_coverage,whole_coverage,paired_whole_coverage,\
phage_hybrid_coverage, host_hybrid_coverage, \
host_whole_coverage,list_hybrid,insert,paired_mismatch,reads_tested,read_match):
if self.chk_freq != 0 and self.test_mode == False:
chkp = RCCheckpoint(count_line, core_id, idx_seq, termini_coverage, whole_coverage, paired_whole_coverage, \
phage_hybrid_coverage, host_hybrid_coverage, \
host_whole_coverage, list_hybrid, insert, paired_mismatch, reads_tested, read_match)
chkp.save(self.dir_chk, core_id, idx_seq)
def end(self,core_id):
if (self.test_mode==False and self.chk_freq!=0) :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment