Skip to content
Snippets Groups Projects
Commit 01789c47 authored by Patrick Godwin's avatar Patrick Godwin
Browse files

allow basic filename remaps in DAGs

parent 796a74b1
No related branches found
No related tags found
1 merge request!41DAG Workflow Overhaul + OSG DAG support
......@@ -217,6 +217,12 @@ class Argument:
Whether to track files defined here and used externally within
jobs to determine parent-child relationships when nodes specify
this option as an input or output. On by default.
remap
Whether to allow remapping of output files being transferred.
If set, output files will be moved to their target directories
after files are transferred back. This is done to avoid issues
where the target directories are available on the submit node
but not on the exectute node. On by default.
suppress
Whether to hide this option. Used externally within jobs to
determine whether to define job arguments. This is typically used
......@@ -241,6 +247,7 @@ class Argument:
name: str
argument: Union[int, float, str, List]
track: Optional[bool] = True
remap: Optional[bool] = True
suppress: Optional[bool] = False
suppress_with_remap: Optional[bool] = False
......@@ -255,7 +262,10 @@ class Argument:
self.argument = [self.argument]
self.argument = [str(arg) for arg in self.argument]
if self.suppress_with_remap:
# set options that control other options
if self.suppress:
self.remap = False
elif self.suppress_with_remap:
self.suppress = True
@property
......@@ -291,6 +301,12 @@ class Option:
Whether to track files defined here and used externally within
jobs to determine parent-child relationships when nodes specify
this option as an input or output. On by default.
remap
Whether to allow remapping of output files being transferred.
If set, output files will be moved to their target directories
after files are transferred back. This is done to avoid issues
where the target directories are available on the submit node
but not on the exectute node. On by default.
suppress
Whether to hide this option. Used externally within jobs to
determine whether to define job arguments. This is typically used
......@@ -317,6 +333,7 @@ class Option:
name: str
argument: Optional[Union[int, float, str, List]] = None
track: Optional[bool] = True
remap: Optional[bool] = True
suppress: Optional[bool] = False
suppress_with_remap: Optional[bool] = False
......@@ -332,7 +349,10 @@ class Option:
self.argument = [self.argument]
self.argument = [str(arg) for arg in self.argument]
if self.suppress_with_remap:
# set options that control other options
if self.suppress:
self.remap = False
elif self.suppress_with_remap:
self.suppress = True
@property
......
......@@ -225,9 +225,10 @@ class Layer:
if node.outputs:
for arg in node.outputs:
if not arg.suppress:
nodevars.update({f"{arg.condor_name}": arg.vars(basename=self.transfer_files)})
basename = self.transfer_files and arg.remap
nodevars.update({f"{arg.condor_name}": arg.vars(basename=basename)})
if self.transfer_files:
if not arg.suppress or arg.suppress_with_remap:
if arg.remap:
nodevars.update({f"output_{arg.condor_name}": arg.files(basename=True)})
nodevars.update({f"output_{arg.condor_name}_remap": arg.remaps()})
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment