Changeset 210
- Timestamp:
- 04/28/09 19:21:50 (7 months ago)
- Files:
-
- MPI/mpi_maker (modified) (28 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
MPI/mpi_maker
r209 r210 22 22 $ENV{CGL_GO_SOURCE} = "$FindBin::Bin/../lib/CGL/gene_ontology.obo" 23 23 } 24 24 25 25 $CMD_ARGS = join(' ', @ARGV); 26 26 27 27 #what to do on ^C 28 28 $SIG{'INT'} = sub { … … 33 33 } 34 34 exit (1); 35 }; 36 35 }; 36 37 37 #supress warnings from storable module 38 38 $SIG{'__WARN__'} = sub { … … 48 48 my $die_count = $LOG->get_die_count(); 49 49 $die_count++; 50 50 51 51 $LOG->add_entry("DIED","RANK",$RANK); 52 52 $LOG->add_entry("DIED","COUNT",$die_count); … … 59 59 60 60 die "#----------------------\n", 61 "FATAL: failed!!\n",61 "FATAL: failed!!\n", 62 62 "#----------------------\n", 63 63 $_[0] . "\n"; … … 145 145 146 146 -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,fgenesh149 150 types: snap151 augustus152 fgenesh153 genemark154 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) 157 157 158 158 -RM_off|R Turns all repeat masking off. … … 163 163 164 164 -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. 166 166 167 167 -again|a Caculate all annotations and output files again even if 168 no settings have changed.168 no settings have changed. 169 169 170 170 -evaluate|e Run Evaluator on final annotations (under development). … … 249 249 my $root = 0; #define root node (only changed for debugging) 250 250 251 #---Process options on the command line 251 #---Process options on the command line 252 252 try{ 253 253 GetOptions("RM_off|R" => \$OPT{R}, … … 267 267 catch Error::Simple with{ 268 268 my $E = shift; 269 269 270 270 print STDERR $E->{-text}; 271 271 die "\n\nMaker failed parsing command line options!!\n\n"; … … 288 288 #get arguments off the command line 289 289 my @ctlfiles = @ARGV; 290 290 291 291 if (not @ctlfiles) { 292 292 if (-e "maker_opts.ctl" && … … 294 294 -e "maker_exe.ctl" 295 295 ) { 296 296 297 297 @ctlfiles = ("maker_opts.ctl", 298 298 "maker_bopts.ctl", … … 306 306 } 307 307 } 308 308 309 309 #--Control file processing 310 310 311 311 #set up control options from control files 312 312 %CTL_OPT = GI::load_control_files(\@ctlfiles, \%OPT, $size); 313 313 314 314 #--open datastructure controller 315 315 $DS_CTL = ds_utility->new(\%CTL_OPT); 316 316 317 317 #--set up gff database 318 318 $GFF_DB = new GFFDB(\%CTL_OPT); 319 319 $build = $GFF_DB->next_build; 320 320 321 321 #---load genome multifasta/GFF3 file 322 322 $iterator = new Iterator::Any( -fasta => $CTL_OPT{'genome'}, … … 328 328 print STDERR $E->{-text}; 329 329 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"; 331 331 my $code = 2; 332 332 $code = $E->{-value} if (defined($E->{-value})); 333 333 334 334 exit($code); 335 335 }; … … 341 341 342 342 #====ACTUAL MPI COMMUNICATION 343 343 344 344 #---main code for distribution of mpi data starts here 345 345 … … 376 376 my $helper = shift @helper_stack; 377 377 $chunk = ${thaw($chunk)}; 378 378 379 379 #tell helper node I need help 380 380 MPI_Send(\$rank, 1, MPI_INT, $helper, $who_I_am, MPI_COMM_WORLD); 381 381 382 382 #tell helper node a chunk is coming 383 383 MPI_Send(\$go_chunk, 1, MPI_INT, $helper, $request_status, MPI_COMM_WORLD ); 384 384 385 385 #send the chunk 386 386 MPI_SendII(\$chunk, $helper, $mpi_data, MPI_COMM_WORLD); … … 419 419 #tell helper node who I am 420 420 MPI_Send(\$rank, 1, MPI_INT, $helper, $who_I_am, MPI_COMM_WORLD); 421 421 422 422 #tell helper node that no chunk is coming (resets to ask for tier) 423 423 MPI_Send(\$reset, 1, MPI_INT, $helper, $request_status, MPI_COMM_WORLD ); … … 430 430 my $what; 431 431 my $rs_type; 432 432 433 433 #see who asks for a file 434 434 MPI_Recv(\$who, 1, MPI_INT, -2, $who_I_am, MPI_COMM_WORLD); 435 435 436 436 #see what the mpi node wants 437 437 MPI_Recv(\$what, 1, MPI_INT, $who, $what_I_want, MPI_COMM_WORLD); 438 438 439 439 #if the node wants a tier to process, do this 440 440 if($what == $need_tier){ 441 441 #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 444 444 #get result if available 445 445 if($rs_type == $yes_result){ … … 452 452 } 453 453 } 454 454 455 455 #if a contig is available send tier 456 456 my $tier; … … 486 486 MPI_Send(\$yes_c_res, 1, MPI_INT, $who, $c_res_status, MPI_COMM_WORLD); 487 487 MPI_SendII(\$res_loc[$who], $who, $mpi_data, MPI_COMM_WORLD); 488 488 489 489 my @locs = @{$res_loc[$who]}; 490 490 $res_loc[$who] = undef; 491 491 492 492 #if primary node has chunk result to send then send them 493 493 while (defined(my $loc = shift @locs)){ … … 502 502 MPI_Send(\$no_c_res, 1, MPI_INT, $who, $c_res_status, MPI_COMM_WORLD); 503 503 } 504 504 505 505 #continue the rest if the node needs a helper 506 506 if($what == $need_helper){ … … 508 508 my $num_helpers_req; 509 509 MPI_Recv(\$num_helpers_req, 1, MPI_INT, $who, $work_order, MPI_COMM_WORLD); 510 510 511 511 #number of secondary node helpers available 512 512 my $sec_node_avail = @helper_stack; 513 513 514 514 #number of primary node threads available 515 515 my $thr_avail = ($t_need_flag == 2 && ! defined $t_chunk) ? 1 : 0; 516 516 517 517 #signal that no helpers are available 518 518 if($sec_node_avail == 0 && $thr_avail == 0){ … … 522 522 #helpers to send 523 523 my $helpers = []; 524 524 525 525 #secondary node helpers 526 526 if($sec_node_avail > 0){ … … 530 530 push(@{$helpers}, $helper); 531 531 } 532 532 533 533 $num_helpers_req -= @{$helpers}; 534 534 } 535 535 536 536 #primary node thread helper 537 537 my $root_helper_flag = 0; … … 542 542 $root_helper_flag = 1; 543 543 } 544 544 545 545 #say helper is available and send ids of the helpers 546 546 MPI_Send(\$yes_helper, 1, MPI_INT, $who, $request_status, MPI_COMM_WORLD); 547 547 MPI_SendII(\$helpers, $who, $mpi_data, MPI_COMM_WORLD); 548 548 549 549 #take chunk as a helper 550 550 if($root_helper_flag){ … … 552 552 my $who2; 553 553 MPI_Recv(\$who2, 1, MPI_INT, $who, $who_I_am, MPI_COMM_WORLD); 554 554 555 555 #get go_chunk request_status 556 556 my $req_stat; … … 560 560 my $chnk; 561 561 MPI_RecvII(\$chnk, $who2, $mpi_data, MPI_COMM_WORLD); 562 562 563 563 $t_need_flag = 0; 564 564 $t_chunk = freeze(\$chnk); … … 579 579 my $owner; 580 580 MPI_Recv(\$owner, 1, MPI_INT, $who, $work_order, MPI_COMM_WORLD); 581 581 582 582 if($owner == $root){#if root is owner get result 583 583 my $chunk_res; … … 624 624 MPI_Send(\$terminate, 1, MPI_INT, $i, $request_status, MPI_COMM_WORLD); 625 625 } 626 626 627 627 #---release thread 628 628 $t_terminate = 1; #signals to thread to clean up … … 752 752 my $num_helpers_req = $tier->num_chunks; 753 753 MPI_Send(\$num_helpers_req, 1, MPI_INT, $root, $work_order, MPI_COMM_WORLD); 754 754 755 755 #see if helper is available 756 756 my $help_stat; 757 757 MPI_Recv(\$help_stat, 1, MPI_INT, $root, $request_status, MPI_COMM_WORLD); 758 758 759 759 if($help_stat == $yes_helper){ 760 760 my $helpers; 761 761 MPI_RecvII(\$helpers, $root, $mpi_data, MPI_COMM_WORLD); 762 762 763 763 #send chunk to helper 764 764 foreach my $helper (@{$helpers}){ 765 765 #say I'm the one who needs help 766 766 MPI_Send(\$rank, 1, MPI_INT, $helper, $who_I_am, MPI_COMM_WORLD); 767 767 768 768 #send go_chunk request_status 769 769 MPI_Send(\$go_chunk, 1, MPI_INT, $helper, $request_status, MPI_COMM_WORLD); 770 770 771 771 #send chunk 772 772 my $chnk = $tier->next_chunk;
