Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lawluigi_configs/KingMaker_luigi.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ only_missing = True
; bootstrap file to be sourced at beginning of htcondor jobs (relative PATH to framework.py)
bootstrap_file = setup_law_remote.sh
files_per_task = 10

; If some datasets are known to result in files with a large number of events, a lower number
; of files per task can be set for these datasets to avoid long runtimes. This is a mapping
; based on dataset name to number of files per task following "sample_type" key of
; sample_database collection, e.g., {"ttbar": 3, "wjets": 20}.
custom_files_per_task = {}

; scopes and shifts are to be provided in the config, or as command line arguments via --scope and --shift
; in both cases, the values are expected to be comma-separated lists without spaces or quotes
scopes = mt,et
Expand Down Expand Up @@ -112,4 +119,4 @@ friend_mapping = {}
silent = True
; set to False to print out the datasets

[QuantitiesMap]
[QuantitiesMap]
4 changes: 2 additions & 2 deletions processor/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class Task(law.Task):
description="Tag to differentiate workflow runs. Set to a timestamp as default.",
)
nanoAOD_version = luigi.Parameter(
default=NanoAODVersions.v12.value,
description="Version of the NanoAOD files that are used in the analysis. 'NanoAOD_v12' is the default.",
default=NanoAODVersions.v15.value,
description="Version of the NanoAOD files that are used in the analysis. 'NanoAOD_v15' is the default.",
Comment thread
a-monsch marked this conversation as resolved.
)
Comment thread
a-monsch marked this conversation as resolved.
Comment thread
a-monsch marked this conversation as resolved.

# Ensure that branch parameter is processed normally
Expand Down
5 changes: 5 additions & 0 deletions processor/tasks/CROWNBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ class CROWNExecuteBase(HTCondorWorkflow, law.LocalWorkflow):
analysis = luigi.Parameter()
config = luigi.Parameter()
files_per_task = luigi.IntParameter()
custom_files_per_task = luigi.DictParameter(
default={},
significant=False,
description="Map specific sample_types to custom files_per_task",
)

def htcondor_output_directory(self):
return law.LocalDirectoryTarget(self.local_path(f"htcondor_files/{self.nick}"))
Expand Down
3 changes: 3 additions & 0 deletions processor/tasks/CROWNRun.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def create_branch_map(self):
if len(inputdata["filelist"]) == 0:
raise Exception("No files found for dataset {}".format(self.nick))
files_per_task = self.files_per_task
custom_fpt = self.custom_files_per_task.get(self.sample_type)
if custom_fpt is not None:
files_per_task = int(custom_fpt)
if self.sample_type == "data" and any(
era in self.nick for era in self.problematic_eras
):
Expand Down
Loading