From aba4d12ce93e950c7834f4317d4d3353d18b192a Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Thu, 17 Nov 2011 15:00:34 -0500 Subject: Do not use the zmq.Context.instance() method to obtain a ZeroMQ context when you will be forking processes at multiple locations. This killed one of the unit tests. --- chroma/generator/photon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chroma/generator/photon.py b/chroma/generator/photon.py index 5ae1e93..39e8cf4 100644 --- a/chroma/generator/photon.py +++ b/chroma/generator/photon.py @@ -18,7 +18,7 @@ class G4GeneratorProcess(multiprocessing.Process): def run(self): gen = g4gen.G4Generator(self.material, seed=self.seed) - context = zmq.Context.instance() + context = zmq.Context() vertex_socket = context.socket(zmq.PULL) vertex_socket.connect(self.vertex_socket_address) photon_socket = context.socket(zmq.PUSH) @@ -75,7 +75,7 @@ class G4ParallelGenerator(object): for p in self.processes: p.start() - self.zmq_context = zmq.Context.instance() + self.zmq_context = zmq.Context() self.vertex_socket = self.zmq_context.socket(zmq.PUSH) self.vertex_socket.bind(self.vertex_address) self.photon_socket = self.zmq_context.socket(zmq.PULL) -- cgit