[Rivet-svn] rivet: Update make-plots to use multiprocessing rather than thre...

Rivet Mercurial rivet at projects.hepforge.org
Tue Mar 1 15:45:02 GMT 2016


details:   https://rivet.hepforge.org/hg/rivet/rev/063f92553cf7
branches:  release-2-4-x
changeset: 5000:063f92553cf7
user:      Andy Buckley <andy at insectnation.org>
date:      Mon Feb 29 22:53:55 2016 +0000
description:
Update make-plots to use multiprocessing rather than threading.

diffs (truncated from 83 to 50 lines):

--- a/ChangeLog	Mon Feb 29 22:37:09 2016 +0000
+++ b/ChangeLog	Mon Feb 29 22:53:55 2016 +0000
@@ -1,5 +1,7 @@
 2016-02-29  Andy Buckley  <andy.buckley at cern.ch>
 
+	* Update make-plots to use multiprocessing rather than threading.
+
 	* Add FastJets::trimJet method, thanks to James Monk for the
 	suggestion and patch.
 
--- a/bin/make-plots	Mon Feb 29 22:37:09 2016 +0000
+++ b/bin/make-plots	Mon Feb 29 22:53:55 2016 +0000
@@ -2433,35 +2433,6 @@
         shutil.rmtree(tempdir, ignore_errors=True)
 
 
-## Wrapper for a process thread which attempts to process datfiles until empty
-import threading, Queue
-class MkPlotThread( threading.Thread ):
-
-    def run(self):
-        global opts
-        global datfiles
-        global RECVD_KILL_SIGNAL
-        while True:
-            if RECVD_KILL_SIGNAL is not None:
-                ## Empty the queue
-                while not datfiles.empty():
-                    dummy = datfiles.get_nowait()
-                break
-            try:
-                datfile = datfiles.get_nowait()
-                rem = datfiles.qsize()
-                logging.info("Plotting %s (%d remaining)" % (datfile, rem))
-                process_datfile(datfile)
-            except Queue.Empty, e:
-                #print "%s ending." % self.getName()
-                break
-            # except Exception, e:
-            #     print "Error: %s" % str(e)
-            #     import traceback
-            #     logging.debug(traceback.format_exc())
-            #     #exit(1)
-
-
 ####################
 
 
@@ -2608,15 +2579,6 @@
             logging.warning("Problem while testing for external packages. I'm going to try and continue without testing, but don't hold your breath...")


More information about the Rivet-svn mailing list