##// END OF EJS Templates
The ipcluster command is now able to reuse FURL files....
Brian Granger -
Show More
@@ -478,15 +478,31 b' Try running ipcluster with the -xy flags: ipcluster local -xy -n 4""")'
478 478 cont_args.append('-y')
479 479 return True
480 480
481 def check_reuse(args, cont_args):
482 if args.r:
483 cont_args.append('-r')
484 if args.client_port == 0 or args.engine_port == 0:
485 log.err("""
486 To reuse FURL files, you must also set the client and engine ports using
487 the --client-port and --engine-port options.""")
488 reactor.stop()
489 return False
490 cont_args.append('--client-port=%i' % args.client_port)
491 cont_args.append('--engine-port=%i' % args.engine_port)
492 return True
481 493
482 494 def main_local(args):
483 495 cont_args = []
484 496 cont_args.append('--logfile=%s' % pjoin(args.logdir,'ipcontroller'))
485
497
486 498 # Check security settings before proceeding
487 499 if not check_security(args, cont_args):
488 500 return
489
501
502 # See if we are reusing FURL files
503 if not check_reuse(args, cont_args):
504 return
505
490 506 cl = ControllerLauncher(extra_args=cont_args)
491 507 dstart = cl.start()
492 508 def start_engines(cont_pid):
@@ -514,14 +530,17 b' def main_local(args):'
514 530
515 531
516 532 def main_mpi(args):
517 print vars(args)
518 533 cont_args = []
519 534 cont_args.append('--logfile=%s' % pjoin(args.logdir,'ipcontroller'))
520
535
521 536 # Check security settings before proceeding
522 537 if not check_security(args, cont_args):
523 538 return
524
539
540 # See if we are reusing FURL files
541 if not check_reuse(args, cont_args):
542 return
543
525 544 cl = ControllerLauncher(extra_args=cont_args)
526 545 dstart = cl.start()
527 546 def start_engines(cont_pid):
@@ -555,11 +574,15 b' def main_mpi(args):'
555 574 def main_pbs(args):
556 575 cont_args = []
557 576 cont_args.append('--logfile=%s' % pjoin(args.logdir,'ipcontroller'))
558
577
559 578 # Check security settings before proceeding
560 579 if not check_security(args, cont_args):
561 580 return
562
581
582 # See if we are reusing FURL files
583 if not check_reuse(args, cont_args):
584 return
585
563 586 cl = ControllerLauncher(extra_args=cont_args)
564 587 dstart = cl.start()
565 588 def start_engines(r):
@@ -599,6 +622,10 b' def main_ssh(args):'
599 622 if not check_security(args, cont_args):
600 623 return
601 624
625 # See if we are reusing FURL files
626 if not check_reuse(args, cont_args):
627 return
628
602 629 cl = ControllerLauncher(extra_args=cont_args)
603 630 dstart = cl.start()
604 631 def start_engines(cont_pid):
@@ -621,6 +648,26 b' def main_ssh(args):'
621 648 def get_args():
622 649 base_parser = argparse.ArgumentParser(add_help=False)
623 650 base_parser.add_argument(
651 '-r',
652 action='store_true',
653 dest='r',
654 help='try to reuse FURL files. Use with --client-port and --engine-port'
655 )
656 base_parser.add_argument(
657 '--client-port',
658 type=int,
659 dest='client_port',
660 help='the port the controller will listen on for client connections',
661 default=0
662 )
663 base_parser.add_argument(
664 '--engine-port',
665 type=int,
666 dest='engine_port',
667 help='the port the controller will listen on for engine connections',
668 default=0
669 )
670 base_parser.add_argument(
624 671 '-x',
625 672 action='store_true',
626 673 dest='x',
@@ -308,6 +308,11 b' This is possible. The only thing you have to do is decide what ports the contro'
308 308
309 309 $ ipcontroller -r --client-port=10101 --engine-port=10102
310 310
311 These options also work with all of the various modes of
312 :command:`ipcluster`::
313
314 $ ipcluster local -n 2 -r --client-port=10101 --engine-port=10102
315
311 316 Then, just copy the furl files over the first time and you are set. You can start and stop the controller and engines any many times as you want in the future, just make sure to tell the controller to use the *same* ports.
312 317
313 318 .. note::
General Comments 0
You need to be logged in to leave comments. Login now