-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CalcJob
: add the option to stash files after job completion (#4424)
A new namespace `stash` is added to the `metadata.options` input namespace of the `CalcJob` process. This option namespace allows a user to specify certain files that are created by the calculation job to be stashed somewhere on the remote. This can be useful if those files need to be stored for a longer time than the scratch space where the job was run is typically not cleaned for, but need to be kept on the remote machine and not retrieved. Examples are files that are necessary to restart a calculation but are too big to be retrieved and stored permanently in the local file repository. The files that are to be stashed are specified through their relative filepaths within the working directory in the `stash.source_list` option. For now, the only supported option is to have AiiDA's engine copy the files to another location on the same filesystem as the working directory of the calculation job. The base path is defined through the `stash.target_base` option. In the future, other methods may be implemented, such as placing all files in a (compressed) tarball or even stash files on tape. Which mode is to be used is communicated through the enum `aiida.common.datastructures.StashMode` which for now therefore only has the `COPY` value. If the `stash` option namespace is defined for a calculation job, the daemon will perform the stashing operations before the files are retrieved. This also means that the stashing also happens before the parsing of the output files (which occurs after the retrieving step) which means that the files will be stashed independent of the final exit status that the parser will assign to the calculation job. This may cause files to be stashed of calculations that will later be considered to have failed. However, the stashed files can always be deleted manually by the user afterwards if needed. Finally, the stashed files are represented by an output node that is attached to the calculation node through the label `remote_stash`. Just like the `remote_folder` node, this represents a location or files on a remote machine and so is merely a "symbolic link" of sorts. AiiDA does not actually own the files and the contents may disappear at some point. To be able to distinguish the stashed folder from the remote folder, a new data plugin is used, the `RemoteStashFolderData`. The base class is `RemoteStashData` which is not instantiable, but will merely serve as a base class for future subclasses, one for each `StashMode` value. The reason is that the way files need to be accessed depend on the way they were stashed and so it is good to have separate classes for this. It was considered to give `RemoteFolderData` and `RemoteData` the same base class (changing the type of the `remote_folder` to a new subclass `RemoteFolderData`) but this would introduce breaking changes and so this was relegated to a potential future major release.
- Loading branch information
Showing
15 changed files
with
481 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.