layers
HexFormatter
HexFormatter(separator=':', index_format='{:05X}', offset=0)
Bases: SimpleFormatter
A hex-based node formatter that produces names like LayerName:0000C.
Source code in ezdag/layers.py
429 430 431 432 433 434 | |
Layer
dataclass
Layer(executable, name='', universe='vanilla', log_dir='logs', retries=3, transfer_files=True, submit_description=dict(), nodes=list())
Defines a single layer (or set of related jobs) in an HTCondor DAG.
Stores submit configuration for a set of nodes as well as providing functionality to determine the parent-child relationships between nodes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
executable
|
str
|
The path of the executable to run. |
required |
name
|
str
|
The human-readable name of this node. Defaults to the basename of the executable if not given. |
''
|
universe
|
str
|
The execution environment for a job. Defaults to 'vanilla'. |
'vanilla'
|
log_dir
|
str
|
The directory in which logs will be written to. Defaults to ./logs. |
'logs'
|
retries
|
int
|
The number of retries given for a job. Defaults to 3. |
3
|
transfer_files
|
bool
|
Whether to leverage Condor file transfer for moving around files. On by default. |
True
|
submit_description
|
dict | Submit
|
The submit descriptors representing this set of jobs. |
dict()
|
nodes
|
list
|
The nodes representing the layer. Nodes can be passed upon instantiation or added to the layer after the fact via Layer.append(node), Layer.extend(nodes), or Layer += node. |
list()
|
has_dependencies
property
has_dependencies
Check if any of the nodes in this layer have dependencies.
append
append(node)
Append a node to this layer.
Source code in ezdag/layers.py
120 121 122 123 124 125 126 127 128 | |
command
command(node, *, readjust_paths=True)
Given a node, return the command that would be run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node
|
Node
|
The node to return the command for. |
required |
readjust_paths
|
bool
|
Determines whether path locations are readjusted based on the command that would be run on the node's execute point. This only has an effect if using file transfer. Default is True. |
True
|
Source code in ezdag/layers.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
config
config(formatter=None)
Generates a layer configuration.
This configuration can be passed directly into an htcondor.dags.NodeLayer if desired.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
formatter
|
NodeNameFormatter
|
Defines how the node names are defined and formatted. Defaults to a hex-based formatter with 5 digits. |
None
|
Source code in ezdag/layers.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
extend
extend(nodes)
Append multiple nodes to this layer.
Source code in ezdag/layers.py
130 131 132 133 | |
new
new()
Create an identical layer without any nodes attached.
Source code in ezdag/layers.py
142 143 144 145 146 147 148 149 150 151 152 | |
validate
validate()
Ensure all nodes in this layer are consistent with each other.
Source code in ezdag/layers.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |
Node
dataclass
Node(arguments=list(), inputs=list(), outputs=list(), variables=dict())
Defines a single node (or job) in an HTCondor DAG.
Stores both the arguments used within a job as well as capturing any inputs and outputs the job uses/creates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arguments
|
NodeOption | list
|
The arguments the node uses which aren't I/O related. |
list()
|
inputs
|
NodeOption | list
|
The arguments the node takes as inputs. |
list()
|
outputs
|
NodeOption | list
|
The arguments the node takes as outputs. |
list()
|
variables
|
dict
|
Meta parameters that can be used within the submit description. |
dict()
|