Submitting multiple scripts to qsub in perl
I'm writing a perl script that, among other things submits three scripts to qsub. How do I "tell" my script when the first job is complete? I assume there's some way of accessing the variable where qsub stores the job state but I can't figure it out.
Update: Circumvented it using a flag in qsub.
qsub -hold_jid job2 job1开发者_开发技巧
Try PBS::Client
:
use strict;
use warnings;
use PBS::Client;
my $pbs = PBS::Client->new;
my $job1 = PBS::Client::Job->new(cmd => "./a1.out");
my $job2 = PBS::Client::Job->new(cmd => "./a2.out");
my $job3 = PBS::Client::Job->new(cmd => "./a3.out");
$job1->next({ ok => $job2 }); # Run $job2 if $job1 ran OK
$job2->next({ ok => $job3 }); # Run $job3 if $job2 ran OK
$pbs->qsub($job1);
精彩评论