Workflow steps

  • The steps use filesystem artifacts to determine completion.

  • Steps are fail-fast: they terminate execution on critical failures.

  • The same step implementation may be reused by multiple workflows.

Base interface

class workflows.steps.Step(config)

Bases: ABC

Minimal step interface: not_finished + run, bound to a config.

abstract not_finished() bool
abstract run() None

Steps

class workflows.steps.GenerateStructuresStep(config)

Generate hypothetical structures in parallel (chunked).

Submits parsl_tasks.gen_structures.gen_structures() for each chunk i [1, n_chunks] where n_chunks = config[CK.GEN_STRUCTURES_NNODES], and waits for completion.

not_finished() bool
run() None
class workflows.steps.CgcnnStep(config)

Predicts formation energy with CGCNN for the candidates.

Submits parsl_tasks.cgcnn.cgcnn_prediction() for each chunk i [1, n_chunks] where n_chunks = config[CK.GEN_STRUCTURES_NNODES]. Merges work_dir/test_results_*.csv into work_dir/test_results.csv, then deletes the shard files.

not_finished() bool
run() None
class workflows.steps.SelectStructuresStep(config, out_dir, min_total=1000, max_total=4000)

Filter, deduplicate, and select candidate structures.

Runs parsl_tasks.select_structures.select_structures() to produce {work_dir}/new/POSCAR_{i} and {work_dir}/new/id_prop.csv.

not_finished() bool
run() None
class workflows.steps.MLIPRelaxationStep(config)

Relax selected structures with an MLIP and write per-structure energies.

not_finished() bool
run() None
class workflows.steps.EhullMLParallel(config)

Compute ML-based hull quantities in parallel and write the hull output.

not_finished() bool
run() None
class workflows.steps.VaspCalculationsStep(config, run_mlip_post_processing: bool = False)

Run two-stage VASP calculations for all selected structures and log outcomes.

Launches parsl_tasks.dft_optimization.run_vasp_calc() for each ID in {config[CK.VASP_ID_STRUCT_LIST]}. Writes a CSV of per-ID results to {config[CK.VASP_WORK_DIR]}/{config[CK.OUTPUT_FILE]}.

not_finished() bool
run() None
class workflows.steps.PostProcessingStep(config, get_hull: bool = True)

Compute Ehull, color the convex hull, and collect promising candidates.

Requires a 3- or 4-element system. Runs tools.post_processing.get_vasp_hull(), parsl_tasks.ehull.calculate_ehul() and parsl_tasks.convex_hull.convex_hull_color().

not_finished() bool
run() None

Workflows

Workflow classes

class workflows.vasp_workflow.VaspWorkflow(config, dry_run: bool = False)

Run the full VASP-based materials discovery workflow.

Consists of the following task-based steps (with a dependency between each step):

  1. Structure Generation generate_structures()

  2. CGCNN Prediction run_cgcnn().

  3. Structure Selection select_structures().

  4. VASP Calculations vasp_calculations()

  5. Post Processing

Parameters:

config (ConfigManager) – The configuration manager that provides runtime parameters, paths, and thresholds for each stage of the workflow.

Side Effects:
  • Creates directories and files under config[CK.WORK_DIR]

  • Executes multiple shell commands and external applications

Raises:

Exception – If any sub-stage raises an error that is not internally handled.

name: str = 'vasp'
class workflows.mlip_workflow.MLIPWorkflow(config, dry_run: bool = False)
name: str = 'mlip'
pre_check()

override in subclasses

MLIP based

  1. workflows.steps.GenerateStructuresStep

  2. workflows.steps.CgcnnStep

  3. workflows.steps.SelectStructuresStep

  4. workflows.steps.MLIPRelaxationStep

  5. workflows.steps.EhullMLParallel

  6. workflows.steps.VaspCalculationsStep

  7. workflows.steps.PostProcessingStep

VASP based

  1. workflows.steps.GenerateStructuresStep

  2. workflows.steps.CgcnnStep

  3. workflows.steps.SelectStructuresStep

  4. workflows.steps.VaspCalculationsStep

  5. workflows.steps.PostProcessingStep