BatchSystem::SBS::ScriptsCommon - common function & var for BatchSystem::SBS scripts


BatchSystem-SBS documentation Contained in the BatchSystem-SBS distribution.

Index


Code Index:

NAME

Top

BatchSystem::SBS::ScriptsCommon - common function & var for BatchSystem::SBS scripts

DESCRIPTION

Top

main declaration + common parsing of comman line argument

SYNOPSIS

Top

EXPORT

Top

$sbs

the simple batch system

FUNCTIONS

Top

init()

parse commandline argument for

--config=sbsconfig.xml [compulsory]
--workingdir=/path/to/dir [optional]

overwrites the working directory configures into the config file.

AUTHOR

Top

Alexandre Masselot, <alexandre.masselot@genebio.com>

BUGS

Top

Please report any bugs or feature requests to bug-batchsystem-sbs@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=BatchSystem-SBS. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


BatchSystem-SBS documentation Contained in the BatchSystem-SBS distribution.

package BatchSystem::SBS::ScriptsCommon;

use Getopt::Long;
use BatchSystem::SBS;
require Exporter;
our @ISA=qw(Exporter);
our @EXPORT=qw(&init $sbs);
our $sbs;
sub init{
  my $p=new Getopt::Long::Parser;
  $p->configure("pass_through");
  my($configfile, $workingDir);
  if (!$p->getoptions(
		  "config=s"=>\$configfile,
		  "workingdir=s"=>\$workingDir,
		 )
     ){
  }
  die "no --config=file.xml was passed" unless $configfile;
  $sbs=BatchSystem::SBS->new();
  $sbs->readConfig(file=>$configfile);
  $sbs->workingDir($workingDir) if $workingDir;
  $sbs->scheduler->__joblist_pump();
  $sbs->scheduler->resourcesStatus_init();
  $sbs->scheduler->queuesStatus_init();
}
1;