Permalink
Browse files

pass config obj to Scheduler as dict

This is another Windows fix.  Windows doesn't properly
preserve the config object across the multiprocessing spawn.
  • Loading branch information...
minrk committed Apr 13, 2011
1 parent 22552e5 commit 4312fdebe3d2fdb6e815ac927d97a59e1e9ef165
Showing with 9 additions and 3 deletions.
  1. +4 −2 IPython/parallel/controller/controller.py
  2. +5 −1 IPython/parallel/controller/scheduler.py
@@ -109,8 +109,10 @@ def construct_schedulers(self):
else:
self.log.info("task::using Python %s Task scheduler"%self.scheme)
- sargs = (self.client_info['task'][1], self.engine_info['task'], self.monitor_url, self.client_info['notification'])
- kwargs = dict(scheme=self.scheme,logname=self.log.name, loglevel=self.log.level, config=self.config)
+ sargs = (self.client_info['task'][1], self.engine_info['task'],
+ self.monitor_url, self.client_info['notification'])
+ kwargs = dict(scheme=self.scheme,logname=self.log.name, loglevel=self.log.level,
+ config=dict(self.config))
q = Process(target=launch_scheduler, args=sargs, kwargs=kwargs)
q.daemon=True
children.append(q)
@@ -34,6 +34,7 @@
# local imports
from IPython.external.decorator import decorator
+from IPython.config.loader import Config
from IPython.utils.traitlets import Instance, Dict, List, Set
from IPython.parallel import error
@@ -557,9 +558,12 @@ def launch_scheduler(in_addr, out_addr, mon_addr, not_addr, config=None,logname=
from zmq.eventloop import ioloop
from zmq.eventloop.zmqstream import ZMQStream
+ if config:
+ # unwrap dict back into Config
+ config = Config(config)
+
ctx = zmq.Context()
loop = ioloop.IOLoop()
- print (in_addr, out_addr, mon_addr, not_addr)
ins = ZMQStream(ctx.socket(zmq.XREP),loop)
ins.setsockopt(zmq.IDENTITY, identity)
ins.bind(in_addr)

0 comments on commit 4312fde

Please sign in to comment.