prep
Prepration for runners.
calc_cleanup ¶
Perform cleanup operations for a calculation, including gzipping files, copying files back to the original directory, and removing the tmpdir.
Parameters:
-
atoms
(Atoms | None
) –The Atoms object after the calculation. Must have a calculator attached. If None, no modifications to the calculator's directory will be made.
-
tmpdir
(Path | str
) –The path to the tmpdir, where the calculation will be run. It will be deleted after the calculation is complete.
-
job_results_dir
(Path | str
) –The path to the job_results_dir, where the files will ultimately be stored.
Returns:
-
None
–
Source code in quacc/runners/prep.py
calc_setup ¶
calc_setup(
atoms: Atoms | None,
copy_files: (
SourceDirectory
| dict[SourceDirectory, Filenames]
| None
) = None,
) -> tuple[Path, Path]
Perform staging operations for a calculation, including copying files to the scratch directory, setting the calculator's directory, decompressing files, and creating a symlink to the scratch directory.
Parameters:
-
atoms
(Atoms | None
) –The Atoms object to run the calculation on. Must have a calculator attached. If None, no modifications to the calculator's directory will be made.
-
copy_files
(SourceDirectory | dict[SourceDirectory, Filenames] | None
, default:None
) –Files to copy (and decompress) from source to the runtime directory.
Returns:
-
Path
–The path to the unique tmpdir, where the calculation will be run. It will be deleted after the calculation is complete. By default, this will be located within
QuaccSettings.SCRATCH_DIR
, but if that is not set, it will be located within theQuaccSettings.RESULTS_DIR
. For conenience, a symlink to this directory will be made in theQuaccSettings.RESULTS_DIR
. -
Path
–The path to the results_dir, where the files will ultimately be stored. By defualt, this will be the
QuaccSettings.RESULTS_DIR
, but ifQuaccSettings.CREATE_UNIQUE_DIR
is set, it will be a unique directory within theQuaccSettings.RESULTS_DIR
.
Source code in quacc/runners/prep.py
terminate ¶
Terminate a calculation and move files to a failed directory.
Parameters:
-
tmpdir
(Path | str
) –The path to the tmpdir, where the calculation was run.
-
exception
(Exception
) –The exception that caused the calculation to fail.
Returns:
-
None
–
Raises:
-
JobFailure
–The exception that caused the calculation to fail plus additional metadata.