Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CalcJob
: Assign outputs from node in case of cache hit (#5995)
If a `CalcJob` is launched and a cache hit occurs, the outputs of the cache source are attached automatically to the process node of the `CalcJob` instance in `Node.store`. The process execution itself, shortcuts in `CalcJob.run` to directly return the exit status instead of going to the upload stage. This shortcut, however, also means that the `Parser` won't be called which normally is responsible for adding the outputs; to the process *node* but also to the *process* itself. By circumventing this, the outputs mapping on the process instance will be empty. This is a problem if the process was run as opposed to submitted. In this case, the `Runner.run` method will return the results by taking it from the `Process.outputs` method, but this will be empty. Ultimately, this means that when a user *runs* a `CalcJob` that hits the cache, the returned `results` dictionary will always be empty. To fix it, the `CalcJob.run` method is updated to populate the `_outputs` attribute of the process instance with the outputs that are stored on the associated process node. Now the run method will return the correct results dictionary.
- Loading branch information