Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information