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

PwBaseWorkChain: fix bug in validate_resources validator #683

Merged
merged 1 commit into from
May 7, 2021

Commits on May 7, 2021

  1. PwBaseWorkChain: fix bug in validate_resources validator

    The `validate_resources` outline step would check that the
    `metadata.options` namespace included at least the input
    `resources.num_machines` and `max_wallclock_seconds` as long as the
    automatic parallelization feature was not enabled. This was added when
    the workchain was first developed, because the scheduler resources were
    not validated on the base `CalcJob` in `aiida-core`.
    
    However, since `aiida-core==1.0.0` the scheduler resources are validated
    on the `CalcJob` base class. This means that a `PwBaseWorkChain` will
    now not even be instantiated if the resources for the `PwCalculation`
    are insufficient, so it is better to leave the validation up to the base
    class.
    
    What is worse, the logic in `validate_resources` is actually incorrect
    as it assumed that the resources always need to include `num_machines`.
    However, this is not the case as it is actually `Scheduler`
    implementation specific, and for example for the `SgeScheduler` this
    field is even prohibited and will raise when specified. This made that
    the `PwBaseWorkChain` was fundamentally incompatible with those
    schedulers before this fix.
    
    The `PhBaseWorkChain` suffered from the same bug and has also been
    fixed.
    sphuber committed May 7, 2021
    Configuration menu
    Copy the full SHA
    e1b6489 View commit details
    Browse the repository at this point in the history