critcatworks.dft package

Submodules

critcatworks.dft.general module

class critcatworks.dft.general.ChunkCalculationsTask(*args, **kwargs)[source]

Bases: fireworks.core.firework.FiretaskBase

Create Fireworks with new calculations to setup and run

Parameters
  • template (str) – input file for calculations represented as string. It works as a template which is later modified by the simulation-specific Firework.

  • target_path (str) – absolute path to the target directory (needs to exist) on the computing resource.

  • name (str) – individual calculation folder name is prefixed with the given string

  • n_max_restarts (int) – number of times the calculation is restarted upon failure

  • chunk_size (int) – number of calculations to be run simulataneously. Default -1 means all calculations are run at once.

  • simulation_method (str) – Specifies which simulation code to use. Currently, only CP2K is implemented.

  • skip_dft (bool) – If set to true, the simulation step is skipped in all following simulation runs. Instead the structure is returned unchanged.

Returns

Firework action, updates fw_spec,

creates new Fireworks as detours from workflow

Return type

FWAction

optional_params = ['chunk_size', 'simulation_method', 'skip_dft']
required_params = ['template', 'target_path', 'name', 'n_max_restarts']
run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters

fw_spec (dict) – A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns

(FWAction)

class critcatworks.dft.general.StructureFolderTask(*args, **kwargs)[source]

Bases: fireworks.core.firework.FiretaskBase

Task to setup folders with xyz structures.

Parameters
  • target_path (str) – absolute path to the target directory (needs to exist) on the computing resource.

  • name (str) – individual calculation folder name is prefixed with the given string

Returns

Firework action, updates fw_spec

Return type

FWAction

optional_params = []
required_params = ['target_path', 'name']
run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters

fw_spec (dict) – A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns

(FWAction)

critcatworks.dft.general.chunk_calculations(template, target_path, chunk_size=-1, name='cp2k_run_id', n_max_restarts=4, simulation_method='cp2k', skip_dft=False)[source]

Create Fireworks with new calculations to setup and run.

Parameters
  • template (str) – input file for calculations represented as string. It works as a template which is later modified by the simulation-specific Firework.

  • target_path (str) – absolute path to the target directory (needs to exist) on the computing resource.

  • name (str) – individual calculation folder name is prefixed with the given string

  • n_max_restarts (int) – number of times the calculation is restarted upon failure

  • chunk_size (int) – det : number of calculations to be run simulataneously. Default -1 means all calculations are run at once.

  • simulation_method (str) – Specifies which simulation code to use. Currently, only CP2K is implemented.

  • skip_dft (bool) – If set to true, the simulation step is skipped in all following simulation runs. Instead the structure is returned unchanged.

Returns

StructureFolderWork Firework,

creates new Fireworks as detours from workflow

Return type

Firework

critcatworks.dft.general.setup_folders(target_path, name='cp2k_run_id')[source]

Creates folders with xyz structures.

Parameters
  • target_path (str) – absolute path to the target directory (needs to exist) on the computing resource.

  • name (str) – individual calculation folder name is prefixed with the given string

Returns

StructureFolderWork Firework

Return type

Firework

Module contents