Skip to content

Commit

Permalink
max files
Browse files Browse the repository at this point in the history
  • Loading branch information
rkansal47 committed Jul 24, 2024
1 parent b5a440a commit 57271d8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/HHbbVV/run_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def get_fileset(
starti: int = 0,
endi: int = -1,
get_num_files: bool = False,
max_files: int = None,
coffea_casa: str = False,
):
if processor.startswith("trigger"):
Expand Down Expand Up @@ -140,6 +141,9 @@ def get_fileset(
fileset[sample] = {}
for subsample, fnames in sample_set.items():
fileset[sample][subsample] = len(fnames)
if max_files is not None:
print("Max files")
fileset[sample][subsample] = min(fileset[sample][subsample], max_files)

else:
# return all files per subsample
Expand Down
8 changes: 7 additions & 1 deletion src/condor/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ def main(args):
print("CONDOR work dir: ", local_dir)

fileset = run_utils.get_fileset(
args.processor, args.year, args.samples, args.subsamples, get_num_files=True
args.processor,
args.year,
args.samples,
args.subsamples,
get_num_files=True,
max_files=args.max_files,
)

print(f"fileset: {fileset}")
Expand Down Expand Up @@ -150,6 +155,7 @@ def parse_args(parser):
help="test run or not - test run means only 2 jobs per sample will be created",
)
parser.add_argument("--files-per-job", default=20, help="# files per condor job", type=int)
parser.add_argument("--max-files", default=None, help="max total files to run over", type=int)

run_utils.add_bool_arg(
parser, "submit", default=False, help="submit files as well as create them"
Expand Down
3 changes: 2 additions & 1 deletion src/condor/submit_configs/skimmer_24_07_24_signal_lp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"VBF_HHTobbVV_CV_1_C2V_1_C3_2",
],
"files_per_job": 20,
"max_files": 60,
"chunksize": 80000,
"maxchunks": 20
# "maxchunks": 20
},
} }
1 change: 1 addition & 0 deletions src/condor/submit_from_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def add_bool_arg(parser, name, help, default=False, no_name=None):
args.subsamples = sdict.get("subsamples", [])
args.files_per_job = sdict["files_per_job"]
args.njets = sdict.get("njets", 2)
args.max_files = sdict.get("max_files", None)
args.maxchunks = sdict.get("maxchunks", 0)
args.chunksize = sdict.get("chunksize", 10000)

Expand Down

0 comments on commit 57271d8

Please sign in to comment.