From 70e2d77cc84c4cd790a38a462f1de6a2b8bacbfc Mon Sep 17 00:00:00 2001 From: Julien Esseiva Date: Wed, 10 Jul 2024 18:41:59 -0700 Subject: [PATCH 1/2] set maxEvents to the number of events per file --- src/raythena/actors/esworker.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/raythena/actors/esworker.py b/src/raythena/actors/esworker.py index 1785b73..aa781fe 100644 --- a/src/raythena/actors/esworker.py +++ b/src/raythena/actors/esworker.py @@ -199,6 +199,12 @@ def modify_job(self, job: PandaJob) -> PandaJob: else: cmd = f"{cmd} --jobNumber={job_number} " + maxEvents = job['nEventsPerInputFile'] + if "--maxEvents=" in cmd: + cmd = re.sub(r"--maxEvents=[0-9]+", f"--maxEvents={maxEvents}", cmd) + else: + cmd = f"{cmd} --maxEvents={maxEvents} " + job["jobPars"] = cmd return job From eb01a7960832c4b39d5c7121b944f55f1244a21b Mon Sep 17 00:00:00 2001 From: Julien Esseiva Date: Mon, 15 Jul 2024 09:24:03 -0700 Subject: [PATCH 2/2] set maxEvents to the smallest of 500 and nEventsPerInputFile --- src/raythena/actors/esworker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raythena/actors/esworker.py b/src/raythena/actors/esworker.py index aa781fe..bd88484 100644 --- a/src/raythena/actors/esworker.py +++ b/src/raythena/actors/esworker.py @@ -199,7 +199,7 @@ def modify_job(self, job: PandaJob) -> PandaJob: else: cmd = f"{cmd} --jobNumber={job_number} " - maxEvents = job['nEventsPerInputFile'] + maxEvents = min(500, job['nEventsPerInputFile']) if "--maxEvents=" in cmd: cmd = re.sub(r"--maxEvents=[0-9]+", f"--maxEvents={maxEvents}", cmd) else: