Unfortunately, there is no such thing as a reference parallel program. If you measure acceleration for a reference algorithm, which does not mean that all algorithms will benefit from parallelization
Since your target architecture has only 2 cores, you might be better off avoiding parallelization and letting Matlab and the operating system optimize execution. Anyway, here are the steps that I followed.
- Determine if your problem is suitable for parallelization by calculating theoretical acceleration. Some issues, such as matrix multiplication or Gaussian elimination, are well studied. Since I assume that your problem is more complex, try to decompose your algorithm into simple blocks and determine, block by block, the benefits of parallelization.
- If you find that several parts of your algorithms may benefit from parallelization, study this part separately.
- Get statistical information about the runtime of your sequential algorithm. That is, run your program X times under similar conditions (and similar inputs) and average the execution time.
- Get statistical information about the runtime of your parallel algorithm.
- Measure the profiler . Many people recommend using a function like
tic or toc . The profiler will give you a more accurate picture of your work time, as well as detailed information about each function. For more information on how to use the profiler, see the documentation. - Make no mistake by not taking into account the time it takes Matlab to open the workers pool (I assume you are working with the Parallel Computing Toolbox). Depending on your number of employees, the pool takes more / less time, and in some cases it can be up to 1 minute (2011b)!
source share