[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-users] submitting jobs with Condor.pm



Worked it out,  I was doing it all wrong :-(
You submit one job with a big queue.

--Russell

> -----Original Message-----
> From: condor-users-bounces@xxxxxxxxxxx [mailto:condor-users-
> bounces@xxxxxxxxxxx] On Behalf Of Smithies, Russell
> Sent: Friday, 7 May 2010 2:43 p.m.
> To: 'Condor-Users Mail List'
> Subject: [Condor-users] submitting jobs with Condor.pm
> 
> I'm trying to send multiple jobs to Condor with the Perl module but am
> obviously doing something wrong.
> I modified the example code from the docs slightly to submit several jobs
> in a loop but it only submits one job then waits before submitting another
> one.
> 
> Any ideas what I've done wrong?
> 
> Thanx,
> 
> Russell Smithies
> 
> 
> Here's the code:
> =========================
> #!perl
> 
> use warnings;
> 
> use lib "/usr/local/condor/lib";
> use Condor;
> 
> $evicts = 0;
> $vacates = 0;
> 
> # A subroutine that will be used as the normal execution callback
> $normal = sub
> {
>     %parameters = @_;
>     $cluster = $parameters{'cluster'};
>     $job = $parameters{'job'};
> 
>     print "Job $cluster.$job exited normally without errors.\n";
>     print "Job was vacated $vacates times and evicted $evicts times\n";
>     exit(0);
> };
> 
> $evicted = sub
> {
>     %parameters = @_;
>     $cluster = $parameters{'cluster'};
>     $job = $parameters{'job'};
> 
>     print "Job $cluster, $job was evicted.\n";
>     $evicts++;
>     &Condor::Reschedule();
> };
> 
> $execute = sub
> {
>     %parameters = @_;
>     $cluster = $parameters{'cluster'};
>     $job = $parameters{'job'};
>     $host = $parameters{'host'};
>     $sinful = $parameters{'sinful'};
> 
>     print "Job running on $host $sinful, vacating...\n";
>     &Condor::Vacate($sinful);
>     $vacates++;
> };
> 
> 
> 
> sub submit{
> 	print "submitting $_\n";
> 	$CMD_FILE = 'GenePrediction_'.$_.'.faa.template';
>       $cluster = Condor::Submit($CMD_FILE) or die $!;
> 	&Condor::RegisterExitSuccess($normal);
> 	&Condor::RegisterEvicted($evicted);
> 	&Condor::RegisterExecute($execute);
> 	&Condor::Monitor($cluster);
> 	&Condor::Wait();
> 	&Condor::DebugOn();
> }
> 
> 
> # start 4 jobs
> foreach (1..4){
> 	submit($_);
> }
> ===============================
> =======================================================================
> Attention: The information contained in this message and/or attachments
> from AgResearch Limited is intended only for the persons or entities
> to which it is addressed and may contain confidential and/or privileged
> material. Any review, retransmission, dissemination or other use of, or
> taking of any action in reliance upon, this information by persons or
> entities other than the intended recipients is prohibited by AgResearch
> Limited. If you have received this message in error, please notify the
> sender immediately.
> =======================================================================
> _______________________________________________
> Condor-users mailing list
> To unsubscribe, send a message to condor-users-request@xxxxxxxxxxx with a
> subject: Unsubscribe
> You can also unsubscribe by visiting
> https://lists.cs.wisc.edu/mailman/listinfo/condor-users
> 
> The archives can be found at:
> https://lists.cs.wisc.edu/archive/condor-users/