Introduction#
To know how nnodes works, you only need to understand two concepts: Node
and workspace
.
Node#
Node
is the basic execution unit of nnodes. Its consists of 4 elements: task, directory, properties and child nodes.
Task: can be a Shell command or Python function. If it is a function, the “node” object will be passed to it during execution so that it can read its properties.
Directory: working directory of the node, task output will by default be saved to its directory. The node object also come with various file system utilities like copy, move, read, write, etc.
Properties: additional information that can be read by the task. The properties of a node will be propagated to all its child nodes, unless overwritten.
Child nodes: nodes that will be executed after the task of current node is complete. A node can be configured to execute its child nodes either sequentially or concurrently.
Workspace#
Workspace is simply a directory with a config.toml
file, which can be generated by command nnmk
. The config.toml
file contains the information of the execution environment (job scheduler, CPU configuration, etc.) and also the task of the root node. You can execute the task directly with nnrun
or submit it to the job scheduler. During execution, a root.pickle
file will be generated, which contains the job progress. You can delete root.pickle
to restart, copy it to another computer and continue running, or edit it with nnodes Python module to control the progress. You can also view the current execution status with command nnlog
.
nnmk
Create a new workspace.nnlog
Show the execution status of current workspace.nnrun
Start executing current workspace.