Quickstart¶
This project is based on the basic workflow implemented in the signac tutorial. Being familiar with the tutorial will help in understanding the logic of this template.
The project requires the signac-flow package, which implements the core logic of the example workflow within a flow.FlowProject
class.
In addition it adds functionality to work with schedulers in a cluster environment.
The Basics¶
This is a list of key things you need to know in order to efficiently work with this project:
- All modules are part of the
my_project
package located in the directory of the same name.- Data Space operations are implemented within the
scripts/operations.py
module.- The project execution logic is implemented within the
project.MyProject
class.- All jobs are classified via
str
-labels with theMyProject.classify()
method.- The next operation is identified via the
MyProject.next_operation()
method.- Job-operations may be executed directly via the
scripts/run.py
script.- Job-operations may be submitted to a scheduler via the
submit
module.- The project status may be examined by executing the
status
module.
A complete overview of all modules and functions an be found in the API chapter.
Step-by-step¶
This is a description on how to execute the complete workflow of this project.
Initialize the data space using a random number or string, e.g. your username:
$ python my_project.init $USER # (or $ python my_project.init 42)
You can check the status of your project:
$ python my_project.status -d
Query scheduler...
Determine job stati...
Generate output...
Status project 'MyProject':
Total # of jobs: 5
label progress
----------- --------------------------------------------------
initialized |########################################| 100.00%
Detailed view:
job_id status next_operation labels
-------------------------------- -------- ---------------- -----------
8921709098d990fc70b19895653b7f01 unknown estimate initialized
8deb24c26dcb0bf0322cbf45c6b3198f unknown estimate initialized
b76e21a18c46a90ed52ec3f1e2cd6250 unknown estimate initialized
ed41e3073b4a4133c05bf7ed050ebceb unknown estimate initialized
fc89c69cb0f09b84f0b7f08c39bde326 unknown estimate initialized
Compute the ideal gas estimate, just like in the tutorial:
$ python scripts/run.py estimate
Or execute a molecular dynamics simulation using hoomd-blue with:
$ python scripts/run.py equilibrate 8921
Note
When no job id is provided as argument, the specified operation is executed for all jobs.
Instead of running the operations directly, we can also submit them to a scheduler:
$ python my_project.submit -j equilibrate
In this case we explicitly specified which operation to submit. If we omit the argument, the next operation for each job will be submitted.
Note
The scheduler is determined from the environment with the environment
module.
If your environment does not have a scheduler or it is not configured, signac-flow will default to a fake scheduler, which prints the job scripts to screen.