Permalink
Browse files

add bsub wrapper for LSFEngineSet

LSF requires that job scripts be submitted to bsub through stdin.
twisted.internet.utils.getProcessOutput does not support shell
redirection so the bsub wrapper takes care of doing this.
  • Loading branch information...
1 parent 11c0776 commit 09567cac87b4e24006ef4958d4960ba46b546b7e @jtriley jtriley committed with Jul 23, 2010
Showing with 15 additions and 0 deletions.
  1. +15 −0 IPython/kernel/scripts/ipcluster.py
@@ -393,6 +393,21 @@ class LSFEngineSet(PBSEngineSet):
eid=$(($LSB_JOBINDEX - 1))
ipengine --logfile=ipengine${eid}.log
"""
+ bsub_wrapper="""#!/bin/sh
+bsub < $1
+"""
+
+ def __init__(self, template_file, queue, **kwargs):
+ self._bsub_wrapper = self._make_bsub_wrapper()
+ self.submit_command = self._bsub_wrapper.name
+ PBSEngineSet.__init__(self,template_file, queue, **kwargs)
+
+ def _make_bsub_wrapper(self):
+ bsub_wrapper = tempfile.NamedTemporaryFile()
+ bsub_wrapper.write(self.bsub_wrapper)
+ bsub_wrapper.file.close()
+ os.chmod(bsub_wrapper.name, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
+ return bsub_wrapper
sshx_template="""#!/bin/sh
"$@" &> /dev/null &

0 comments on commit 09567ca

Please sign in to comment.