ProgramHarness

pydantic model qcengine.programs.ProgramHarness[source]

Show JSON schema
{
   "title": "ProgramHarness",
   "type": "object",
   "properties": {
      "name": {
         "title": "Name",
         "type": "string"
      },
      "scratch": {
         "title": "Scratch",
         "type": "boolean"
      },
      "thread_safe": {
         "title": "Thread Safe",
         "type": "boolean"
      },
      "thread_parallel": {
         "title": "Thread Parallel",
         "type": "boolean"
      },
      "node_parallel": {
         "title": "Node Parallel",
         "type": "boolean"
      },
      "managed_memory": {
         "title": "Managed Memory",
         "type": "boolean"
      },
      "extras": {
         "title": "Extras",
         "type": "object"
      }
   },
   "required": [
      "name",
      "scratch",
      "thread_safe",
      "thread_parallel",
      "node_parallel",
      "managed_memory"
   ]
}

Fields:
field extras: Optional[Dict[str, Any]] = None
field managed_memory: bool [Required]
field name: str [Required]
field node_parallel: bool [Required]
field scratch: bool [Required]
field thread_parallel: bool [Required]
field thread_safe: bool [Required]
build_input(input_model, config, template=None)[source]
Return type:

Dict[str, Any]

Parameters:
  • input_model (AtomicInput) –

  • config (TaskConfig) –

  • template (str | None) –

abstract compute(input_data, config)[source]

Top-level compute method to be implemented for every ProgramHarness :rtype: Union[AtomicResult, FailedOperation]

Note

This method behave in any of the following ways:
  1. Return AtomicResult upon successful completion of a calculation

  2. Return FailedOperation object if an operation was unsuccessful or raised an exception. This is most

    likely to occur if the underlying QC package has a QCSchema API that catches exceptions and returns them as FailedOperation objects to end users.

  3. Raise an exception if a computation failed. The raised exception will be handled by the

    qcng.compute() method and either raised or packaged as a FailedOperation object.

Parameters:
  • input_data (AtomicInput) –

  • config (TaskConfig) –

Return type:

AtomicResult | FailedOperation

execute(inputs, extra_outfiles=None, extra_commands=None, scratch_name=None, timeout=None)[source]
Return type:

Tuple[bool, Dict[str, Any]]

Parameters:
  • inputs (Dict[str, Any]) –

  • extra_outfiles (List[str] | None) –

  • extra_commands (List[str] | None) –

  • scratch_name (str | None) –

  • timeout (int | None) –

abstract static found(raise_error=False)[source]

Checks if the program can be found.

Parameters:

raise_error (bool, optional) – If True, raises an error if the program cannot be found.

Returns:

Returns True if the program was found, False otherwise.

Return type:

bool

get_version()[source]

Finds program, extracts version, returns normalized version string.

Returns:

Return a valid, safe python version string.

Return type:

str

parse_output(outfiles, input_model)[source]
Return type:

AtomicResult

Parameters:
  • outfiles (Dict[str, str]) –

  • input_model (AtomicInput) –