Skip to content

Commit

Permalink
More robust, and allow different memory requirements per script
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Howe committed Jun 11, 2018
1 parent 5d24633 commit de0e498
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions scripts/preFTPdumps/perSpecies/pre_ftp_dumps.pl
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
my @script_conf = (
{ script => 'dump_species_functional_descriptions.pl', output => 'functional_descriptions.txt', all => 1 },
{ script => 'dump_protein_domains.pl', output => 'protein_domains.csv', all => 1 },
{ script => 'dump_species_orthologs.pl', output => 'orthologs.txt', all => 1 },
{ script => 'dump_species_orthologs.pl', output => 'orthologs.txt', all => 1, mem => 6000 },
{ script => 'dump_confirmed_genes.pl', output => 'confirmed_genes.fa', all => 1 },
{ script => 'dump_gpi.pl', output => 'gene_product_info.gpi', all => 1 },
{ script => 'dump_species_gene_interactions.pl', output => 'interactions.txt' },
{ script => 'dump_gpi.pl', output => 'gene_product_info.gpi', all => 1, mem => 6000 },
{ script => 'dump_species_gene_interactions.pl', output => 'interactions.txt', mem => 6000 },
{ script => 'dump_interpolated.pl', output => 'interpolated_clones.txt' },
{ script => 'dump_promoters.pl', output => 'potential_promotors.fa' },
{ script => 'dump_swissprot.pl', output => 'swissprot.txt' },
Expand All @@ -64,12 +64,8 @@
# global aspects
my $log = Log_files->make_build_log($wormbase);
my $defaultMem = 4000;
my $lsf = LSF::JobManager->new(-M => $defaultMem,
-R => "select[mem>$defaultMem] rusage[mem=$defaultMem]",
-J => 'perSpeciesDumps',
-e => '/dev/null',
-o => '/dev/null'
);
my $lsf_out = $wormbase->build_lsfout;
my $lsf = LSF::JobManager->new();

my %files_to_check;
my %core_species = $wormbase->species_accessors;
Expand All @@ -87,13 +83,14 @@
# note that all scripts need to be run against autoace, because only that has all
# of the necessary objects filled in
my $options = $item->{options} . " -database " . $wormbase->autoace;

my $mem = (exists $item->{mem}) ? $item->{mem} : $defaultMem;
next unless $item->{all} or $spe eq 'elegans';

next unless &check_script($script);

my $outfile = "$report_dir/${spe}.${output}";
&clean_previous_output($outfile);
&queue_script($wb,$script, $outfile, $options);
&queue_script($wb, $script, $spe, $outfile, $mem, $options);
push @{$files_to_check{$script}}, $outfile;
}
}
Expand Down Expand Up @@ -127,15 +124,21 @@

# LSF submit $script
sub queue_script {
my ($wb,$script, $outf, $opts) = @_;
my ( $wb, $script, $sp, $outf, $mem, $opts) = @_;

my $cmd = "preFTPdumps/perSpecies/$script";
$cmd .= " -outfile $outf";
if (defined $opts) {
$cmd .= " $opts";
}
$cmd = $wb->build_cmd($cmd);
$lsf->submit($cmd);

my @lsf_opts = (-M => $mem,
-R => "select[mem>=$mem] rusage[mem=$mem]",
-J => 'perSpeciesDumps',
-o => "${lsf_out}/${script}.${sp}.lsfout");

$lsf->submit(@lsf_opts, $cmd);
}

# basically try to delete $file
Expand Down

0 comments on commit de0e498

Please sign in to comment.