[Bio] / FigKernelPackages / ProtSims.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/ProtSims.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15, Tue Sep 14 19:09:17 2010 UTC revision 1.16, Tue Sep 14 21:34:35 2010 UTC
# Line 118  Line 118 
118      {      {
119          my @cmd = ($blat_cmd, $dbF, $qF, "-prot", "-out=blast8", $tmpF);          my @cmd = ($blat_cmd, $dbF, $qF, "-prot", "-out=blast8", $tmpF);
120    
121          my $rc = system_with_redirect(\@cmd, { stdout => '/dev/null' } );          #
122            # When running under FCGI, the system_with_redirect fails due to
123            # the FCGI library redefining open.
124            #
125    
126            my $rc;
127            if (defined($ENV{FCGI_ROLE}))
128            {
129                $rc = system(@cmd);
130            }
131            else
132            {
133                $rc = system_with_redirect(\@cmd, { stdout => '/dev/null' } );
134            }
135    
136          print STDERR "Blat returns $rc: @cmd\n";          print STDERR "Blat returns $rc: @cmd\n";
137          if ($rc != 0)          if ($rc != 0)
138          {          {
# Line 190  Line 204 
204      {      {
205          my $tmpQ = "$tmp_dir/tmpQ.$$";          my $tmpQ = "$tmp_dir/tmpQ.$$";
206          &gjoseqlib::print_alignment_as_fasta($tmpQ,\@rerun);          &gjoseqlib::print_alignment_as_fasta($tmpQ,\@rerun);
207    
208    
209            #
210            # If we're under FCGI (and thus under the servers), and the loadavg is low, do a small parallel run.
211            #
212    
213            my @par = ();
214            if (defined($ENV{FCGI_ROLE}) && open(my $la, "/proc/loadavg"))
215            {
216                my $l = <$la>;
217                chomp $l;
218                my @vals = split(/\s+/, $l);
219                my @procs = split(/\//, $vals[3]);
220                if ($vals[0] < 4 && $procs[0] < 8)
221                {
222                    @par = ("-a", 4);
223                }
224            }
225    
226    
227          # my $cmd = "$blastall_cmd -m 8 -i $tmpQ -d $dbF -FF -p blastp -e 1e-5";          # my $cmd = "$blastall_cmd -m 8 -i $tmpQ -d $dbF -FF -p blastp -e 1e-5";
228          my @cmd = ($blastall_cmd,  '-m', 8, '-i', $tmpQ, '-d', $dbF, '-FF', '-p', 'blastp', '-e', '1e-5');          my @cmd = ($blastall_cmd,  '-m', 8, '-i', $tmpQ, '-d', $dbF, '-FF', '-p', 'blastp', '-e', '1e-5', @par);
229          #print STDERR "$cmd\n";          #print STDERR "$cmd\n";
230          #open(BL, "$cmd|") or die "ProtSims::blastP: pipe to blast failed with $!: $cmd\n";          #open(BL, "$cmd|") or die "ProtSims::blastP: pipe to blast failed with $!: $cmd\n";
231    

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3