G::Tools

PBS

Included libraries Package variables General documentation Methods

Package variables top
Globals (from use vars definitions)
@EXPORT
$VERSION
@EXPORT_OK
Included modulestop
G::Messenger
SubOpt
strict
Inherit top
AutoLoader Exporter
Synopsistop
No synopsis!
Descriptiontop
No description!
Methodstop
newNo descriptionCode
qsubNo descriptionCode

Methods description


Methods code

newdescriptiontopprevnext
sub new {
    my $pkg = shift;
    my $filename = shift;
    my $option = shift;
    my $this;

    return $this;
}
qsubdescriptiontopprevnext
sub qsub {
    my $option;
    my @args;
    foreach(@_){
	if($_ eq "-V"){	
	    $option.="-V ";
	}else{
	    push(@args,$_);
	}
    }
    
    &opt_default(A=>"",a=>"",c=>"",e=>"",j=>"",k=>"",l=>"",N=>"",o=>"",p=>"",q=>"",r=>"",S=>"",u=>"",v=>"");
    @args=opt_get(@args);

    my @command=@args;
    my @param;
    my %opt;
    my @tmp;
    my $id;
    $opt{A}=opt_val("A");
    $opt{a}=opt_val("a");
    $opt{c}=opt_val("c");
    $opt{e}=opt_val("e");
    $opt{j}=opt_val("j");
    $opt{k}=opt_val("k");
    $opt{l}=opt_val("l");
    $opt{N}=opt_val("N");
    $opt{o}=opt_val("o");
    $opt{p}=opt_val("p");
    $opt{q}=opt_val("q");
$opt{r}
=opt_val("r"); $opt{S}=opt_val("S"); $opt{u}=opt_val("u"); $opt{v}=opt_val("v"); my $who=qx!whoami!; my $time=time; $who=~tr/\n//d;
mkdir("/tmp/$who",0777); opendir(DIR,"/tmp/$who"); @tmp=readdir(DIR); $time+=$##tmp;
foreach(sort keys(%opt)){ next if($opt{$_} eq ''); push(@param,'-'.$_); push(@param,$opt{$_}); } $option.=join(' ',@param); open(OUT,">/tmp/$who/$time.sh"); print OUT "\#\!\/bin\/sh\n\n"; foreach(@command){ print OUT $_,"\n"; } close(OUT); system('qsub '.$option.' /tmp/'.$who.'/'.$time.'.sh > '.'/tmp/'.$who.'/'.$time.'.log'); open(LOG,"/tmp/$who/$time.log"); $id=<LOG>; return $id; } sub qstat{ my @param; my @tmp; foreach(@_){ if($_ eq '-a' || $_ eq '-B' || $_ eq '-Bf' || $_ eq '-Qf' || $_ eq '-f' || $_ eq '-u' || $_ eq '-r' || $_ eq '-i' || $_ eq '-G' || $_ eq '-M' || $_ eq '-n' || $_ eq '-R' || $_ eq '-s' || $_ eq '-q'){ push(@param,$_); } else{ push(@tmp,$_); } } my @args=opt_get(@tmp); my $id=shift @args; my $option=join(' ',@param); my $qstat; my $time=time; opendir(DIR,"./"); @tmp=readdir(DIR); $time+=$##tmp;
$id=~tr/\n//d;
$option=~tr/\n//d;
system("qstat $option $id > ".$time.'.stat'); open(STAT,"$time.stat"); $qstat=join('',<STAT>); unlink("$time.stat"); return $qstat; } sub DESTROY { my $self = shift; } 1; __END__ ## Below is the stub of documentation for your module. You better edit it!
=head1 NAME G::Tools::PBS - Perl extension for blah blah blah =head1 SYNOPSIS use G::Tools::PBS; blah blah blah =head1 DESCRIPTION Stub documentation for G::Tools::PBS was created by h2xs. It looks like the author of the extension was negligent enough to leave the stub unedited. Blah blah blah. =head1 AUTHOR A. U. Thor, a.u.thor@a.galaxy.far.far.away =head1 SEE ALSO perl(1). =cut
}

General documentation

No general documentation available.