Permalink
Browse files

untwist PBS, WinHPC Launchers in newparallel

  • Loading branch information...
1 parent 4094d44 commit ba75686a178d96b9e5930d097110206514e23f66 @minrk minrk committed Feb 10, 2011
Showing with 304 additions and 295 deletions.
  1. +3 −1 IPython/zmq/parallel/clusterdir.py
  2. +4 −7 IPython/zmq/parallel/ipclusterapp.py
  3. +297 −287 IPython/zmq/parallel/launcher.py
@@ -17,6 +17,7 @@
from __future__ import with_statement
+import re
import os
import shutil
import sys
@@ -469,7 +470,8 @@ def start_logging(self):
if self.master_config.Global.clean_logs:
log_dir = self.master_config.Global.log_dir
for f in os.listdir(log_dir):
- if f.startswith(self.name + u'-') and f.endswith('.log'):
+ if re.match(r'%s-\d+\.(log|err|out)'%self.name,f):
+ # if f.startswith(self.name + u'-') and f.endswith('.log'):
os.remove(os.path.join(log_dir, f))
# Start logging to the new log file
if self.master_config.Global.log_to_file:
@@ -15,6 +15,7 @@
# Imports
#-----------------------------------------------------------------------------
+import re
import logging
import os
import signal
@@ -412,13 +413,9 @@ def start_logging(self):
if self.master_config.Global.clean_logs:
log_dir = self.master_config.Global.log_dir
for f in os.listdir(log_dir):
- if f.startswith('ipengine' + '-'):
- if f.endswith('.log') or f.endswith('.out') or f.endswith('.err'):
- os.remove(os.path.join(log_dir, f))
- if f.startswith('ipcontroller' + '-'):
- if f.endswith('.log') or f.endswith('.out') or f.endswith('.err'):
- os.remove(os.path.join(log_dir, f))
- # This will remote old log files for ipcluster itself
+ if re.match(r'ip(engine|controller)z-\d+\.(log|err|out)',f):
+ os.remove(os.path.join(log_dir, f))
+ # This will remove old log files for ipcluster itself
super(IPClusterApp, self).start_logging()
def start_app(self):
Oops, something went wrong.

0 comments on commit ba75686

Please sign in to comment.