lizmat / ParaSeq

Smarter parallel execution of Iterables
https://raku.land/zef:lizmat/ParaSeq
Artistic License 2.0
6 stars 0 forks source link

on a machine with just 1 or 2 cores, hyperize throws an exception #3

Open timo opened 5 months ago

timo commented 5 months ago

stumbled upon this while doing an rr record of a run of App::Ecosystems.

rr tells the program it's recording that there are two cores (Kernel.cpu-cores is 2, Kernel.cpu-cores-but-one is 1), unless you use the --chaos flag where the number of cores is randomized, or --num-cores to set a custom value.

the hyper method uses cpu-cores-but-one's output as the default hyper parameter unless one is specified, but it can be 1, and then this exception is thrown:

Invalid value '1' for :degree on method hyper
  in method hyper at /var/home/timo/raku/prefix/share/perl6/site/sources/140A8F9931ADE3D89A19D7E16699DF4A691FB614 (ParaSeq) line 2212
  in sub hyperize at /var/home/timo/raku/prefix/share/perl6/site/sources/140A8F9931ADE3D89A19D7E16699DF4A691FB614 (ParaSeq) line 2257
  in sub from-json-hyper at /var/home/timo/raku/prefix/share/perl6/site/sources/6056E01D63014A1270E09DDB66471BB4373103D4 (JSON::Fast::Hyper) line 18
  in method update-meta-from-json at /var/home/timo/raku/prefix/share/perl6/site/sources/8BACFB50B5B46DB329BF38632032BE5BC3AE3A70 (Ecosystem) line 215
  in submethod TWEAK at /var/home/timo/raku/prefix/share/perl6/site/sources/8BACFB50B5B46DB329BF38632032BE5BC3AE3A70 (Ecosystem) line 73
  in method load-ecosystem at /var/home/timo/raku/prefix/share/perl6/site/sources/373FC785D396D0DF9D90D1BFFD789F3748B259AC (App::Ecosystems) line 960
  in method run at /var/home/timo/raku/prefix/share/perl6/site/sources/373FC785D396D0DF9D90D1BFFD789F3748B259AC (App::Ecosystems) line 987
  in sub ecosystems at /var/home/timo/raku/prefix/share/perl6/site/sources/373FC785D396D0DF9D90D1BFFD789F3748B259AC (App::Ecosystems) line 1009
  in block <unit> at bin/ecosystems line 3
autobakterie commented 3 months ago

Possibly related installation unit test error (Linux on 2 CPU cores, no hyperthreading):

===> Testing: ParaSeq:ver<0.2.7>:auth<zef:lizmat>
[ParaSeq] Invalid value '1' for :degree on method hyper
[ParaSeq]   in method hyper at <REDACTED_PATH> (ParaSeq) line 2212
[ParaSeq]   in sub hyperize at <REDACTED_PATH> (ParaSeq) line 2261
[ParaSeq]   in block <unit> at t/01-basic.rakutest line 12
[ParaSeq]     # Failed test 'expected code to fail but it threw X::Invalid::Value instead'
[ParaSeq]     # at SETTING::src/core.c/Mu.rakumod line 1120
[ParaSeq]     # You failed 1 test of 2
[ParaSeq] # Failed test 'did we fails-like X::Cannot::Lazy?'
[ParaSeq] # at t/03-elems.rakutest line 20
[ParaSeq] Invalid value '1' for :degree on method hyper
[ParaSeq]   in method hyper at <REDACTED_PATH> (ParaSeq) line 2212
[ParaSeq]   in sub hyperize at <REDACTED_PATH> (ParaSeq) line 2257
[ParaSeq]   in block <unit> at t/03-elems.rakutest line 25
[ParaSeq] Invalid value '1' for :degree on method hyper
[ParaSeq]   in method hyper at <REDACTED_PATH> (ParaSeq) line 2212
[ParaSeq]   in sub hyperize at <REDACTED_PATH> (ParaSeq) line 2261
[ParaSeq]   in block <unit> at t/14-BufferIterator.rakutest line 10
[ParaSeq] Invalid value '1' for :degree on method hyper
[ParaSeq]   in method hyper at <REDACTED_PATH> (ParaSeq) line 2212
[ParaSeq]   in sub hyperize at <REDACTED_PATH> (ParaSeq) line 2261
[ParaSeq]   in block <unit> at t/15-ParaIterator.rakutest line 10
[ParaSeq] # You planned 39 tests, but ran 38
===> Testing [FAIL]: ParaSeq:ver<0.2.7>:auth<zef:lizmat>
Aborting due to test failure: ParaSeq:ver<0.2.7>:auth<zef:lizmat> (use --force-test to override)