Filter löschen
Filter löschen

Starting and executing code in parallel is slower than expected

1 Ansicht (letzte 30 Tage)
Ahmed
Ahmed am 27 Okt. 2017
Kommentiert: Ahmed am 30 Okt. 2017
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
parpool('local',6);
takes about 15 seconds and submitting parallel jobs such as
pev = [];
for i=1:50
pev(i) = parfeval(@(A), ...); % code
end
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
parpool('local',6);
took 150 seconds. The server was otherwise idle.
How can I approach this problem?
  2 Kommentare
Edric Ellis
Edric Ellis am 30 Okt. 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
Ahmed am 30 Okt. 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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Parallel Computing Fundamentals finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by