How can I solve the problem of communications of workers?

조회 수: 1 (최근 30일)
Jorge Luis Abril Benjumea
Jorge Luis Abril Benjumea 2019년 10월 3일
답변: Jorge Luis Abril Benjumea 2019년 10월 5일
I am trying to paralelize my Genetic Algorith Code, using codistributed function of matlab, but shows this error.. UndefinedFunction error was thrown on the workers for 'sizeofChrome_dis_local'. This may be because the file containing 'sizeofChrome_dis_local' is not accessible on the workers. I introduced a number of chromosomes of 8 and genes 2 and use a simple function as ObjFunction= @Sphere.
I appreciate any support information
Here are some lines of the code....
spmd
Chrom_dis= codistributed(Chrom, codistributor1d(1));
Chrom_dis_local= getLocalPart(Chrom_dis);
sizeofChrom_dis_local= size(Chrom_dis_local, 1);
for i=1:sizeofChrome_dis_local
Obj_local(i)= ObjFunction(Chrom_dis_local(i,:));
end
end

답변 (2개)

Edric Ellis
Edric Ellis 2019년 10월 3일
In your code, you define "sizeofChrom_dis_local", but then try to loop over "sizeofChrome_dis_local" - note the extra "e". That's probably the problem.

Jorge Luis Abril Benjumea
Jorge Luis Abril Benjumea 2019년 10월 5일
Thank you Edric for your feedback

카테고리

Help CenterFile Exchange에서 Distributed Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by