Skip to content

Commit

Permalink
Add ability to overwrite file retention level for specific executable…
Browse files Browse the repository at this point in the history
…s from config (#4435)

* Add ability to overwrite file retention level for specific instances

* Allow different retention levels rather than juts not keeping

* CC

* Global and Executable retention levels are not the same

* Fix incorrect indent
  • Loading branch information
GarethCabournDavies authored Aug 4, 2023
1 parent 359e239 commit ba7273d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pycbc/workflow/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def make_analysis_dir(path):

class Executable(pegasus_workflow.Executable):
# These are the file retention levels
DO_NOT_KEEP = 0
INTERMEDIATE_PRODUCT = 1
ALL_TRIGGERS = 2
MERGED_TRIGGERS = 3
Expand Down Expand Up @@ -147,6 +148,15 @@ def __init__(self, cp, name, ifos=None, out_dir=None, tags=None,
self.update_output_directory(out_dir=out_dir)

# Determine the level at which output files should be kept
if cp.has_option_tags('pegasus_profile-%s' % name,
'pycbc|retention_level', tags):
# Get the retention_level from the config file
# This method allows us to use the retention levels
# defined above
cfg_ret_level = cp.get_opt_tags('pegasus_profile-%s' % name,
'pycbc|retention_level', tags)
self.current_retention_level = getattr(self, cfg_ret_level)

self.update_current_retention_level(self.current_retention_level)

# Should I reuse this executable?
Expand Down

0 comments on commit ba7273d

Please sign in to comment.