Fix error for negative n_processes
input in MultiprocessingEvaluator
#189
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR #140 introduced a feature for the MultiprocessingEvaluator to take a negative input for
n_processes
, which initialize the evaluator with thecpu_count
minus that negative integer, leaving that number of cores free.In 7dd1610 this code was refactored, introducing a bug that broke the negative-integer input functionality. When a negative integer is inputted, a
AttributeError: 'MultiprocessingEvaluator' object has no attribute 'n_processes'
was created.The bug was caused by
self.n_processes
begin used instead ofn_processes
, where in earlier codeself.n_processes
was set equal ton_processes
earlier in the process.This commit fixes this behaviour by using
n_processes
to calculateself.n_processes
.Closes #188.
Unfortunately this bug landed in the EMAworkbench 2.2.0 release. I would suggest creating a small bugfix release 2.2.1, in which we include the fixes for this issue (#188), the fix (#161) for the prim logging bug (#155) and the fix (b25f9bd+#183) for the 3-dimensional output saving issue (#168).