Skip to content
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

Feature/relax code agn wc #261

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

bosonie
Copy link
Collaborator

@bosonie bosonie commented Feb 2, 2022

Introduces a code agnostic relaxation workchain.
This implementation should be the central piece where to introduce overrides.

The code agnostic relax workchain is a workchain wrapping a
`<Code>CommonRelaxInputGenerator` and the corresponding
`<Code>CommonRelaxWorkChain`. The implementation (<Code>)
to be used is selected through the input `relax_sub_process_class`.
The purpose of the workchain is twofolded:
1) Transform the inputs of `<Code>CommonRelaxInputGenerator.get_builder()`
   (the common interface among codes) into workchain inputs (therefore
   storable). This presents the challenge to change the valid type
   accepted by the interface from standard python types to Data types.
2) Implement a robust mechanism to handle "overrides", meaning
   the possibility for code experts to reset code dependent parameters
   that have been provided by the protocols.
Only for clarifying the interface!
Code and plugin to use are hard coded!
1) The spec of the `CommonRelaxWorkChain` has been modified to
   prevent the call to the command exposing the inputs of the
   `_process_class` when this attribute is not yet defined.
   this fix the bug that was preventing the possibility to expose
   the outputs of `CommonRelaxWorkChain` into the `_relax.RelaxWorkChain`
2) Added the input `reference_workchain_remote_folder`. This is a
   workaround to the fact that the `WorkChainNodes` are not accepted as
   inputs of a workchain.
   We substitute it with the `reomote_folder` now returned by
   `CommonRelaxWorkChain`
Now the overrides are specified as a list of dictionaries.
Every dictionary must contain an "entrypoint" keyword and
a "kwargs" keyword.
A system of entry-points for overrides functions has been set up
This guarantees to return any possible output of the
implementation of the `CommonRelaxWorkChains`
@bosonie
Copy link
Collaborator Author

bosonie commented Feb 2, 2022

@sphuber @giovannipizzi
The implementation should be now concluded, with the caveats below:

  1. The issue The serializer of an aiida processes is not applied to Datas. Reconsider the decision? aiida-core#5342 explains the difficulty I had in implementing our idea to serialize the content of the overrides input. This input expects a list of dictionaries and it might be possible that a dictionary would contain a Node as value. Since nodes are not storable as elements of List or Dict, the serializer is used to convert the node into his uuid. This ideas works well if the user passer a list as overrides. However if a List is passed instead, the serialization is skipped (see issue linked). This must be fixed somehow, but let's discuss in the issue.
  2. For the moment I just implemented three generic overrides. The rest will come soon.
  3. The example I created is not very useful since, as it is, it works only in my environment. Some details must be changed inside to run in other cases. It is just there for your understanding. I will make it general in the future.
  4. I made dynamic the entire outputs namespace. So any possible output of a CommonRelaxWorkChain implementation is automatically returned.
  5. I still have to make the tests for the new workchain. I want a feedback from you first.

In conclusion, you can start to have a look, I will be happy to receive feedback, but not completely ready for merging yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant