[BUG] n_jobs=-1 not working in spectral_connectivity_epochs #177
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.
Suggested fix for #176 where
n_jobs=-1
does not result in CSD computation being properly parallelised over epochs.This fix makes sure
n_jobs=-1
is converted to the maximum number of workers before CSD computation occurs.I think also when refactoring some of the multivariate connectivity methods some months ago the
n_jobs
parameter was not being properly passed to the classes. This is also now fixed.As far as I understand, these issues are specific to
spectral_connectivity_epochs()
and do not affectspectral_connectivity_time()
.The current unit tests for parallelisation were only using
n_jobs > 1
and nevern_jobs=-1
. However, even ifn_jobs=-1
was being used this issue would not be caught, as the tests only check that multiple workers can be allocated (which they can) but not that e.g. the proper number of epoch blocks are worked on in parallel.Not sure how this could be checked. Is there some way the logging output could be queried?