##// END OF EJS Templates
Minor fixes to get Win HPC support working fully.
bgranger -
Show More
@@ -294,7 +294,7 b' class IPClusterApp(ApplicationWithClusterDir):'
294 294
295 295 # Start the controller and engines
296 296 d = self.controller_launcher.start(
297 profile=None, cluster_dir=config.Global.cluster_dir
297 cluster_dir=config.Global.cluster_dir
298 298 )
299 299 d.addCallback(lambda _: self.start_engines())
300 300 d.addErrback(self.err_and_stop)
@@ -311,7 +311,7 b' class IPClusterApp(ApplicationWithClusterDir):'
311 311 config = self.master_config
312 312 d = self.engine_launcher.start(
313 313 config.Global.n,
314 profile=None, cluster_dir=config.Global.cluster_dir
314 cluster_dir=config.Global.cluster_dir
315 315 )
316 316 return d
317 317
@@ -569,13 +569,12 b' class WindowsHPCLauncher(BaseLauncher):'
569 569 job_file = Unicode(u'')
570 570 # The hostname of the scheduler to submit the job to
571 571 scheduler = Str('', config=True)
572 job_cmd = Str(find_job_cmd, config=True)
572 job_cmd = Str(find_job_cmd(), config=True)
573 573
574 574 def __init__(self, working_dir, parent=None, name=None, config=None):
575 575 super(WindowsHPCLauncher, self).__init__(
576 576 working_dir, parent, name, config
577 577 )
578 self.job_file = os.path.join(self.working_dir, self.job_file_name)
579 578
580 579 @property
581 580 def job_file(self):
@@ -608,9 +607,10 b' class WindowsHPCLauncher(BaseLauncher):'
608 607 '/scheduler:%s' % self.scheduler
609 608 ]
610 609 log.msg("Starting Win HPC Job: %s" % (self.job_cmd + ' ' + ' '.join(args),))
611 output = yield getProcessOutput(self.job_cmd,
612 args,
613 env=os.environ,
610 # Twisted will raise DeprecationWarnings if we try to pass unicode to this
611 output = yield getProcessOutput(str(self.job_cmd),
612 [str(a) for a in args],
613 env=dict((str(k),str(v)) for k,v in os.environ.items()),
614 614 path=self.working_dir
615 615 )
616 616 job_id = self.parse_job_id(output)
@@ -626,9 +626,10 b' class WindowsHPCLauncher(BaseLauncher):'
626 626 ]
627 627 log.msg("Stopping Win HPC Job: %s" % (self.job_cmd + ' ' + ' '.join(args),))
628 628 try:
629 output = yield getProcessOutput(self.job_cmd,
630 args,
631 env=os.environ,
629 # Twisted will raise DeprecationWarnings if we try to pass unicode to this
630 output = yield getProcessOutput(str(self.job_cmd),
631 [str(a) for a in args],
632 env=dict((str(k),str(v)) for k,v in os.environ.items()),
632 633 path=self.working_dir
633 634 )
634 635 except:
@@ -676,7 +677,7 b' class WindowsHPCEngineSetLauncher(WindowsHPCLauncher):'
676 677 extra_args = List([], config=False)
677 678
678 679 def write_job_file(self, n):
679 job = IPControllerJob(self)
680 job = IPEngineSetJob(self)
680 681
681 682 for i in range(n):
682 683 t = IPEngineTask(self)
@@ -695,13 +696,13 b' class WindowsHPCEngineSetLauncher(WindowsHPCLauncher):'
695 696 def job_file(self):
696 697 return os.path.join(self.cluster_dir, self.job_file_name)
697 698
698 def start(self, cluster_dir):
699 def start(self, n, cluster_dir):
699 700 """Start the controller by cluster_dir."""
700 701 self.extra_args = [
701 702 '--cluster-dir', cluster_dir, '--working-dir', self.working_dir
702 703 ]
703 704 self.cluster_dir = unicode(cluster_dir)
704 return super(WindowsHPCControllerLauncher, self).start(n)
705 return super(WindowsHPCEngineSetLauncher, self).start(n)
705 706
706 707
707 708 #-----------------------------------------------------------------------------
General Comments 0
You need to be logged in to leave comments. Login now