Changeset 255

Show
Ignore:
Timestamp:
09/04/09 09:54:32 (3 months ago)
Author:
cholt
Message:

update how chunks and tiers work to accept chunk type

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/Process/MpiChunk.pm

    r242 r255  
    5757 
    5858   #handle case of calling as function rather than method 
    59    if (ref($self) ne "Process::MpiChunk") { 
     59   if ($self ne "Process::MpiChunk" && ref($self) ne "Process::MpiChunk") { 
    6060      $VARS = $self; 
    6161      $self = new Process::MpiChunk(); 
     
    161161 
    162162   #handle case of calling as function rather than method 
    163    if (ref($self) ne "Process::MpiChunk") { 
     163   if ($self ne "Process::MpiChunk" && ref($self) ne "Process::MpiChunk") { 
    164164      $tID = $VARS; 
    165165      $VARS = $level; 
     
    237237 
    238238   #handle case of calling as function rather than method 
    239    if (ref($self) ne "Process::MpiChunk") { 
     239   if ($self ne "Process::MpiChunk" && ref($self) ne "Process::MpiChunk") { 
    240240      $VARS = $level; 
    241241      $level = $self; 
  • lib/Process/MpiTiers.pm

    r250 r255  
    4040          $self->{TERMINATE} = 0; 
    4141          $self->{FAILED}    = 0; 
     42 
     43          #optionaly override chunk type 
     44          $self->{CHUNK_REF} = shift @args || "Process::MpiChunk"; 
     45 
     46          #setup the tier 
    4247          $self->_initialize_level(0); 
    4348          $self->_prepare($VARS); 
     
    5762 
    5863   try{ 
    59       Process::MpiChunk::prepare($VARS); 
     64      $self->{CHUNK_REF}->prepare($VARS); 
    6065   } 
    6166   catch Error::Simple with { 
     
    205210 
    206211   try { 
    207       $next_level = Process::MpiChunk::flow($level, $self->{VARS}); 
     212      $next_level = $self->{CHUNK_REF}->flow($level, $self->{VARS}); 
    208213   } 
    209214   catch Error::Simple with { 
     
    231236 
    232237   try { 
    233       $chunks = Process::MpiChunk::loader($level, $self->{VARS}, $self->id); 
     238      $chunks = $self->{CHUNK_REF}->loader($level, $self->{VARS}, $self->id); 
    234239   } 
    235240   catch Error::Simple with {