-
Notifications
You must be signed in to change notification settings - Fork 227
verdi calcjob cleanworkdir
: Add option for work chain
#4693
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
Comments
sounds good to me 👍 I would also go one step further and say it would be good to specify a group (and search for something like all calcjob, workchains and remote folders it contained) |
Hi @mbercx @chrisjsewell, I'm interested in working on this issue. Would you guys tell me the approach to the problem? |
Hey @pranjalmish1, just to note for others you have expressed interest in the Google Summer of Code (GSOC) 2021. Specifically, you need to adapt the
|
Hello @chrisjsewell, As far as I understand that we have to call the |
For reference, here is the code I use in my workflow to collect the if self.inputs.clean_workdir.value is False:
self.report('remote folders will not be cleaned')
return
cleaned_calcs = []
for called_descendant in self.node.called_descendants:
if isinstance(called_descendant, orm.CalcJobNode):
try:
called_descendant.outputs.remote_folder._clean() # pylint: disable=protected-access
cleaned_calcs.append(called_descendant.pk)
except (IOError, OSError, KeyError):
pass
if cleaned_calcs:
self.report(
f"cleaned remote folders of calculations: {' '.join(map(str, cleaned_calcs))}"
) |
Has there been any progress on this? I see this being a frequently requested feature |
With solution #6756 for issue #6732, this is now possible.
This command, first cleans the directory before deleting the node itself. For this specific behavior one can pass |
Thanks @khsrali! So if I understand correctly in order to have the desired behaviour of this issue, the user would have to run
and then reply |
@mbercx thanks for your feedback. I agree it's not very intuitive. We could also put the main functionality under The reason that I didn't do it, is that a workchain is not a calcjob node but a generic node. update: |
I agree, it's a bit weird to have |
You have me on your back @mbercx (check #6732 (comment)) :3 we move the discussion to there? |
@mbercx we thought about that idea as well, While workdir are properties of nodes not processes, if anything general I'd go with |
Ok to conclude here, and document for anybody who reads this issue and seeks for a solution: There are two potential ways to achieve what this issue is asking for:
Disclaimer for the potential reply of @unkcpz 😅 : |
Is your feature request related to a problem? Please describe
A user on the mailing list wanted to clean the remote directories of all calculation jobs executed within a work chain with
verdi calcjob cleanworkdir
. Currently, this is not possible and I don't think there is a very straightforward way of doing this with the Python API.Describe the solution you'd like
One solution would be to simply add an option, e.g.
--workchains
/-w
, where the user can provide a list of work chain pks/uuids for which they want the remote directories cleaned:The text was updated successfully, but these errors were encountered: