File Exchange

image thumbnail


version (4.26 KB) by mevans
Easy to use parallel evaluation of multiple code blocks.


Updated 24 Apr 2016

View Version History

View License

This function allows you to evaluate multiple code blocks in parallel. It is intended as a user friendly interface to parfeval which I hope will one day be made obsolete by a matlab built-in (like parfor). On my laptop, the parallel overhead is about 30ms per task.
An example usage, which executes 2 code blocks in parallel:
nn = 4;
% do the first set
{'r1 = rand(nn, nn);'
'r2 = magic(nn);'
'r3 = rand(nn, nn);'}

% do the second set
{'r4 = rand(nn, nn);'
'r5 = rand(nn, nn);'
'r6 = magic(nn);'} })

Cite As

mevans (2020). pareval (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)


What is the difference between this and 'parfeval'?

Could you use this to execute multiple arbitrary heterogeneous code blocks (that aren't necessarily functions)? Could you use this as a convenient version of the 'spmd' statement?



If you use this, please comment!

I will be happy to fix any problems encountered (at least for a month or so from the last release date).

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!