On Sun, Mar 14, 2010 at 9:52 AM, Jed Brown <jed at 59a2.org> wrote: > On Sat, 13 Mar 2010 21:16:22 -0600, Barry Smith <bsmith at mcs.anl.gov> > wrote: > > Perhaps the status should be set to 0 and the error to '' in the > > situation where I put in the wrong values (thinking it was failure). > > I tried that, but it broke something else. It seems that the convention > is to set these globals before calling, and then check whether they have > changed. This looks very yucky to me, perhaps Matt can explain why it > is this way.
Okay, whatever 'yuckiness' is here is imposed on us by the threading package. I think what is confusing you guys is the reprocessing of output, since Satish likes it cleaned up. The 'else' branch where Barry added code is actually the success branch since thread.isAlive() is false, meaning it completed. We reprocess the output and return. The status and error have already been set during the run() call. Its this call that makes us us globals for these variables. Its the Python equiv of a closure. Matt > > Jed -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20100314/c1e79963/attachment.html>