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

Diff of /FigKernelPackages/Subsystem.pm

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

revision 1.22, Tue Jul 20 18:20:14 2004 UTC revision 1.23, Tue Aug 3 19:13:25 2004 UTC
# Line 865  Line 865 
865    
866      $ENV{PATH} = "${FIG_Config::ext_bin}:$ENV{PATH}";      $ENV{PATH} = "${FIG_Config::ext_bin}:$ENV{PATH}";
867    
868        #
869        # We're going to divide the run into $n_chunks chunks.
870        #
871    
872        my $n_chunks = 10;
873    
874        my($log);
875        open($log, ">$ss_dir/$job_id.log");
876    
877        for (my $this_chunk = 1; $this_chunk <= $n_chunks; $this_chunk++)
878        {
879      my $app_input = <<EOINP;      my $app_input = <<EOINP;
880  ['\$BILLOGIX/top'].  ['\$BILLOGIX/top'].
881  loadup.  loadup.
882    asserta(part($this_chunk, $n_chunks)).
883  asserta(url_default_seed('$seed')).  asserta(url_default_seed('$seed')).
884  asserta(url_export_part('$export_part')).  asserta(url_export_part('$export_part')).
885  asserta(ss_directory('$ss_dir')).  asserta(ss_directory('$ss_dir')).
# Line 879  Line 891 
891      print STDERR <<EOF;      print STDERR <<EOF;
892  Starting app  Starting app
893    
894    chunk $this_chunk of $n_chunks
895  ss_name = $ss_name  ss_name = $ss_name
896  ss_dir = $ss_dir  ss_dir = $ss_dir
897  user = $user  user = $user
# Line 892  Line 905 
905  EOF  EOF
906  # feh, put in a block to reset perlmode indentation.  # feh, put in a block to reset perlmode indentation.
907  {  {
908      my($app_read, $app_write, $log);              my($app_read, $app_write);
   
     open($log, ">$ss_dir/$job_id.log");  
909    
910      #      #
911      # Start the actual application with stdin and stdout redirected      # Start the actual application with stdin and stdout redirected
# Line 944  Line 955 
955      print STDERR "Return status is $?\n";      print STDERR "Return status is $?\n";
956      print $log "Return status is $?\n";      print $log "Return status is $?\n";
957    
958                #
959                # This chunk has finished. We should see a file
960                # rows.$this_chunk.$n_chunks.
961                #
962            }
963        }
964        #
965        # At this point, the extension is finished (we've run the
966        # $n_chunks parts of the extension job).
967        #
968    
969      #      #
970      # At this point, the extension is finished.      # We read in all the individual rows files, writing the single
971      # Make sure we have a rows file after the run.      # concatenation of rows.
972      #      #
973    
974      my $ssaD = $self->{dir};      my $ssaD = $self->{dir};
975    
976      my $rows_file = "$ssaD/rows";      my $rows_file = "$ssaD/rows";
977      if (! -f $rows_file)  
978        my $rowFH;
979        if (!open($rowFH, ">$rows_file"))
980        {
981            my $err = "Cannot open rows file $ssaD/rows for writing: $!\n";
982            print STDERR $err;
983            print $log $err;
984            return;
985        }
986    
987        for (my $this_chunk = 1; $this_chunk <= $n_chunks; $this_chunk++)
988        {
989            my $chunkFH;
990            my $cfile = "$ssaD/rows.$this_chunk.$n_chunks";
991            if (!open($chunkFH, "<$cfile"))
992            {
993                my $err =  "Cannot open rows file $cfile for reading: $!\n";
994                print STDERR $err;
995                print $log $err;
996                return;
997            }
998            while (<$chunkFH>)
999      {      {
1000          print STDERR "Missing rows file: $ssaD/rows\n";              print $rowFH $_;
1001          print $log "Missing rows file: $ssaD/rows\n";          }
1002            close($chunkFH);
1003        }
1004        close($rowFH);
1005    
1006        #
1007        # Concatenate the assignments into the assignment directory.
1008        #
1009    
1010        my $assignments_file = "$assign_dir$job_id";
1011        my $assignFH;
1012    
1013        if (!open($assignFH, ">$assignments_file"))
1014        {
1015            my $err = "Cannot open assignments file $assignments_file for writing: $!\n";
1016            print STDERR $err;
1017            print $log $err;
1018          return;          return;
1019      }      }
1020    
1021        for (my $this_chunk = 1; $this_chunk <= $n_chunks; $this_chunk++)
1022        {
1023            my $aFH;
1024            my $afile = "$ssaD/assignments.$this_chunk.$n_chunks";
1025            if (!open($aFH, "<$afile"))
1026            {
1027                my $err = "Cannot open assignments file $afile for reading: $!\n";
1028                print STDERR $err;
1029                print $log $err;
1030                return;
1031            }
1032            while (<$aFH>)
1033            {
1034                print $assignFH $_;
1035            }
1036            close($aFH);
1037        }
1038        close($assignFH);
1039    
1040    
1041    
1042      #      #
1043      # Back up the spreadsheet, and append the rows file to it.      # Back up the spreadsheet, and append the rows file to it.
1044      #      #
# Line 988  Line 1067 
1067      $self->incr_version();      $self->incr_version();
1068  }  }
1069    
 }  
   
1070    
1071  sub set_current_extend_pid  sub set_current_extend_pid
1072  {  {

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3