Skip to content
Snippets Groups Projects
Commit fc05fbd1 authored by Anne Philipp's avatar Anne Philipp
Browse files

BugFix for job_chunk param. start_date counts as one full day and therefore we...

BugFix for job_chunk param. start_date counts as one full day and therefore we have to subtract one day from the 'inbetween' end_date to have to correct number of days per job.
parent 6404de11
No related branches found
No related tags found
No related merge requests found
...@@ -161,15 +161,15 @@ def submit(jtemplate, c, queue): ...@@ -161,15 +161,15 @@ def submit(jtemplate, c, queue):
start = datetime.strptime(c.start_date, '%Y%m%d') start = datetime.strptime(c.start_date, '%Y%m%d')
end = datetime.strptime(c.end_date, '%Y%m%d') end = datetime.strptime(c.end_date, '%Y%m%d')
chunk = timedelta(days=c.job_chunk) chunk = timedelta(days=c.job_chunk)
oneday = timedelta(days=1)
while start <= end: while start <= end:
if (start + chunk) <= end: if (start + chunk) <= end:
c.end_date = (start + chunk).strftime("%Y%m%d") c.end_date = (start + chunk - oneday).strftime("%Y%m%d")
else: else:
c.end_date = end.strftime("%Y%m%d") c.end_date = end.strftime("%Y%m%d")
clist = c.to_list() clist = c.to_list()
mk_jobscript(jtemplate, job_file, clist) mk_jobscript(jtemplate, job_file, clist)
job_id = submit_job_to_ecserver(queue, job_file) job_id = submit_job_to_ecserver(queue, job_file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment