Catalog
  1. 1. Simple Introduction
MATLAB Parallel Computing Summary

Simple Introduction

In MATLAB we just need to use ‘parfor’ to realize parallel computing. Here is a simple example

1
poolnum=10; % numbers of kernels
2
kernum=parpool(poolnum)
3
parfor l=1:numloop
4
%do something here
5
end
6
delete(kernum)
7
%the delete step is very important because in cluster we may use  more than a dozen cores.If we stop the program directly without closing the parallel pool, the cluster may crash or take a long time to become normal.
Author: Knifelee
Link: https://knifelees3.github.io/2019/04/17/A_En_MATLAB_ParallelComputing/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Donate
  • 微信
  • 支付寶

Comment