##// END OF EJS Templates
Minor improvements to the parallel computing stuff....
bgranger -
Show More
@@ -275,19 +275,26 b' class AsyncClientConnector(object):'
275 275
276 276 d = self._try_to_connect(furl_file, delay, max_tries, attempt=0)
277 277 d.addCallback(_wrap_remote_reference)
278 d.addErrback(self._handle_error, furl_file)
278 279 return d
279 280
281 def _handle_error(self, f, furl_file):
282 raise ClientConnectorError('Could not connect to the controller '
283 'using the FURL file. This usually means that i) the controller '
284 'was not started or ii) a firewall was blocking the client from '
285 'connecting to the controller: %s' % furl_file)
286
280 287 @inlineCallbacks
281 288 def _try_to_connect(self, furl_or_file, delay, max_tries, attempt):
282 289 """Try to connect to the controller with retry logic."""
283 290 if attempt < max_tries:
284 log.msg("Connecting to controller [%r]: %s" % \
285 (attempt, furl_or_file))
291 log.msg("Connecting [%r]" % attempt)
286 292 try:
287 293 self.furl = find_furl(furl_or_file)
288 294 # Uncomment this to see the FURL being tried.
289 295 # log.msg("FURL: %s" % self.furl)
290 296 rr = yield self.get_reference(self.furl)
297 log.msg("Connected: %s" % furl_or_file)
291 298 except:
292 299 if attempt==max_tries-1:
293 300 # This will propagate the exception all the way to the top
@@ -243,7 +243,7 b' class IPClusterApp(ApplicationWithClusterDir):'
243 243 full_path = os.path.join(path, f)
244 244 if os.path.isdir(full_path) and f.startswith('cluster_'):
245 245 profile = full_path.split('_')[-1]
246 start_cmd = '"ipcluster start -n 4 -p %s"' % profile
246 start_cmd = 'ipcluster start -p %s -n 4' % profile
247 247 print start_cmd + " ==> " + full_path
248 248
249 249 def pre_construct(self):
@@ -362,7 +362,7 b' class IPClusterApp(ApplicationWithClusterDir):'
362 362 d= self.stop_engines()
363 363 d2 = self.stop_controller()
364 364 # Wait a few seconds to let things shut down.
365 reactor.callLater(3.0, reactor.stop)
365 reactor.callLater(4.0, reactor.stop)
366 366
367 367 def sigint_handler(self, signum, frame):
368 368 self.stop_launchers()
@@ -262,9 +262,8 b' class MultiEngine(ControllerAdapterBase):'
262 262 elif targets == 'all':
263 263 eList = self.engines.values()
264 264 if len(eList) == 0:
265 msg = """There are no engines registered.
266 Check the logs in ~/.ipython/log if you think there should have been."""
267 raise error.NoEnginesRegistered(msg)
265 raise error.NoEnginesRegistered("There are no engines registered. "
266 "Check the logs if you think there should have been.")
268 267 else:
269 268 return eList
270 269 else:
General Comments 0
You need to be logged in to leave comments. Login now