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

Move resource validation of CalcJob from global validator to port itself #3431

Closed
sphuber opened this issue Oct 16, 2019 · 2 comments · Fixed by #3702
Closed

Move resource validation of CalcJob from global validator to port itself #3431

sphuber opened this issue Oct 16, 2019 · 2 comments · Fixed by #3702
Assignees
Milestone

Comments

@sphuber
Copy link
Contributor

sphuber commented Oct 16, 2019

The metadata.options.resources of a CalcJob are validated by a validator on the global inputs namespace of the process. This makes it difficult for sub classes to control this behavior. If a sub class wants to make the resources optional, for example to implement automatic parallelization that would set the resources automatically, the validation would always fail.

@sphuber sphuber added this to the v1.0.0 milestone Oct 16, 2019
@sphuber sphuber self-assigned this Oct 16, 2019
@sphuber
Copy link
Contributor Author

sphuber commented Oct 16, 2019

A problem might be that currently the validation of the resources requires the Computer that will be used as input of the CalcJob. The spec of a validator currently only passes the value that is passed for the port itself. There is no context. So the validator of metadata.options.resources will not have access to the computer passed elsewhere in the inputs. This would require a change in the validator signature and handling of plumpy.

@sphuber
Copy link
Contributor Author

sphuber commented Oct 17, 2019

The required change in the validator signature and calling in plumpy is discussed here: aiidateam/plumpy#126

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

Successfully merging a pull request may close this issue.

1 participant