【问题标题】:Captuing job ID when submitting Perl-generated scripts to SGE将 Perl 生成的脚本提交给 AGE 时捕获作业 ID
【发布时间】:2011-04-26 19:39:13
【问题描述】:

Perl 无法打开进出运行的命令管道,这在通过 qsub 提交到 SGE 时会导致问题,因为我丢失了提交的作业 ID。如何将生成的脚本提交给 SGE获取 SGE 为其分配的作业 ID?

【问题讨论】:

    标签: perl qsub sungridengine


    【解决方案1】:

    这是一个 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-07-03
      • 1970-01-01
      • 1970-01-01
      • 2018-05-08
      • 1970-01-01
      • 2012-06-28
      • 2015-08-24
      • 1970-01-01
      相关资源
      最近更新 更多