matlab - 了解多核、多处理器和 MPI 上的 MATLAB

标签 matlab parallel-processing mpi

关于 MATLAB 如何利用并行硬件,我有几个密切相关的问题。它们很短,所以我认为最好将它们放在同一个帖子中:

  • 使用 Parallel Computing Toolbox 时,MATLAB 是否利用/受益于多核? ?
  • 使用 PCT 时,MATLAB 是否利用/受益于多个处理器? ?
  • MATLAB 是否使用 MPI使用PCT
  • MATLAB 是否使用 MPI使用 PCT 时?

最佳答案

Does MATLAB leverage/benefit from multiple cores when not using the Parallel Computing Toolbox?

是的。 Since R2007a ,越来越多的内置函数被重写为多线程(尽管多线程只有在有益时才会启动)。

Element Wise Functions and Expressions:
------------------------------------------------------------------------------------------------
Functions that speed up for double arrays > 20k elements 

1) Trigonometric: ACOS(x), ACOSH(x), ASIN(x), ASINH(x), ATAN(x), ATAND(x), ATANH(x), COS(x), COSH(x), SIN(x), SINH(x), TAN(x), TANH(x)

2) Exponential: EXP(x), POW2(x), SQRT(x)

3) Operators: x.^y
For Example: 3*x.^3+2*x.^2+4*x +6, sqrt(tan(x).*sin(x).*3+8);

Functions that speed up for double arrays > 200k elements 

4) Trigonometric: HYPOT(x,y), TAND(x)

5) Complex: ABS(x)

6) Rounding and remainder: UNWRAP(x), CEIL(x), FIX(x), FLOOR(x), MOD(x,N), ROUND(x)

7) Basic and array operations: LOGICAL(X), ISINF(X), ISNAN(X), INT8(X), INT16(X), INT32(X)

Linear Algebra Functions: 
------------------------------------------------------------------------------------------------
Functions that speed up for double arrays > 40k elements (200 square) 


1)Operators: X*Y (Matrix Multiply), X^N (Matrix Power)

2)Reduction Operations : MAX and MIN (Three Input), PROD, SUM

3) Matrix Analysis: DET(X), RCOND(X), HESS(X), EXPM(X)

4) Linear Equations: INV(X), LSCOV(X,x), LINSOLVE(X,Y), A\b (backslash)

5) Matrix Factorizations: LU(X), QR(X) for sparse matrix inputs

6) Other Operations: FFT and IFFT of multiple columns of data, FFTN, IFFTN, SORT, BSXFUN, GAMMA, GAMMALN, ERF,ERFC,ERFCX,ERFINV,ERFCINV, FILTER

不过,对于作为 .m 文件实现的代码,多核无济于事。

当然,多线程 mex 文件也会受益。

Does MATLAB use MPI when not using the PCT?

据我所知。

Does MATLAB use MPI when using the PCT?

是的,当您在集群上运行它时(尽管您也可以使用其他调度程序)。为此,您需要 Matlab 分布式计算服务器许可证的许可证。我不知道本地调度器使用什么架构(你在本地机器上运行并行作业时使用的架构);鉴于 MPI 功能是 PCT 的一部分,这表明他们至少可以将其用于部分功能。 编辑:参见@Edric's answer for more details

关于matlab - 了解多核、多处理器和 MPI 上的 MATLAB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8016134/

相关文章:

c++ - MPI_Scatter 会减慢代码速度吗?

matlab 不允许 sinc(0)

matlab - 在Matlab中初始化结构

bash - 在 bash 中并行执行作业

r - Snow如何将列表元素分配给worker?

windows - 并行化具有多个导出点的算法?

c++ - 如果 recv 和 send 匹配,mpi 请求是否完成

c - 如何使用 Eclipse 在 Windows 上构建基于 C 的 MPI 程序?

matlab - 如何根据引脚连接获取 Simulink block 的顺序?

java - 通过独立应用程序进行图像处理