Am 21.03.2013 um 06:52 schrieb Vamsi Krishna: > if i use tail -f <outputfile> in prolog, batchjob is always in qw state. i > guess it is waiting for terminal.
No, it will do what you expect it to do: in the end it will copy the <outfile> to <stdout> (or at least the actual 10 last lines and all following ones), and this output is captured by SGE's redefinition of <stdout> for this process and routed to another file. The behavior of `tail -f` is not to stop after all is copied but to wait for additional lines until it's killed by a signal like presssing CTRL-C on the keyboard (will send a "sigint" by the tty driver to the process) or something like "sigkill" send directly. So the prolog will never exit and there is no further processing of the job. -- Reuti > On Mon, Mar 18, 2013 at 6:01 PM, Reuti <[email protected]> wrote: > Hi, > > Am 18.03.2013 um 09:10 schrieb Mazouzi: > > > Hi, > > > > You can write a wrapper and attach the job id to qtail : > > redirecting the stdout/-err can be more complicated than it sounds. > > > > http://wiki.gridengine.info/wiki/index.php/Utilities#qtail > > There is no author mentioned, but I get a path like: > > NONE:NONE:/home/reuti/err/foobar_$JOB_ID > > which doesn't help much, as at least the NONE:NONE: needs to be stripped off > and the job number substituted. Then it might work in many cases, when: > > - don't use pseudo variables > - don't specify different paths for different exechosts in `qsub`(this is a > valid syntax and would replace the NONE partially) > - don't use "sge_aliases" for different mount path on different exechosts > - the output path needs to be accessible from the submission machine > > If you want to get a reliable path for sure: it's necessary to set the output > path in a prolog (global or queue) as a job context, which can then be > retrieved on the submission machine - at that point it's known. For this to > work the exechost also needs to be a submission host and execute a prolog > like: > > #!/bin/sh > . $SGE_ROOT/default/common/settings.sh > qalter -ac SGE_STDOUT_PATH=$SGE_STDOUT_PATH $JOB_ID > > This will then show up in the `qstat -j <job_id>` output: > > context: SGE_STDOUT_PATH=/home/reuti/foobar_5849 > > $ qstat -j <job_id> | sed -n -e "/^context: */s///p"| tr "," "\n" | grep > SGE_STDOUT_PATH > SGE_STDOUT_PATH=/home/reuti/foobar_5849 > > (We put even more entries in the job context, hence the `grep` here.) > > -- Reuti > > > > Regards > > > > > > On Mon, Mar 18, 2013 at 8:22 AM, Vamsi Krishna <[email protected]> > > wrote: > > hi > > > > i would like to stream the output log file similar like tail -f > > output.file. is there a way to open automatically the -o 'output.file' in > > the same terminal or in new terminal when the job is submitted to the Grid. > > > > > > > > _______________________________________________ > > users mailing list > > [email protected] > > https://gridengine.org/mailman/listinfo/users > > > > > > _______________________________________________ > > users mailing list > > [email protected] > > https://gridengine.org/mailman/listinfo/users > > _______________________________________________ users mailing list [email protected] https://gridengine.org/mailman/listinfo/users
