Bio-Grid-Run-SGE

 view release on metacpan or  search on metacpan

bin/rocksblast  view on Meta::CPAN

		$tmp_script_filename = $pbs_batch_script_dir . '/array-job' . $arrayjobcount;	  

		############################
                #write the blast script
                ###########################
		
		open SCRIPT_OUT, ">$tmp_script_filename";
		print SCRIPT_OUT $single_script_template;
		close SCRIPT_OUT;
		#make it executable for this user
		`chmod u+x $tmp_script_filename`;
			                      		                  
	} ## end do all seqs in jobdir


# create the basic sge_arrayjob_run.sh
print "\nCREATING JOB_ARRAY SCRIPT\n";
open SCRIPT_OUT, ">$job_dir/tmp/sge_arrayjob_run.sh";
print SCRIPT_OUT "#!/bin/bash\n";
print SCRIPT_OUT "export SGE_ROOT=/opt/gridengine" . "\n";
print SCRIPT_OUT 'echo "Task id is $SGE_TASK_ID"' . "\n";

bin/rocksblast  view on Meta::CPAN

											

			# create the sge sh script to run run blastic
			open SCRIPT_OUT, ">$job_dir/tmp/sge_blastix_run.sh";
			print SCRIPT_OUT "#!/bin/bash\n";
			print SCRIPT_OUT "export PERL5LIB=/home/opt/lib/perl\n";
			print SCRIPT_OUT "$blastix_script_name\n";
			close SCRIPT_OUT;
			
                        #make it executable for this user
			`chmod u+x $blastix_script_name`;

			##################################
			# now submit the job
			##################################

			print STDERR "QSUB: $qdir/qsub -hold_jid $job_id -N $Blast_param{'job_name'} -p $prio -e $job_dir/tmp/tmp_error -o $job_dir/tmp/tmp_output $job_dir/tmp/sge_blastix_run.sh\n";


			$retval = `$qdir/qsub -hold_jid $job_id -N $Blast_param{'job_name'} -p $prio -e $job_dir/tmp/tmp_error -o $job_dir/tmp/tmp_output $job_dir/tmp/sge_blastix_run.sh`;
			

lib/Bio/Grid/Run/SGE/Log/Analysis.pm  view on Meta::CPAN


sub write {
  my ($self) = @_;

  my $cmd_f = $self->failed_restart_file;

  open my $cmd_fh, '>', $cmd_f or confess "Can't open filehandle: $!";
  print $cmd_fh $self->restart_script;
  $cmd_fh->close;

  chmod 0755, $cmd_f;

  my $log_f = $self->failed_log_file;

  open my $log_fh, '>', $log_f or confess "Can't open filehandle: $!";

  print $log_fh $self->gen_report(1);
  $log_fh->close;

  #CREATE SCRIPT TO UPDATE RERUN JOBS
  $self->_write_update_script;

lib/Bio/Grid/Run/SGE/Log/Analysis.pm  view on Meta::CPAN

  push @post_log_cmd, $env->{worker_env_script};
  push @post_log_cmd, $env->{script_bin}, '--stage', 'log', '--job_id', $env->{job_id},
    $env->{worker_config_file};

  my $update_log_file = $self->failed_update_file;

  open my $update_log_fh, '>', $update_log_file or confess "Can't open filehandle: $!";
  print $update_log_fh join( " ", "cd", "'" . $conf->{working_dir} . "'", '&&', @post_log_cmd ), "\n";
  $update_log_fh->close;

  chmod 0755, $update_log_file;

  return;
}

__PACKAGE__->meta->make_immutable();

lib/Bio/Grid/Run/SGE/Log/Notify.pod  view on Meta::CPAN


=head1 DESCRIPTION

This guide helps you to set up job notifications for L<Bio::Grid::Run::SGE>

To get job notifiations, create a global config file
F<$HOME/.bio-grid-run-sge.conf.yml>. It might be wise to restrict reading
permission, as you might use it to store account details (email, jabber,
twitter, etc.) for job notifiations.

  chmod 600 ~/.bio-grid-run-sge.conf


=head3 Notifications via passwordless SMTP server

Example contents:

    ---
    notify:
      mail:
        dest: person.in.charge@example.com

lib/Bio/Grid/Run/SGE/Master.pm  view on Meta::CPAN


  $self->log->info( "post processing: " . join( " ", @cmd, @hold_arg, @post_cmd ) );

  my $post_cmd_file
    = catfile( $conf->{tmp_dir}, sprintf( "post.%s.j%s.cmd", $env->{job_name_save}, $env->{job_id} ) );

  open my $post_fh, '>', $post_cmd_file or confess "Can't open filehandle: $!";
  say $post_fh join( " ", "cd", "'" . fastcwd . "'", '&&', @cmd, @post_cmd );
  $post_fh->close;

  chmod 0755, $post_cmd_file;

  system( @cmd, @hold_arg, @post_cmd ) == 0 or confess "post task system failed: $?";

  return;
}

1;

__END__

t/lib/Test/Util.pm  view on Meta::CPAN

  while (<$fh>) {
    if ( !$found_shebang && /^#!.*perl/ ) {
      print $ofh "#!$^X\n";
      $found_shebang++;
    } else {
      print $ofh $_;
    }
  }
  $ofh->close;
  $fh->close;
  chmod 0700, $new_script;
  return $new_script;
}

1;



( run in 0.270 second using v1.01-cache-2.11-cpan-496ff517765 )