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 (gwastro#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 and bhooshan-gadre committed Mar 1, 2024
1 parent d831ebd commit d1ec6f6
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 d1ec6f6

Please sign in to comment.