You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Historically, stashing was only possible, if it was instructed before running a generic calcjob. The instruction had to be "attached" to the original calcjob, like this for example:
```python
inputs = {
'MyInputs': <MyInputs>,
'metadata': {
'computer': Computer.collection.get(label="localhost"),
'options': {
'resources': {'num_machines': 1},
'stash': {
'stash_mode': StashMode.COPY.value,
'target_base': '/scratch/',
'source_list': ['heavy_data.xyz'],
},
},
},
}
run(MyCalculation, **inputs)
```
However, if a user would realize they need to stash something only after running a calcjob, this would not be possible.
This commit, introduces a new calcjob, which is able to perform a stashing operation after a calculation is finished.
The usage is very similar, and for consistency and user-friendliness, we keep the instruction as part of the metadata. The only main input is obviously a source node which is `RemoteData` node of the calculation to be stashed, for example:
```python
StashCalculation_ = CalculationFactory('core.stash')
MyCalculation = orm.load_node(pk=<PK>)
inputs = {
'metadata': {
'computer': Computer.collection.get(label="localhost"),
'options': {
'resources': {'num_machines': 1},
'stash': {
'stash_mode': StashMode.COPY.value,
'target_base': '/scratch/',
'source_list': ['heavy_data.xyz'],
},
},
},
'source_node': orm.RemoteData,
}
result = run(StashCalculation_, **inputs)
```
0 commit comments