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

networkanalysis: use parfor instead of for #2069

Merged
merged 4 commits into from Sep 22, 2022

Conversation

AljenU
Copy link

@AljenU AljenU commented Jul 1, 2022

With some small adaptations, it is possible to use a parfor loop in
ft_networkanalysis. This potentially speeds up the calculation, when the
parallel computing toolbox is available.

Possibly, this could be further sped up by converting the nested loops into
a single parfor loop. However, this requires a good benchmark testcase to be
available, to test the difference.

Tested with https://github.com/AljenU/fieldtrip-parallel-support/tree/additional_tests, however no tests were found that take more than a few seconds on ft_networkanalysis, making it hard to actually compare performance.
Output has been tested by comparing the saved output of ft_bench_04_networkanalysis_01.

With some small adaptations, it is possible to use a parfor loop in
ft_networkanalysis. This potentially speeds up the calculation, when the
parallel computing toolbox is available.

Possibly, this could be further sped up by converting the nested loops into
a single parfor loop. However, this requires a good benchmark testcase to be
available, to test the difference.
Setting this limit to 0 will make the execution non-parallel
When input has only two dimensions, outsiz(4) did not exist. Calling size(input, 4) on a 2D input returns 1. Fix so outsiz, and new inputsize variable, always have 4 entries.
@AljenU AljenU changed the base branch from master to parallel September 22, 2022 07:52
@robertoostenveld robertoostenveld merged commit 5c46c80 into fieldtrip:parallel Sep 22, 2022
@robertoostenveld robertoostenveld moved this from In progress to Done in FieldTrip performance improvements Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants