Starting and executing code in parallel is slower than expected

1 view (last 30 days)
I installed MATLAB 2016a on three systems with different hard- and software and would like to use the Parallel Computing Toolbox. On one system I observed inexplicably low performance. Now I'm looking for hints for possible causes and would be very grateful for hints. The systems are as follows:
  • System 1: CentOS 7, 24/24 cores/threads, 256GB RAM
  • System 2: Ubuntu 16.04, 16/32 cores/threads, 64GB RAM
  • System 3: Ubuntu 16.04, 12/24 cores/threads, 96GB RAM
On System 1 and and System 2, the initialisation and parallel execution of parallel code runs as expected. For instance, initialization of the parallel pool
takes about 15 seconds and submitting parallel jobs such as
pev = [];
for i=1:50
pev(i) = parfeval(@(A), ...); % code
takes less than a second and during the asynchronous computation the N cores are well occupied. However, on System 3 (that has the same Ubuntu Version as System 2) submitting the parallel jobs takes almost 3 minutes and execution of the jobs consumes much more RAM than on the other systems. To exclude performance issues related to copying of complicated environments (e.g. file handles, anonymous functions, etc.), I created the pool right after launching Matlab and avoided any inclusion of additional paths (i.e. path contained only the Matlab Toolboxes). The call
took 150 seconds. The server was otherwise idle.
How can I approach this problem?
Edric Ellis
Edric Ellis on 30 Oct 2017
Hm, is there anything different about where MATLAB is installed on System 3? Usually, local pool creation time with only 6 workers is dominated by the time taken to launch the worker MATLAB processes. What happens if you try and launch 6 copies of MATLAB simultaneously on System 3?
Ahmed on 30 Oct 2017
@EdricEllis Thanks for your feedback. In System 3 Matlab is installed on local storage. System 3 is arguably the overall "slowest" system, but should not be an order of magnitude slower. We installed Matlab R2016b. Starting parpool on Matlab R2016b takes a bit longer than on the other systems, but execution of the parallel threads works as expected (i.e. the computation decreases linearly with the number of cores). Here is a result of a quick test (the system was under partial but constant load during the repeated test)
R2016a/bin/matlab -r 'tic;parpool('local',5);toc;exit'
took 130 seconds, whereas
R2016b/bin/matlab -r 'tic;parpool('local',5);toc;exit'
took about 40 seconds.
After further investigation I realised a minor difference in the code I executed and I pre-loaded the system glibstdc++ (on all systems), possibly squeeing the comparison. As it stands, starting the pool on R2016a takes significantly longer than R2016b on the same system, but I could not yet verify that execution of the exact same code is significantly slower as well.

Sign in to comment.

Answers (0)


Find more on Parallel Computing Fundamentals in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!