Parallel Computing Toolbox(PCT)

Parallel Computing Toolbox(PCT)通过MATLAB客户端与工作进程协调,实现循环并行执行。parfor适用于独立迭代的任务,避免全局变量以防止数据依赖。在parfor中,区分积累变量和临时变量。使用PCT在多核桌面电脑上开发后,可在MATLAB Distributed Computing Server扩展到多计算机集群。客户端、工作进程和MATLAB作业调度器共同作用,确保版本兼容和任务分配。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Parfor篇
The MATLAB client (where the parfor is issued) coordinates with MATLAB workers comprising a parallel pool, so that the loop iterations can be executed in parallel on the pool. The necessary data on which parfor operates is sent from the client to workers, where most of the computation happens, and the results are sent back to the client and pieced together.
Each execution of the body of a parfor-loop is an iteration.
如果循环内有一个迭代是依赖于另一个迭代的,那么这个循环不可以用parfor来实现。也因此,parfor不可以处理global变量,因为这个变量的值可能会在运行过程中被其他的迭代修改,造成不同的迭代之间的数据依赖,让程序出现意想不到的结果。
在parfor环境下,有四种变量:
1. accumulate variable:
2. temporary variable: 它可能在不同的parfor迭代(index)下有不同的值,例如,任何仅仅依赖于index并且不属于accumulate变量的变量。在运行完parfor所有迭代后,它的值无法确定,因此不保存。However, suppose you use a nonindexed variable inside the loop, or a variable whose indexing does not depend on the loop variable i.
2.

Matlab Distributed Computing Server篇
“You develop your program or model on a multicore desktop computer

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值