diff options
author | Stan Seibert <stan@mtrr.org> | 2011-11-17 15:00:34 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2021-05-09 08:42:38 -0700 |
commit | aba4d12ce93e950c7834f4317d4d3353d18b192a (patch) | |
tree | 13b51df98dc42609dccd7bf4fdf4b4775c6be2d8 | |
parent | 7b3a36f31ead500435d4cc0777ca4feaaa5fae56 (diff) | |
download | chroma-aba4d12ce93e950c7834f4317d4d3353d18b192a.tar.gz chroma-aba4d12ce93e950c7834f4317d4d3353d18b192a.tar.bz2 chroma-aba4d12ce93e950c7834f4317d4d3353d18b192a.zip |
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.
-rw-r--r-- | chroma/generator/photon.py | 4 |
1 files 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) |