Must have valid initData to build channel

I have a parallel Matlab of 56 workers, I get the following error as I increase the upper (end) value of the parfor loop.
"Must have valid initData to build channel"
Can you please help me to solve this problem
Thanks

1 个评论

This is an internal consistency error and definitely not expected - do you have any reproduction steps that you can post?

请先登录,再进行评论。

回答(3 个)

Thanks for the reply. I get the error message, "Must have valid initData to build channel" I run the code below
-------------------------------------------------------------------------------------------------------------
patd = 'C:\PhaseFluctuations_Data\Paper_data\DataSLmV1L01km_Dmat200';
Psmat = load(patd,'-mat');Psmat = Psmat.Psmaty;Psmat = imag(Psmat);
iatla = 201;nreals = 2000;nreals = 50;%PsL01 = [];
parfor is = 1:nreals
PsL01(:,:,is) = Psmat(iatla*(is -1) + 1:is*iatla,1:iatla);
end
---------------------------------------------------------------------------------------------------------------------------
Notes
1) Error does not occur, if "nreals" = 10, but error occurs when "nreals" is changed to 50 or higher.
2) Psmat is a matrix of 402000 x 200 elements and the loop attempts to rearrange this matrix into 200 x 200 x 2000
3) No error is generated if "for" is used instead of "parfor"
I expect this is a misleading error as a consequence of running out of memory on the workers. You're duplicating Psmat and attempting to put a full copy of it on each of your 56 workers. (By restricting nreals, you're limiting the number of workers used).
I doubt this sort of manipulation is a good fit for parfor in any case. You might be better off doing:
permute(reshape(Psmat.', 200, 200, 2000), [2 1 3])
or something similar. Here's my vastly-simplified example:
>> data = [ 1, 2; 3, 4; 11, 12; 13, 14; 101, 102; 103, 104]
data =
1 2
3 4
11 12
13 14
101 102
103 104
>> permute(reshape(data.', 2, 2, 3), [2 1 3])
ans(:,:,1) =
1 2
3 4
ans(:,:,2) =
11 12
13 14
ans(:,:,3) =
101 102
103 104

类别

帮助中心File Exchange 中查找有关 Parallel Computing Fundamentals 的更多信息

产品

版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by