On Wed, Jun 17, 2009 at 5:58 AM, Travis Collier<[email protected]> wrote:
> One more thing for parcellfun. If nproc > the number of jobs, it
> breaks in a not nice way.
>
> a = parcellfun(4, @(x) (x+1), num2cell([1:2]))
>
> A bit more complete test:
> a = parcellfun(4, @(x,y) (x+y), num2cell([1:2]), num2cell([1:2]))
Ah, I see, there was a bug in handling processes that never recieve
jobs. Got that fixed now. Thanks!
> Easy one line fix as the last thing in the argument checking (just
> after the "arguments size much match" block):
> if (nproc > numel(args{1}) ), nproc = numel(args{1}); endif
>
> patch attached anyway
>
In fact the bug was deeper; it can happen (though it's extremely
unlikely) than when you have 3 jobs and 3 processes, for whatever
reason the distribution will be 2-1-0 in which case the bug would have
still occured.
But cutting the excessive processes is surely a good idea anyway, so I
applied the patch, then after some thought
I simplified that a little to
nproc = min (nproc, numel (args{1}));
so, parcellfun is a bit smarter again. Thanks.
regards
--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev