- Timestamp:
- Mar 30, 2012, 2:49:37 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/ippScripts/scripts/lap_science.pl
r32534 r33638 33 33 # Global configuration constants that probably should be read from elsewhere. 34 34 my $qstack_threshold = 0.05; # Only make a quickstack if more than 5% of the exposures require it. 35 my $minimum_stack_inputs = 6; # We can avoid magicking stack inputs if we have more than this number.35 my $minimum_stack_inputs = 4; # We can avoid magicking stack inputs if we have more than this number. 36 36 37 37 GetOptions( … … 286 286 &my_die("Unable to perform chiptool -setimfiletoupdate: $error_code", $exposure->{exp_id}, $data_group); 287 287 } 288 if ($chip_magicDS_id != 0) {289 ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =290 run(command => $magicDS_update_cmd, verbose => $verbose);291 unless ($success) {292 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);293 &my_die("Unable to perform magicdstool -setfiletoupdate: $error_code", $exposure->{exp_id}, $data_group);294 }295 }288 # if ($chip_magicDS_id != 0) { 289 # ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 290 # run(command => $magicDS_update_cmd, verbose => $verbose); 291 # unless ($success) { 292 # $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 293 # &my_die("Unable to perform magicdstool -setfiletoupdate: $error_code", $exposure->{exp_id}, $data_group); 294 # } 295 # } 296 296 297 297 ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 551 551 $complete_fstacks++; 552 552 } 553 elsif (($stack->{final_state})&& 554 ($stack->{final_state} eq 'drop')) { 555 $complete_fstacks++; 556 } 553 557 elsif (($stack->{final_state})&&($stack->{final_state} eq 'new')&& 554 558 ($stack->{final_fault} >= 4)&&($stack->{final_fault} != 32767)) { … … 616 620 my $are_warped = 0; 617 621 my $are_magicked = 0; 618 619 622 foreach my $exposure (@$exposures) { 620 623 $total_exposures++; … … 706 709 $exposure->{data_state} = 'to_diff'; 707 710 } 708 if (($exposure->{diff_id})&&(&S64_IS_NOT_NULL($exposure->{diff_id}))) { 711 if (($exposure->{diff_id})&& 712 (&S64_IS_NOT_NULL($exposure->{diff_id}))&& 713 (($exposure->{diffRun_state} eq 'full')|| 714 ($exposure->{diffRun_state} eq 'error_cleaned')|| 715 ($exposure->{diffRun_state} eq 'cleaned')) 716 ) { 717 $are_magicked++; 709 718 $have_diff ++; 710 $exposure->{data_state} = 'to_magic'; 711 } 712 if (($exposure->{magicked})&& 713 ($exposure->{warpRun_state})&& 714 ($exposure->{warpRun_state} eq 'full')&& 715 (&S64_IS_NOT_NULL($exposure->{magicked}))) { # This exposure has been magicked, so it is through with diff. 716 $are_magicked++; 719 # $exposure->{data_state} = 'to_magic'; 717 720 $exposure->{data_state} = 'full'; 718 # $can_fstack ++; 719 } 720 &update_this_exposure($exposure); 721 } 722 # We no longer need to care about magic 723 # if (($exposure->{magicked})&& 724 # ($exposure->{warpRun_state})&& 725 # ($exposure->{warpRun_state} eq 'full')&& 726 # (&S64_IS_NOT_NULL($exposure->{magicked}))) { # This exposure has been magicked, so it is through with diff. 727 # $are_magicked++; 728 # $exposure->{data_state} = 'full'; 729 # # $can_fstack ++; 730 # } 731 unless ($debug) { 732 &update_this_exposure($exposure); 733 } 721 734 } 722 735 … … 744 757 if ($defined_fstack == 0) { # We have not yet made any stacks. 745 758 print "STATUS: We can attempt to queue deep final stacks.\n"; 746 my $Nstacks_made = &queue_muggle_finalstack($exposures); 759 my $Nstacks_made; 760 unless ($debug) { 761 $Nstacks_made = &queue_muggle_finalstack($exposures); 762 } 747 763 print "STATUS: Made $Nstacks_made final stacks.\n"; 748 764 exit($Nstacks_made); … … 752 768 if ($have_fstack == $defined_fstack) { # We have made all the stacks we have asked for (so far) 753 769 if ($are_magicked < $total_exposures) { # But we have not yet made diffs 770 # if ($have_diff < $total_exposures) { # We have not yet made diffs 754 771 if (($can_diff == $total_exposures)&& # And we have exposures that should be diffed. 755 772 ($have_diff < $can_diff)) { # and we haven't made them all yet, either. … … 759 776 # &update_this_exposure($exposure); 760 777 # } 761 &queue_diffs($exposures); 778 unless ($debug) { 779 &queue_diffs($exposures); 780 } 762 781 exit(0); 763 782 } … … 770 789 } 771 790 elsif ($are_magicked == $total_exposures) { # We have made all of the diffs, and propagated through magic 772 print "STATUS: We can create all remaining stacks possible.\n"; 773 my $Nstacks_made = &queue_magic_finalstack($exposures); 774 if ($Nstacks_made == 0) { # We have made all the stacks that we will ever make. 791 print "STATUS: We would create all remaining stacks possible, but no longer require magic.\n"; 792 # my $Nstacks_made = -1; 793 # unless ($debug) { 794 # $Nstacks_made = &queue_muggle_finalstack($exposures); 795 # } 796 # if ($Nstacks_made == 0) { # We have made all the stacks that we will ever make. 775 797 print "STATUS: No more stacks generated. Deactivating exposures for this complete lapRun.\n"; 776 &deactivate_exposures($exposures); 777 $command = "$laptool -updaterun -lap_id $lap_id"; 778 $command .= " -dbname $dbname " if defined $dbname; 779 $command .= " -set_state full "; 780 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 781 run(command => $command, verbose => $verbose); 782 unless ($success) { 783 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 784 &my_die("Unable to perform laptool -updaterun: $error_code", $lap_id); 785 } 798 unless ($debug) { 799 &deactivate_exposures($exposures); 800 801 $command = "$laptool -updaterun -lap_id $lap_id"; 802 $command .= " -dbname $dbname " if defined $dbname; 803 $command .= " -set_state full "; 804 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 805 run(command => $command, verbose => $verbose); 806 unless ($success) { 807 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 808 &my_die("Unable to perform laptool -updaterun: $error_code", $lap_id); 809 } 810 # } 786 811 exit(0); 787 812 } 788 else {789 print "STATUS: $Nstacks_made stacks made.\n";790 exit(0);791 }813 # else { 814 # print "STATUS: $Nstacks_made stacks made.\n"; 815 # exit(0); 816 # } 792 817 } 793 818 else { # What? … … 991 1016 foreach $exposure (@$exposures) { 992 1017 if (($exposure->{data_state} ne 'drop')&& 993 (S64_IS_NOT_NULL($exposure->{magicked}))&&1018 # (S64_IS_NOT_NULL($exposure->{magicked}))&& 994 1019 (S64_IS_NOT_NULL($exposure->{warp_id}))) { 995 1020 $warps .= " -warp_id $exposure->{warp_id} "; … … 1286 1311 if (@$stdout_buf == 0) { 1287 1312 # Nothing to do. 1313 $command = "$laptool -updaterun -lap_id $lap_id"; 1314 $command .= " -dbname $dbname " if defined $dbname; 1315 $command .= " -set_state done "; 1316 ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 1317 run(command => $command, verbose => $verbose); 1318 unless ($success) { 1319 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 1320 &my_die("Unable to perform laptool -updaterun: $error_code", $lap_id); 1321 } 1322 1288 1323 return(0); 1289 1324 } … … 1474 1509 $command .= " -set_data_state $exposure->{data_state} "; 1475 1510 } 1476 1477 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 1478 run(command => $command, verbose => $verbose); 1479 unless ($success) { 1480 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 1481 &my_die("Unable to perform laptool -updateexp: $error_code", $exposure->{lap_id}, $exposure->{proj_cell}); 1511 unless ($do_nothing) { 1512 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 1513 run(command => $command, verbose => $verbose); 1514 1515 unless ($success) { 1516 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 1517 &my_die("Unable to perform laptool -updateexp: $error_code", $exposure->{lap_id}, $exposure->{proj_cell}); 1518 } 1482 1519 } 1483 1520 }
Note:
See TracChangeset
for help on using the changeset viewer.
