Changeset 210

Show
Ignore:
Timestamp:
04/28/09 19:21:50 (7 months ago)
Author:
bmoore
Message:

Just a bit of whitespace cleanup on mpi_maker

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • MPI/mpi_maker

    r209 r210  
    2222      $ENV{CGL_GO_SOURCE} = "$FindBin::Bin/../lib/CGL/gene_ontology.obo" 
    2323   } 
    24     
     24 
    2525   $CMD_ARGS = join(' ', @ARGV); 
    26     
     26 
    2727   #what to do on ^C 
    2828   $SIG{'INT'} = sub { 
     
    3333      } 
    3434      exit (1); 
    35    };     
    36     
     35   }; 
     36 
    3737   #supress warnings from storable module 
    3838   $SIG{'__WARN__'} = sub { 
     
    4848         my $die_count = $LOG->get_die_count(); 
    4949         $die_count++; 
    50           
     50 
    5151         $LOG->add_entry("DIED","RANK",$RANK); 
    5252         $LOG->add_entry("DIED","COUNT",$die_count); 
     
    5959 
    6060      die "#----------------------\n", 
    61           "FATAL: failed!!\n", 
     61         "FATAL: failed!!\n", 
    6262          "#----------------------\n", 
    6363          $_[0] . "\n"; 
     
    145145 
    146146     -predictor|p <type>  Selects the predictor(s) to use when building 
    147                           annotations.  Use a ',' to seperate types (no spaces). 
    148                           i.e. -predictor=snap,augustus,fgenesh 
    149  
    150                           types: snap 
    151                                 augustus 
    152                                 fgenesh 
    153                                 genemark 
    154                                 est2genome (Uses EST's directly) 
    155                                 abinit (ab-initio predictions) 
    156                                 model_gff (Passes through GFF3 annotations) 
     147                         annotations.  Use a ',' to seperate types (no spaces). 
     148                         i.e. -predictor=snap,augustus,fgenesh 
     149 
     150                         types: snap 
     151                                augustus 
     152                                fgenesh 
     153                                genemark 
     154                                est2genome (Uses EST's directly) 
     155                                abinit (ab-initio predictions) 
     156                                model_gff (Passes through GFF3 annotations) 
    157157 
    158158     -RM_off|R           Turns all repeat masking off. 
     
    163163 
    164164     -force|f            Forces maker to delete old files before running again. 
    165                         This will require all blast analyses to be rerun. 
     165                        This will require all blast analyses to be rerun. 
    166166 
    167167     -again|a            Caculate all annotations and output files again even if 
    168                         no settings have changed. 
     168                        no settings have changed. 
    169169 
    170170     -evaluate|e         Run Evaluator on final annotations (under development). 
     
    249249my $root = 0; #define root node (only changed for debugging) 
    250250 
    251 #---Process options on the command line  
     251#---Process options on the command line 
    252252try{ 
    253253    GetOptions("RM_off|R" => \$OPT{R}, 
     
    267267catch Error::Simple with{ 
    268268    my $E = shift; 
    269      
     269 
    270270    print STDERR $E->{-text}; 
    271271    die "\n\nMaker failed parsing command line options!!\n\n"; 
     
    288288      #get arguments off the command line 
    289289      my @ctlfiles = @ARGV; 
    290        
     290 
    291291      if (not @ctlfiles) { 
    292292         if (-e "maker_opts.ctl" && 
     
    294294             -e "maker_exe.ctl" 
    295295            ) { 
    296              
     296 
    297297            @ctlfiles = ("maker_opts.ctl", 
    298298                         "maker_bopts.ctl", 
     
    306306         } 
    307307      } 
    308        
     308 
    309309      #--Control file processing 
    310        
     310 
    311311      #set up control options from control files 
    312312      %CTL_OPT = GI::load_control_files(\@ctlfiles, \%OPT, $size); 
    313        
     313 
    314314      #--open datastructure controller 
    315315      $DS_CTL = ds_utility->new(\%CTL_OPT); 
    316        
     316 
    317317      #--set up gff database 
    318318      $GFF_DB = new GFFDB(\%CTL_OPT); 
    319319      $build = $GFF_DB->next_build; 
    320        
     320 
    321321      #---load genome multifasta/GFF3 file 
    322322      $iterator = new Iterator::Any( -fasta => $CTL_OPT{'genome'}, 
     
    328328      print STDERR $E->{-text}; 
    329329      print STDERR "\n\nMaker failed while examining startup data\n", 
    330                    "(control files and input fasta files)!!\n\n"; 
     330                  "(control files and input fasta files)!!\n\n"; 
    331331      my $code = 2; 
    332332      $code = $E->{-value} if (defined($E->{-value})); 
    333        
     333 
    334334      exit($code); 
    335335   }; 
     
    341341 
    342342   #====ACTUAL MPI COMMUNICATION 
    343     
     343 
    344344   #---main code for distribution of mpi data starts here 
    345345 
     
    376376         my $helper = shift @helper_stack; 
    377377         $chunk = ${thaw($chunk)}; 
    378           
     378 
    379379         #tell helper node I need help 
    380380         MPI_Send(\$rank, 1,  MPI_INT, $helper, $who_I_am, MPI_COMM_WORLD); 
    381           
     381 
    382382         #tell helper node a chunk is coming 
    383383         MPI_Send(\$go_chunk, 1, MPI_INT, $helper, $request_status, MPI_COMM_WORLD ); 
    384           
     384 
    385385         #send the chunk 
    386386         MPI_SendII(\$chunk, $helper, $mpi_data, MPI_COMM_WORLD); 
     
    419419         #tell helper node who I am 
    420420         MPI_Send(\$rank, 1,  MPI_INT, $helper, $who_I_am, MPI_COMM_WORLD); 
    421           
     421 
    422422         #tell helper node that no chunk is coming (resets to ask for tier) 
    423423         MPI_Send(\$reset, 1, MPI_INT, $helper, $request_status, MPI_COMM_WORLD ); 
     
    430430         my $what; 
    431431         my $rs_type; 
    432           
     432 
    433433         #see who asks for a file 
    434434         MPI_Recv(\$who, 1,  MPI_INT, -2, $who_I_am, MPI_COMM_WORLD); 
    435           
     435 
    436436         #see what the mpi node wants 
    437437         MPI_Recv(\$what, 1, MPI_INT, $who, $what_I_want, MPI_COMM_WORLD); 
    438           
     438 
    439439         #if the node wants a tier to process, do this 
    440440         if($what == $need_tier){ 
    441441            #receive result status 
    442             MPI_Recv(\$rs_type, 1,  MPI_INT, $who, $result_status, MPI_COMM_WORLD);  
    443              
     442            MPI_Recv(\$rs_type, 1,  MPI_INT, $who, $result_status, MPI_COMM_WORLD); 
     443 
    444444            #get result if available 
    445445            if($rs_type == $yes_result){ 
     
    452452               } 
    453453            } 
    454              
     454 
    455455            #if a contig is available send tier 
    456456            my $tier; 
     
    486486               MPI_Send(\$yes_c_res, 1, MPI_INT, $who, $c_res_status, MPI_COMM_WORLD); 
    487487               MPI_SendII(\$res_loc[$who], $who, $mpi_data, MPI_COMM_WORLD); 
    488                 
     488 
    489489               my @locs = @{$res_loc[$who]}; 
    490490               $res_loc[$who] = undef; 
    491                 
     491 
    492492               #if primary node has chunk result to send then send them 
    493493               while (defined(my $loc = shift @locs)){ 
     
    502502               MPI_Send(\$no_c_res, 1, MPI_INT, $who, $c_res_status, MPI_COMM_WORLD); 
    503503            } 
    504              
     504 
    505505            #continue the rest if the node needs a helper 
    506506            if($what == $need_helper){ 
     
    508508               my $num_helpers_req; 
    509509               MPI_Recv(\$num_helpers_req, 1, MPI_INT, $who, $work_order, MPI_COMM_WORLD); 
    510                 
     510 
    511511               #number of secondary node helpers available 
    512512               my $sec_node_avail = @helper_stack; 
    513                 
     513 
    514514               #number of primary node threads available 
    515515               my $thr_avail = ($t_need_flag == 2 && ! defined $t_chunk) ? 1 : 0; 
    516                 
     516 
    517517               #signal that no helpers are available 
    518518               if($sec_node_avail == 0 && $thr_avail == 0){ 
     
    522522                  #helpers to send 
    523523                  my $helpers = []; 
    524                    
     524 
    525525                  #secondary node helpers 
    526526                  if($sec_node_avail > 0){ 
     
    530530                        push(@{$helpers}, $helper); 
    531531                     } 
    532                       
     532 
    533533                     $num_helpers_req -= @{$helpers}; 
    534534                  } 
    535                    
     535 
    536536                  #primary node thread helper 
    537537                  my $root_helper_flag = 0; 
     
    542542                     $root_helper_flag = 1; 
    543543                  } 
    544                    
     544 
    545545                  #say helper is available and send ids of the helpers 
    546546                  MPI_Send(\$yes_helper, 1, MPI_INT, $who, $request_status, MPI_COMM_WORLD); 
    547547                  MPI_SendII(\$helpers, $who, $mpi_data, MPI_COMM_WORLD); 
    548                 
     548 
    549549                  #take chunk as a helper 
    550550                  if($root_helper_flag){ 
     
    552552                     my $who2; 
    553553                     MPI_Recv(\$who2, 1,  MPI_INT, $who, $who_I_am, MPI_COMM_WORLD); 
    554                       
     554 
    555555                     #get go_chunk request_status 
    556556                     my $req_stat; 
     
    560560                        my $chnk; 
    561561                        MPI_RecvII(\$chnk, $who2, $mpi_data, MPI_COMM_WORLD); 
    562                          
     562 
    563563                        $t_need_flag = 0; 
    564564                        $t_chunk = freeze(\$chnk); 
     
    579579            my $owner; 
    580580            MPI_Recv(\$owner, 1, MPI_INT, $who, $work_order, MPI_COMM_WORLD); 
    581              
     581 
    582582            if($owner == $root){#if root is owner get result 
    583583               my $chunk_res; 
     
    624624      MPI_Send(\$terminate, 1, MPI_INT, $i, $request_status, MPI_COMM_WORLD); 
    625625   } 
    626     
     626 
    627627   #---release thread 
    628628   $t_terminate = 1; #signals to thread to clean up 
     
    752752            my $num_helpers_req = $tier->num_chunks; 
    753753            MPI_Send(\$num_helpers_req, 1, MPI_INT, $root, $work_order, MPI_COMM_WORLD); 
    754              
     754 
    755755            #see if helper is available 
    756756            my $help_stat; 
    757757            MPI_Recv(\$help_stat, 1, MPI_INT, $root, $request_status, MPI_COMM_WORLD); 
    758              
     758 
    759759            if($help_stat == $yes_helper){ 
    760760               my $helpers; 
    761761               MPI_RecvII(\$helpers, $root, $mpi_data, MPI_COMM_WORLD); 
    762                 
     762 
    763763               #send chunk to helper 
    764764               foreach my $helper (@{$helpers}){ 
    765765                  #say I'm the one who needs help 
    766766                  MPI_Send(\$rank, 1,  MPI_INT, $helper, $who_I_am, MPI_COMM_WORLD); 
    767                    
     767 
    768768                  #send go_chunk request_status 
    769769                  MPI_Send(\$go_chunk, 1, MPI_INT, $helper, $request_status, MPI_COMM_WORLD); 
    770                    
     770 
    771771                  #send chunk 
    772772                  my $chnk = $tier->next_chunk;