Must have valid initData to build channel

5 views (last 30 days)
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 Comment
Edric Ellis
Edric Ellis on 4 Jul 2019
This is an internal consistency error and definitely not expected - do you have any reproduction steps that you can post?

Sign in to comment.

Answers (3)

Halil Eyyuboglu
Halil Eyyuboglu on 4 Jul 2019
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"

Edric Ellis
Edric Ellis on 5 Jul 2019
Edited: Edric Ellis on 5 Jul 2019
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

Halil Eyyuboglu
Halil Eyyuboglu on 5 Jul 2019
Thanks, this solves my problem.

Categories

Find more on Parallel Computing Toolbox in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!