Error with the Parallel package
Sayed Mohammad Badiezadegan <[email protected]> Sun, 19 Jan 2025 18:46:56 -0800
| Newsgroups | gmane.comp.gnu.octave.general |
|---|---|
| Message-ID | <CADMcpTYaG_4R845uOZVyEwAfZbz4gpOnWGsh07rpqSW0vk0a=A@mail.gmail.com> |
--===============2577038879410471088==
Content-Type: multipart/alternative; boundary="000000000000b57855062c1a4639"
--000000000000b57855062c1a4639
Content-Type: text/plain; charset="UTF-8"
Hi everybody,
I was installed the parallel package, then loaded and finally run the the
following simple code on the latest Octave (9.3.0):
% Simplified stress test
num_cores = nproc();
test_duration = 60;
disp(['Starting stress test on ', num2str(num_cores), ' cores']);
disp(['Duration: ', num2str(test_duration), ' seconds']);
% Simplified stress function
function result = stress_task(~)
A = rand(500, 500); % Smaller matrix
for i = 1:50
A = A * A;
end
result = sum(A(:)); % Dummy result
end
try
tic;
pararrayfun(num_cores, @stress_task, 1:num_cores, "VerboseLevel", 1);
disp('Stress test completed.');
catch err
disp('Error occurred during parallel execution:');
disp(err.message);
end
But I got this error message:
Starting stress test on 4 cores
Duration: 60 seconds
execution error
Error occurred during parallel execution:
__parcellfun_get_next_result__: could not receive result
>>
How can I resolve this problem?
Thank you!
--000000000000b57855062c1a4639
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi everybody,<div><br></div><div>I was installed the paral=
lel package, then loaded and finally run the the following simple code on t=
he latest Octave (9.3.0):</div><div><br></div><div><font face=3D"monospace"=
>% Simplified stress test<br>num_cores =3D nproc();<br>test_duration =3D 60=
;<br><br>disp(['Starting stress test on ', num2str(num_cores), '=
; cores']);<br>disp(['Duration: ', num2str(test_duration), '=
; seconds']);<br><br>% Simplified stress function<br>function result =
=3D stress_task(~)<br>=C2=A0 =C2=A0 A =3D rand(500, 500); =C2=A0% Smaller m=
atrix<br>=C2=A0 =C2=A0 for i =3D 1:50<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 A =3D =
A * A;<br>=C2=A0 =C2=A0 end<br>=C2=A0 =C2=A0 result =3D sum(A(:)); =C2=A0% =
Dummy result<br>end<br><br>try<br>=C2=A0 =C2=A0 tic;<br>=C2=A0 =C2=A0 parar=
rayfun(num_cores, @stress_task, 1:num_cores, "VerboseLevel", 1);<=
br>=C2=A0 =C2=A0 disp('Stress test completed.');<br>catch err<br>=
=C2=A0 =C2=A0 disp('Error occurred during parallel execution:');<br=
>=C2=A0 =C2=A0 disp(err.message);<br>end</font><br></div><div><br></div><di=
v>But I got this error message:</div><div><br></div><div><font face=3D"mono=
space">Starting stress test on 4 cores<br>Duration: 60 seconds<br>execution=
error<br>Error occurred during parallel execution:<br>__parcellfun_get_nex=
t_result__: could not receive result<br>>></font></div><div><font fac=
e=3D"monospace"><br></font></div><div><font face=3D"arial, sans-serif">How =
can I resolve this problem?</font></div><div><font face=3D"arial, sans-seri=
f"><br></font></div><div><font face=3D"arial, sans-serif">Thank you!</font>=
</div></div>
--000000000000b57855062c1a4639--
--===============2577038879410471088==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline
Ci0tLS0tLS0tLS0KV2UgYXJlIHRyYW5zaXRpb25pbmcgdG8gYSB3ZWIgYmFzZWQgZm9ydW0KZm9y
IGNvbW11bml0eSBoZWxwIGRpc2N1c3Npb25zIGF0Cmh0dHBzOi8vb2N0YXZlLmRpc2NvdXJzZS5n
cm91cC9jL2hlbHAK
--===============2577038879410471088==--