##// END OF EJS Templates
Fixing minor bugs in IPython.kernel....
Brian Granger -
Show More
@@ -109,7 +109,7 b' c = get_config()'
109 # c.PBSControllerLauncher.delete_command = 'qdel'
109 # c.PBSControllerLauncher.delete_command = 'qdel'
110
110
111 # A regular expression that takes the output of qsub and find the job id.
111 # A regular expression that takes the output of qsub and find the job id.
112 # c.PBSControllerLauncher.job_id_regexp = '\d+'
112 # c.PBSControllerLauncher.job_id_regexp = r'\d+'
113
113
114 # The batch submission script used to start the controller. This is where
114 # The batch submission script used to start the controller. This is where
115 # environment variables would be setup, etc. This string is interpolated using
115 # environment variables would be setup, etc. This string is interpolated using
@@ -129,7 +129,7 b' c = get_config()'
129 # c.PBSEngineSetLauncher.delete_command = 'qdel'
129 # c.PBSEngineSetLauncher.delete_command = 'qdel'
130
130
131 # A regular expression that takes the output of qsub and find the job id.
131 # A regular expression that takes the output of qsub and find the job id.
132 # c.PBSEngineSetLauncher.job_id_regexp = '\d+'
132 # c.PBSEngineSetLauncher.job_id_regexp = r'\d+'
133
133
134 # The batch submission script used to start the engines. This is where
134 # The batch submission script used to start the engines. This is where
135 # environment variables would be setup, etc. This string is interpolated using
135 # environment variables would be setup, etc. This string is interpolated using
@@ -147,7 +147,7 b' c = get_config()'
147
147
148 # c.IPControllerJob.job_name = 'IPController'
148 # c.IPControllerJob.job_name = 'IPController'
149 # c.IPControllerJob.is_exclusive = False
149 # c.IPControllerJob.is_exclusive = False
150 # c.IPControllerJob.username = 'USERDOMAIN\\USERNAME'
150 # c.IPControllerJob.username = r'USERDOMAIN\USERNAME'
151 # c.IPControllerJob.priority = 'Highest'
151 # c.IPControllerJob.priority = 'Highest'
152 # c.IPControllerJob.requested_nodes = ''
152 # c.IPControllerJob.requested_nodes = ''
153 # c.IPControllerJob.project = 'MyProject'
153 # c.IPControllerJob.project = 'MyProject'
@@ -163,7 +163,7 b' c = get_config()'
163
163
164 # c.IPEngineSetJob.job_name = 'IPEngineSet'
164 # c.IPEngineSetJob.job_name = 'IPEngineSet'
165 # c.IPEngineSetJob.is_exclusive = False
165 # c.IPEngineSetJob.is_exclusive = False
166 # c.IPEngineSetJob.username = 'USERDOMAIN\\USERNAME'
166 # c.IPEngineSetJob.username = r'USERDOMAIN\USERNAME'
167 # c.IPEngineSetJob.priority = 'Highest'
167 # c.IPEngineSetJob.priority = 'Highest'
168 # c.IPEngineSetJob.requested_nodes = ''
168 # c.IPEngineSetJob.requested_nodes = ''
169 # c.IPEngineSetJob.project = 'MyProject'
169 # c.IPEngineSetJob.project = 'MyProject'
@@ -69,9 +69,7 b' class ClusterDir(Component):'
69
69
70 def _location_changed(self, name, old, new):
70 def _location_changed(self, name, old, new):
71 if not os.path.isdir(new):
71 if not os.path.isdir(new):
72 os.makedirs(new, mode=0777)
72 os.makedirs(new)
73 else:
74 os.chmod(new, 0777)
75 self.security_dir = os.path.join(new, self.security_dir_name)
73 self.security_dir = os.path.join(new, self.security_dir_name)
76 self.log_dir = os.path.join(new, self.log_dir_name)
74 self.log_dir = os.path.join(new, self.log_dir_name)
77 self.pid_dir = os.path.join(new, self.pid_dir_name)
75 self.pid_dir = os.path.join(new, self.pid_dir_name)
@@ -82,9 +80,7 b' class ClusterDir(Component):'
82
80
83 def check_log_dir(self):
81 def check_log_dir(self):
84 if not os.path.isdir(self.log_dir):
82 if not os.path.isdir(self.log_dir):
85 os.mkdir(self.log_dir, 0777)
83 os.mkdir(self.log_dir)
86 else:
87 os.chmod(self.log_dir, 0777)
88
84
89 def _security_dir_changed(self, name, old, new):
85 def _security_dir_changed(self, name, old, new):
90 self.check_security_dir()
86 self.check_security_dir()
@@ -92,7 +88,6 b' class ClusterDir(Component):'
92 def check_security_dir(self):
88 def check_security_dir(self):
93 if not os.path.isdir(self.security_dir):
89 if not os.path.isdir(self.security_dir):
94 os.mkdir(self.security_dir, 0700)
90 os.mkdir(self.security_dir, 0700)
95 else:
96 os.chmod(self.security_dir, 0700)
91 os.chmod(self.security_dir, 0700)
97
92
98 def _pid_dir_changed(self, name, old, new):
93 def _pid_dir_changed(self, name, old, new):
@@ -101,7 +96,6 b' class ClusterDir(Component):'
101 def check_pid_dir(self):
96 def check_pid_dir(self):
102 if not os.path.isdir(self.pid_dir):
97 if not os.path.isdir(self.pid_dir):
103 os.mkdir(self.pid_dir, 0700)
98 os.mkdir(self.pid_dir, 0700)
104 else:
105 os.chmod(self.pid_dir, 0700)
99 os.chmod(self.pid_dir, 0700)
106
100
107 def check_dirs(self):
101 def check_dirs(self):
@@ -208,7 +208,7 b' class IPClusterApp(ApplicationWithClusterDir):'
208 self.auto_create_cluster_dir = True
208 self.auto_create_cluster_dir = True
209 super(IPClusterApp, self).find_resources()
209 super(IPClusterApp, self).find_resources()
210 elif subcommand=='start' or subcommand=='stop':
210 elif subcommand=='start' or subcommand=='stop':
211 self.auto_create_cluster_dir = False
211 self.auto_create_cluster_dir = True
212 try:
212 try:
213 super(IPClusterApp, self).find_resources()
213 super(IPClusterApp, self).find_resources()
214 except ClusterDirError:
214 except ClusterDirError:
@@ -257,13 +257,16 b' class IPClusterApp(ApplicationWithClusterDir):'
257
257
258 def construct(self):
258 def construct(self):
259 config = self.master_config
259 config = self.master_config
260 if config.Global.subcommand=='list':
260 subcmd = config.Global.subcommand
261 pass
261 reset = config.Global.reset_config
262 elif config.Global.subcommand=='create':
262 if subcmd == 'list':
263 return
264 if subcmd == 'create':
263 self.log.info('Copying default config files to cluster directory '
265 self.log.info('Copying default config files to cluster directory '
264 '[overwrite=%r]' % (config.Global.reset_config,))
266 '[overwrite=%r]' % (reset,))
265 self.cluster_dir_obj.copy_all_config_files(overwrite=config.Global.reset_config)
267 self.cluster_dir_obj.copy_all_config_files(overwrite=reset)
266 elif config.Global.subcommand=='start':
268 if subcmd =='start':
269 self.cluster_dir_obj.copy_all_config_files(overwrite=False)
267 self.start_logging()
270 self.start_logging()
268 reactor.callWhenRunning(self.start_launchers)
271 reactor.callWhenRunning(self.start_launchers)
269
272
@@ -410,6 +413,7 b' class IPClusterApp(ApplicationWithClusterDir):'
410 self.log.info(
413 self.log.info(
411 'Starting ipcluster with [daemon=%r]' % config.Global.daemonize
414 'Starting ipcluster with [daemon=%r]' % config.Global.daemonize
412 )
415 )
416 # TODO: Get daemonize working on Windows or as a Windows Server.
413 if config.Global.daemonize:
417 if config.Global.daemonize:
414 if os.name=='posix':
418 if os.name=='posix':
415 daemonize()
419 daemonize()
@@ -505,6 +505,7 b' class MPIExecEngineSetLauncher(MPIExecLauncher):'
505 # SSH launchers
505 # SSH launchers
506 #-----------------------------------------------------------------------------
506 #-----------------------------------------------------------------------------
507
507
508 # TODO: Get SSH Launcher working again.
508
509
509 class SSHLauncher(BaseLauncher):
510 class SSHLauncher(BaseLauncher):
510 """A minimal launcher for ssh.
511 """A minimal launcher for ssh.
@@ -565,7 +566,7 b' class WindowsHPCLauncher(BaseLauncher):'
565
566
566 # A regular expression used to get the job id from the output of the
567 # A regular expression used to get the job id from the output of the
567 # submit_command.
568 # submit_command.
568 job_id_regexp = Str('\d+', config=True)
569 job_id_regexp = Str(r'\d+', config=True)
569 # The filename of the instantiated job script.
570 # The filename of the instantiated job script.
570 job_file_name = Unicode(u'ipython_job.xml', config=True)
571 job_file_name = Unicode(u'ipython_job.xml', config=True)
571 # The full path to the instantiated job script. This gets made dynamically
572 # The full path to the instantiated job script. This gets made dynamically
@@ -709,6 +710,7 b' class WindowsHPCEngineSetLauncher(WindowsHPCLauncher):'
709 # Batch (PBS) system launchers
710 # Batch (PBS) system launchers
710 #-----------------------------------------------------------------------------
711 #-----------------------------------------------------------------------------
711
712
713 # TODO: Get PBS launcher working again.
712
714
713 class BatchSystemLauncher(BaseLauncher):
715 class BatchSystemLauncher(BaseLauncher):
714 """Launch an external process using a batch system.
716 """Launch an external process using a batch system.
@@ -790,7 +792,7 b' class PBSLauncher(BatchSystemLauncher):'
790
792
791 submit_command = Str('qsub', config=True)
793 submit_command = Str('qsub', config=True)
792 delete_command = Str('qdel', config=True)
794 delete_command = Str('qdel', config=True)
793 job_id_regexp = Str('\d+', config=True)
795 job_id_regexp = Str(r'\d+', config=True)
794 batch_template = Str('', config=True)
796 batch_template = Str('', config=True)
795 batch_file_name = Unicode(u'pbs_batch_script', config=True)
797 batch_file_name = Unicode(u'pbs_batch_script', config=True)
796 batch_file = Unicode(u'')
798 batch_file = Unicode(u'')
General Comments 0
You need to be logged in to leave comments. Login now