def submit(self, values, cwd):
queue_command = [
'qsub', '-cwd', '-e', 'stderr.txt', '-o', 'stdout.txt'
] + self.qargs
process = subprocess.Popen(
queue_command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stdin=subprocess.PIPE,
cwd=cwd,
env=self.env,
universal_newlines=True
)
command_chunks = self.bin + self.get_options(values)
command = ' '.join(shlex.quote(s) for s in command_chunks)
stdin = ("echo > started;\n"
"%s;\n"
"echo > finished;") % command
stdout, stderr = process.communicate(stdin)
match = self.job_submission_regex.match(stdout)
return match.group(1)
评论列表
文章目录