Skip to content

Commit

Permalink
Add a security to avoid submitting a job for a run for which the DQM …
Browse files Browse the repository at this point in the history
…was already run. (#107)

Co-authored-by: Jean-Philippe Lenain <[email protected]>
  • Loading branch information
jlenain and jlenain authored Feb 5, 2024
1 parent a47fbe6 commit 3439776
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,29 @@
sys.exit(1)
logger.info(f"Found SQLite files {sqlfilelist} in {dfcDir} and {dfcDirTomorrow}")

# Check already existing DQM outputs
dfcOutDir = "/vo.cta.in2p3.fr/user/j/jlenain/nectarcam/dqm"
infos = dfc.listDirectory(dfcOutDir)
if not infos["OK"] or not infos["Value"]["Successful"]:
logger.critical(
f"Could not properly retrieve the file metadata for {dfcOutDir} ... Exiting !"
)
sys.exit(1)
metaOutDir = infos["Value"]["Successful"][dfcOutDir]

# Now, submit the DIRAC jobs:
# for run in ['2721']:
for run in runlist:
logger.debug(metaOutDir["Files"].keys())
if f"{dfcOutDir}/NectarCAM_DQM_Run{run}.tar.gz" in metaOutDir["Files"].keys():
logger.warning(
f"Run {run} already processed and present in {dfcOutDir}. If you really "
f"want to re-run the DQM on this run, consider deleting "
f"{dfcOutDir}/NectarCAM_DQM_Run{run}.tar.gz before executing this script. "
f"Skipping run {run} for now..."
)
continue

j = Job()
# j.setExecutable(f'{executable_wrapper}', '<SOME POSSIBLE ARGUMENTS such as run number>')
j.setExecutable(f"{executable_wrapper}", f"-r {run}")
Expand Down

0 comments on commit 3439776

Please sign in to comment.