-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StashCalculation
: a new CalcJob
plugin
#6772
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6772 +/- ##
==========================================
+ Coverage 78.30% 78.32% +0.02%
==========================================
Files 566 567 +1
Lines 42751 42777 +26
==========================================
+ Hits 33474 33499 +25
- Misses 9277 9278 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First quick review.
src/aiida/calculations/stash.py
Outdated
spec.inputs.pop('code', None) | ||
|
||
# Ideally one could use the same computer as the one of the `source_node`. | ||
# However, if another computer has access to the directory, we don't want to restrict.` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure how would I pass another computer here? Maybe you could also explain more scenario more detailed.
# However, if another computer has access to the directory, we don't want to restrict.` | |
# However if you cannot access the stash storage from the same computer anymore but you have access to it from another computer, you can can specify the computer with this commented block below | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks I updated the comment, and moved it to docstring.
Passing computer appears to be a very routing procedure it's done via metadata.computer
.
It should be very clear, now, even for the users.
src/aiida/common/datastructures.py
Outdated
COMPRESS_TARBZ2 = 'tar.bz2' | ||
COMPRESS_TARGZ = 'tar.gz' | ||
COMPRESS_TARXZ = 'tar.xz' | ||
CUSTOM_SCRIPT = 'custom_script' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the CUSTOM_SCRIPT
is part of a different PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes! my bad :) fixed now.
|
||
logger_extra = get_dblogger_extra(calculation) | ||
|
||
if calculation.process_type == 'aiida.calculations:core.stash': | ||
remote_node = load_node(calculation.inputs.source_node.pk) | ||
uuid = calculation.inputs.source_node.uuid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might increase readability
uuid = calculation.inputs.source_node.uuid | |
uuid = remote_node.uuid |
239ff8e
to
c535928
Compare
applied! |
84f49a7
to
4c1504b
Compare
StashCalculation
: new CalcJob
pluginStashCalculation
: a new CalcJob
plugin
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:
However, if a user would realize they need to stash something only after running th calcjob, this would not be possible.
This PR, defines a new calcjob, that is able to perform a stashing operation even 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, for example:
P.S. This PR is part of the upcoming changes, reference in #6764