[Bio] / FortyEight / batch_rast.pl Repository:
ViewVC logotype

Diff of /FortyEight/batch_rast.pl

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

revision 1.7, Tue Jan 19 17:05:06 2010 UTC revision 1.8, Tue Jan 19 17:16:32 2010 UTC
# Line 117  Line 117 
117      &do_pchs($job);      &do_pchs($job);
118      &do_scenario($job);      &do_scenario($job);
119      &do_export($job);      &do_export($job);
120        &mark_job_user_complete($job);
121  }  }
122    
123  sub do_upload  sub do_upload
# Line 260  Line 261 
261      &run("$FIG_Config::bin/rp_write_exports", $job->dir);      &run("$FIG_Config::bin/rp_write_exports", $job->dir);
262  }  }
263    
264    sub mark_job_user_complete
265    {
266        my($job) = @_;
267    
268        my $job_dir = $job->dir;
269        my $meta = $job->meta;
270        my $job_id = $job->id;
271    
272        system("$FIG_Config::bin/send_job_completion_email", $job_dir);
273    
274        $meta->set_metadata("status.final", "complete");
275    
276        #
277        # If the job is a SEED candidate, send VV email.
278        #
279    
280        if ($meta->get_metadata("import.suggested") or
281            $meta->get_metadata("import.candidate"))
282        {
283            my $gname = $job->genome_name;
284            my $mail = Mail::Mailer->new();
285            $mail->open({
286                To => 'Veronika Vonstein <veronika@thefig.info>, Robert Olson<olson@mcs.anl.gov>, Andreas Wilke<wilke@mcs.anl.gov>',
287                From => 'Annotation Server <rast@mcs.anl.gov>',
288                Subject => "RAST job $job_id marked for SEED inclusion",
289            });
290    
291            print $mail <<END;
292    RAST job #$job_id ($gname) was submitted for inclusion into the SEED, and has finished its processing.
293    END
294            $mail->close();
295    
296            #
297            # We also mark the job as ACTIVE again so that the
298            # normal post-seed-acceptance pipeline stages may execute.
299            #
300            open(F, ">$job_dir/ACTIVE");
301            close(F);
302        }
303        else
304        {
305            #
306            # Otherwise it is completely done.
307            #
308            &mark_job_done($job);
309        }
310    }
311    
312    sub mark_job_done
313    {
314        my($job) = @_;
315    
316        #
317        # If we spooled the job out onto the lustre disk, we need to
318        # spool it back.
319        #
320    
321        my $meta = $job->meta;
322        my $job_dir = $job->dir;
323    
324        if ($meta->get_metadata("lustre_required"))
325        {
326            &run("$FIG_Config::bin/rp_lustre_finish", $job_dir);
327        }
328        if (open(D, ">$job_dir/DONE"))
329        {
330            print D time . "\n";
331            close(D);
332        }
333        else
334        {
335            warn "Error opening $job_dir/DONE: $!\n";
336        }
337    
338        unlink("$job_dir/ACTIVE");
339    }
340    
341  sub run  sub run
342  {  {

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3