[GE users] qsub doesn't flush the standard output in the piple

fansn fansn at hotmail.com
Thu Mar 25 14:36:29 GMT 2010

    [ The following text is in the "gb2312" character set. ]
    [ Your display is set for the "ISO-8859-10" character set.  ]
    [ Some characters may be displayed incorrectly. ]


I wrote a script calling qsub and getting the the job id back using pipe, but it won't work. It seems qsub won't flush the standard output until the job finished.

Here's the code I wrote for testing:

use warnings;
use strict;

open (TEST, "qsub -sync yes sleep.sh |");
while (<TEST>)
  print $_;
close TEST;

Only when the job finishes, the job number will be printed out, together with the exit information:

Your job 284190 ("sleep.sh") has been submitted
Job 284190 exited with exit code 0.

I also wrote a DRMAA version of qsub_perl, using perl DRMAA binding. In the script I add "$|=1". Then I use the above script to call my qsub_perl, I can successfully get the job number.

Can anyone give me some suggestion? Thanks.

Yours sincerely,

Sinong Fan

Hotmail: ???????????????? ?????<https://signup.live.com/signup.aspx?id=60969>

More information about the gridengine-users mailing list