【发布时间】:2011-04-26 19:39:13
【问题描述】:
Perl 无法打开进出运行的命令管道,这在通过 qsub 提交到 SGE 时会导致问题,因为我丢失了提交的作业 ID。如何将生成的脚本提交给 SGE并获取 SGE 为其分配的作业 ID?
【问题讨论】:
标签: perl qsub sungridengine
Perl 无法打开进出运行的命令管道,这在通过 qsub 提交到 SGE 时会导致问题,因为我丢失了提交的作业 ID。如何将生成的脚本提交给 SGE并获取 SGE 为其分配的作业 ID?
【问题讨论】:
标签: perl qsub sungridengine
这是一个 Perl 常见问题解答:How can I open a pipe both to and from a command?(简短回答:请参阅 IPC::Open2)
另一种方法是使用 shell 中的 I/O 重定向工具来捕获外部程序的输出:
open my $qsub_proc, '|-', "qsub $command $args > some/file";
print {$qsub_proc} $the_input_to_the_command;
close $qsub_proc;
open my $qsub_fh, '<', 'some/file';
my @qsub_output = <$qsub_fh>;
... # now parse @qsub_output to get your job id
【讨论】: