From: <hi...@us...> - 2010-06-11 05:47:25
|
Revision: 7423 http://octave.svn.sourceforge.net/octave/?rev=7423&view=rev Author: highegg Date: 2010-06-11 05:47:18 +0000 (Fri, 11 Jun 2010) Log Message: ----------- re-seed rand() in parcellfun for each process Modified Paths: -------------- trunk/octave-forge/main/general/inst/parcellfun.m Modified: trunk/octave-forge/main/general/inst/parcellfun.m =================================================================== --- trunk/octave-forge/main/general/inst/parcellfun.m 2010-06-11 01:15:49 UTC (rev 7422) +++ trunk/octave-forge/main/general/inst/parcellfun.m 2010-06-11 05:47:18 UTC (rev 7423) @@ -129,6 +129,9 @@ fflush (stdout); # prevent subprocesses from inheriting buffered output + ## query rand state. + rstat = rand ("state"); + pids = zeros (nproc, 1); ## fork subprocesses @@ -194,6 +197,9 @@ ## the border patrol. we really don't want errors escape after the forks. unwind_protect try + ## re-seed random number state, adjusted for each process + rstat(end-1) -= iproc; + rand ("state", rstat); ## child process. indicate ready state. fwrite (statw, -iproc, "double"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |