diff --git a/core/model/relval_step.py b/core/model/relval_step.py index 4492f13..588bc0a 100644 --- a/core/model/relval_step.py +++ b/core/model/relval_step.py @@ -277,7 +277,36 @@ def __build_das_command(self, step_index): command += 'dasgoclient --limit 0 ' command += f'--query "file dataset={dataset} run in [{run_chunk}]" ' command += f'>> {files_name}\n' + return (comment + '\n' + command).strip() + + events = input_dict['events'] + ## N.B. das-up-to-nevents.py exists only from 14_1_0_pre7 + ## so we check for cmssw_release == + ## - 14_1_0_pre7 + ## - 14_1_X (no prereleases) + ## - 14_2_X (any) + ## - >= 15_X (any) + + cmssw_release = self.get_release() + check_das_up_to_nevents = int(cmssw_release.split("_")[0]) >= 15 + if not check_das_up_to_nevents: + check_das_up_to_nevents = "14_2" in check_das_up_to_nevents + if not check_das_up_to_nevents: + check_das_up_to_nevents = ("14_1" in cmssw_release and "pre" not in cmssw_release) + if not check_das_up_to_nevents: + check_das_up_to_nevents = (cmssw_release == "14_1_0_pre7") + + if events and check_das_up_to_nevents: + self.logger.info('Making a DAS command for step %s with max events', step_index) + files_name = f'step{step_index + 1}_files.txt' + comment = f'# Arguments for step {step_index + 1}:\n' + command = f'# Command for step {step_index + 1}:\n' + comment += f'# dataset: {dataset}\n' + comment += f'# events : {events}\n' + command += f'echo "" > {files_name}\n' + commnad += f'das-up-to-nevents.py -d {dataset} -e {events} --pc' + command += f'>> {files_name}\n' return (comment + '\n' + command).strip() return f'# Step {step_index + 1} is input dataset for next step: {dataset}'