« Return to Thread: Parcellfun leaving defunct processes

Re: Parcellfun leaving defunct processes

by Travis Collier :: Rate this Message:

Reply to Author | View in Thread

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]))

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

[parcellfun.m.2.diff]

Index: parcellfun.m
===================================================================
--- parcellfun.m (revision 5958)
+++ parcellfun.m (working copy)
@@ -87,6 +87,8 @@
     error ("arguments size must match");
   endif
 
+  if (nproc > numel(args{1}) ), nproc = numel(args{1}); endif
+
   ## create communication pipes.
   cmdr = cmdw = resr = resw = zeros (nproc, 1);
   err = 0;


------------------------------------------------------------------------------
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
Octave-dev@...
https://lists.sourceforge.net/lists/listinfo/octave-dev

 « Return to Thread: Parcellfun leaving defunct processes