Parallel Computing communication overload

1 次查看(过去 30 天)
Hi, I am now running my code on the university local server in which I could connect 64 workers (local). However, compared to the performance in my laptop with 4 workers, the speed gains is roughly 60%. I notice that when starting parfor in the server, it takes a very long time to "throw" these processes to the workers while in my laptop it is generally very fast. Can anyone explain to me why and are there any suggestions to improve the performance? Thanks!

回答(1 个)

William Zhou
William Zhou 2019-3-19
When comparing comparison between the Parallel Computing Toolbox (PCT) and MATLAB Distributed Computing Server (MDCS), please keep in mind the following:
  1. Contention for resources: network and computing. If the network of worker machines has low bandwidth or high latency, computation could be slowed.
  2. Hardware and/or platform difference may be a large contributor to the performance difference.
  3. Measure only the time spent executing the computating routing will show the performance discrepancy due to hardware.
  4. A worker by default runs single-threaded, whether the worker is hosted locally or on a cluster, even if the MATLAB functions used support multi-threading. Therefore it may not be always fair to compare the performance of a FOR loop with a PARFOR if the computating routine that uses largely functions that supports multithreading. This is because the overhead involved with using a new process (worker) is much larger than a new thread.
  5. Passing parameters. Parameters are automatically passed to worker machines during the execution of parallel computations. If there are a large number of parameters, or they take a large amount of memory, passing them may slow the execution of your computation.
You may also be interested in the following resources on profiling and optimizing your parallel computing performance:

类别

Help CenterFile Exchange 中查找有关 MATLAB Parallel Server 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by