MATLAB GPU Parallel Loops Error: Error caught during construction of remote parfor code
MATLAB GPU Parallel Loops Error: Error caught during construction of remote parfor code
所以我一直在尝试 运行 一个包含 GPU 数组的 parfor 循环,即使 MATLAB 计算了结果,也会弹出以下错误。我读过当传递的数据量很大时会发生类似的错误,但是,这里的每个数组都有 500 个整数,只是为了确保我尝试将数组的大小减少到 100,而且仍然发生同样的事情,我在不使用 parfor 的情况下尝试 运行ning 并且它工作正常。
Warning: Error caught during construction of remote parfor code.
The parfor construct will now be run locally rather than on the remote parallel pool.
The most likely cause of this is an inability to send input arguments
to the workers because of a serialization error.
The error report from the caught error is:
No method 'acquireLabs' with matching signature found for class
'com.mathworks.toolbox.distcomp.pmode.ParforControllerImpl'.
Error in distcomp.remoteparfor (line 72)
obj.NumWorkers = p.acquireLabs(int32(maxLabsToAcquire));
Error in parallel_function>iMakeRemoteParfor (line 1060)
P = distcomp.remoteparfor(pool, W, @make_channel, parfor_C);
Error in parallel_function (line 444)
[P, W] = iMakeRemoteParfor(pool, W, parfor_C);
我的代码是这样的...
parfor s = 1:part
temp1 = temp_rand(s)<=p;
temp3 = temp1-[0 temp1(1:end-1)];
temp4 = update_part.*temp3;
p_temp(s)=sum(temp4);
end;
p=p_temp+dist_div*temp5;
除了 dist_div
之外都是 500 的数组。
当循环范围是 gpuArray
时,这看起来像是 parfor
实现中的一个问题。您可以通过 运行
来解决这个问题
parfor s = 1:gather(part)
...
end
所以我一直在尝试 运行 一个包含 GPU 数组的 parfor 循环,即使 MATLAB 计算了结果,也会弹出以下错误。我读过当传递的数据量很大时会发生类似的错误,但是,这里的每个数组都有 500 个整数,只是为了确保我尝试将数组的大小减少到 100,而且仍然发生同样的事情,我在不使用 parfor 的情况下尝试 运行ning 并且它工作正常。
Warning: Error caught during construction of remote parfor code. The parfor construct will now be run locally rather than on the remote parallel pool. The most likely cause of this is an inability to send input arguments to the workers because of a serialization error. The error report from the caught error is:
No method 'acquireLabs' with matching signature found for class 'com.mathworks.toolbox.distcomp.pmode.ParforControllerImpl'.
Error in distcomp.remoteparfor (line 72) obj.NumWorkers = p.acquireLabs(int32(maxLabsToAcquire));
Error in parallel_function>iMakeRemoteParfor (line 1060) P = distcomp.remoteparfor(pool, W, @make_channel, parfor_C);
Error in parallel_function (line 444) [P, W] = iMakeRemoteParfor(pool, W, parfor_C);
我的代码是这样的...
parfor s = 1:part
temp1 = temp_rand(s)<=p;
temp3 = temp1-[0 temp1(1:end-1)];
temp4 = update_part.*temp3;
p_temp(s)=sum(temp4);
end;
p=p_temp+dist_div*temp5;
除了 dist_div
之外都是 500 的数组。
当循环范围是 gpuArray
时,这看起来像是 parfor
实现中的一个问题。您可以通过 运行
parfor s = 1:gather(part)
...
end