mjr1n1 has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to submit a job (which is embedded in a shell script) using 'qsub'. I tried running the code using various options in perl, but each time when it runs, it submits the job but exits the perl program and does not wait for the job to be finished.
I need the program to wait till the queued job is finished and then based on job output do other things later. Any help will be appreciated. I tried..2. using pipes$job = "/usr/bin/qsub pbs_job.sh"; $status = system($job); #it submits the job here and #exits perl code If ($status == 0) { do something }
thanks.. mjr.$job = "/usr/bin/qsub pbs_job.sh"; open(my $status, "-|", $job) or die "couldn't launch qsub job: $!/$?\n"; for (<$status>) { print "$_"; } close $status;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: submitting job to a queue
by pjotrik (Friar) on Jul 10, 2008 at 14:08 UTC | |
|
Re: submitting job to a queue
by toolic (Bishop) on Jul 10, 2008 at 14:07 UTC | |
by mjr1n1 (Initiate) on Jul 10, 2008 at 14:31 UTC | |
by Anonymous Monk on Jul 08, 2018 at 06:36 UTC | |
|
Re: submitting job to a queue
by baxy77bax (Deacon) on Jan 19, 2009 at 08:49 UTC |