Bio::EnsEMBL::Pipeline::BatchSubmission GridEngine
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::Pipeline::BatchSubmission::GridEngine
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Pipeline::BatchSubmission
strict
Inherit
Bio::EnsEMBL::Pipeline::BatchSubmission
Synopsis
my $batchjob = Bio::EnsEMBL::Pipeline::BatchSubmission::LSF->new(
-STDOUT => $stdout_file,
-STDERR => $stderr_file,
-PARAMETERS => @args,
-PRE_EXEC => $pre_exec,
-QUEUE => $queue,
-JOBNAME => $jobname,
-NODES => $nodes,
-RESOURCE => $resource
);
$batch_job->construct_command_line('test.pl');
$batch_job->open_command_line();
Description
This module provides an interface to the Sun Grid Engine load sharing softwa
re and its commands. It implements the method construct_command_line which is
not defined in the base class and which enables the pipeline to submit jobs
in a distributed environment using Sun Grid Engine.
See base class Bio::EnsEMBL::Pipeline::BatchSubmission for more info
Methods
construct_command_line
No description
Code
new
No description
Code
open_command_line
No description
Code
qsub
No description
Code
Methods description
None available.
Methods code
construct_command_linedescriptionprevnextTop
sub construct_command_line {
  my($self, $command, $stdout, $stderr) = @_; 
  #print STDERR "creating the command line\n";
#command must be the first argument then if stdout or stderr aren't definhed the objects own can be used
if(!$command){ $self->throw("cannot create qsub if nothing to submit to it : $!\n"); } my $qsub_line; $self->command($command); if($stdout){ $qsub_line = "qsub -V -cwd -v FINAL_STDOUT=".$stdout; }else{ $qsub_line = "qsub -V -cwd -v FINAL_STDOUT=".$self->stdout_file; } if($stderr){ $qsub_line .= " -v FINAL_STDERR=".$stderr; }else{ $qsub_line .= " -v FINAL_STDERR=".$self->stderr_file; } $qsub_line .= " -o /tmp -e /tmp"; # Depends on queues being made for each node with name node.q
if($self->nodes){ my $nodes = $self->nodes; # $nodes needs to be a space-delimited list
$nodes =~ s/,/.q,/; $qsub_line .= " -q ".$nodes." "; } if (defined($self->queue) && $self->queue ne "") {$qsub_line .= " -l ".$self->queue;} $qsub_line .= " -N ".$self->jobname if defined $self->jobname; $qsub_line .= " ".$self->parameters." " if defined $self->parameters; $qsub_line .= " -v PREEXEC=\"".$self->pre_exec."\"" if defined $self->pre_exec; ## must ensure the prexec is in quotes ##
my $ge_wrapper = "ge_wrapper.pl"; unless (-x $ge_wrapper) { $ge_wrapper = __FILE__; $ge_wrapper =~ s:GridEngine.pm:../../../../../scripts/ge_wrapper.pl:; print $ge_wrapper . "\n"; my $caller = caller(0); $self->throw("ge_wrapper not found - needs to be set in $caller\n") unless -x $ge_wrapper; } $qsub_line .= " $ge_wrapper\" ".$command . "\""; $self->qsub($qsub_line); #print "have command line\n";
}
newdescriptionprevnextTop
sub new {
  my ($class, @args) = @_;
  my $self = $class->SUPER::new(@args);

  return $self;
 
}


##################
#accessor methods#
##################
}
open_command_linedescriptionprevnextTop
sub open_command_line {
  my ($self)= @_;

  print STDERR $self->qsub."\n";
  print STDERR "opening command line\n";
  open(SUB, $self->qsub." 2>&1 |");
  my $geid;
  while(<SUB>){
    if (/your job (\d+)/) {
      $geid = $1;
    }
  }
  print STDERR "have opened ".$self->qsub."\n";
  print STDERR "geid ".$geid."\n";
  $self->id($geid);
  close(SUB);
}
qsubdescriptionprevnextTop
sub qsub {
  my ($self,$qsub_line) = @_;

  if (defined($qsub_line)) {
    $self->{_qsub} = $qsub_line;
  }
  return $self->{_qsub};
}

##other accessor are in base class##
######################
#command line methods#
######################
}
General documentation
CONTACTTop
Post general queries to ensembl-dev@ebi.ac.uk
APPENDIXTop
The rest of the documentation details each of the object methods. Interna
l
methods are usually preceded with a _