我想知道在执行 parfor 时是否可以在节点之间交易(发送和接收)数据。我想要完成的是这样的:
parfor i = 1:4
%Perform a computation on each column of a 4x4 matrix on 4 different workers (each worker takes one column).
%Make Worker #1 send its data to Worker #3, Worker #3 to Worker #1, Worker #2 ro Worker #4 and Worker #4 to Worker #2.
%Make other computations on the data received from the other workers
end
我想在不离开 parfor 的情况下执行所有这些计算。我可以使用任何 MPI 命令吗?这是可以实现的吗?如果是这样,我怎么能做到这一点?谢谢!