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

reuti reuti at staff.uni-marburg.de
Thu Mar 25 21:07:39 GMT 2010


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

Hi,

Am 25.03.2010 um 21:30 schrieb fansn:

> I'm writing a wapper script for qsub, and the script will wait until  
> the job finishes, therefore I'm using -sync yes. I have a forked sub  
> process tailing the output(XXX.o<jobid>),

if it's only because of the name of the output file, you can also set  
a custom one with the -o option to qsub. Then you now the name already  
beforehand.

-- Reuti


> as if the command was running on a local machine. So I must get the  
> job id immediately after the job is submitted into the grid.  
> Currently I used DRMAA to implement the functions of qsub, and it  
> works fine(I put $|=1 in the script), but I would like to use qsub  
> to simplify the script. Seems qsub won't flush the pipe until the  
> pipe is closed(job finished).
>
> Yours sincerely,
>
>
> Sinong Fan
>
>
>
> -----Original Message-----
> From: reuti [mailto:reuti at staff.uni-marburg.de]
> Sent: 25 March 2010 19:25
> To: users at gridengine.sunsource.net
> Subject: Re: [GE users] qsub doesn't flush the standard output in  
> the piple
>
> Hi,
>
> Am 25.03.2010 um 15:36 schrieb fansn:
>
>> 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:
>>
>> #!/usr/bin/perl
>> use warnings;
>> use strict;
>>
>> open (TEST, "qsub -sync yes sleep.sh |");
>
> why are you using -sync here, is it the same w/o?
>
> -- Reuti
>
>
>> 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: ???????????????? ??? 
>> ??
>
> ------------------------------------------------------
> http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=251358
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net 
> ].
>
> ------------------------------------------------------
> http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=251362
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net 
> ].
>

------------------------------------------------------
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=251367

To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].



More information about the gridengine-users mailing list