From: <i7...@us...> - 2009-03-30 15:04:13
|
Revision: 5666 http://octave.svn.sourceforge.net/octave/?rev=5666&view=rev Author: i7tiol Date: 2009-03-30 15:03:58 +0000 (Mon, 30 Mar 2009) Log Message: ----------- Fix saving state with minimal time interval: also save if ready. Modified Paths: -------------- trunk/octave-forge/main/parallel/inst/__bw_scheduler__.m Modified: trunk/octave-forge/main/parallel/inst/__bw_scheduler__.m =================================================================== --- trunk/octave-forge/main/parallel/inst/__bw_scheduler__.m 2009-03-30 08:05:45 UTC (rev 5665) +++ trunk/octave-forge/main/parallel/inst/__bw_scheduler__.m 2009-03-30 15:03:58 UTC (rev 5666) @@ -281,20 +281,23 @@ __bw_secure_save__ (stfn, state, "state"); return; endswitch - ## update statefile, but not if last update was a short time ago - if ((tp = time) - last_saved >= min_save_interv) - state.machines.active = m_active; - state.machines.unresponsive = m_unresponsive; - state.machines.njobs = m_njobs; - __bw_secure_save__ (stfn, state, "state"); - last_saved = tp; - endif endfor + ## update statefile, but not if last update was a short time ago + state.machines.active = m_active; + state.machines.unresponsive = m_unresponsive; + state.machines.njobs = m_njobs; + if ((tp = time) - last_saved >= min_save_interv) + __bw_secure_save__ (stfn, state, "state"); + last_saved = tp; + endif if (all ((m_just_tried | ! m_unresponsive)(! m_active))) m_just_tried = zeros (m_n, 1); endif endwhile + ## final update of statefile + __bw_secure_save__ (stfn, state, "state"); + ## terminate child processes, no coredump for pid = pids' system (sprintf ("kill -9 %i", pid)); @@ -305,9 +308,7 @@ __bw_unlock_file__ (lfd); ## if all is ready, unlink lockfile; earlier unlinking breaks locking - if (all (state.ready)) - unlink (lfn); - endif + unlink (lfn); ## unlink pidfile unlink (pidfn); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |