Ignore:
Timestamp:
May 20, 2003, 12:10:09 PM (22 years ago)
Author:
aubourg
Message:

ring pipes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Kernel/toimanager.cc

    r2385 r2386  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: toimanager.cc,v 1.21 2003-05-19 23:31:29 aubourg Exp $
     5// $Id: toimanager.cc,v 1.22 2003-05-20 10:10:09 aubourg Exp $
    66
    77#include "toimanager.h"
     
    4242  cout << "Adding processor to TOIManager for group execution" << endl;
    4343  processors.push_back(proc);
     44 
     45}
     46
     47void TOIManager::registerProcessor(RingProcessor* proc) {
     48 
     49  cout << "Adding processor to TOIManager for group execution" << endl;
     50  ringProcessors.push_back(proc);
    4451 
    4552}
     
    8087    cout << "processor started " << endl;
    8188  }
     89
     90  for (vector<RingProcessor*>::iterator i = ringProcessors.begin();
     91       i != ringProcessors.end(); i++) {
     92    RingProcessor* proc = *i;
     93    cout << "**********************" <<  endl;
     94    cout << "starting processor " <<  endl;
     95    proc->start();
     96    cout << "processor started " << endl;
     97  }
    8298  cout << "**********************" << endl;
     99}
     100
     101void TOIManager::checkRingLimits()
     102{
     103  int min=0;
     104  int max = MAXINT;
     105  for (int pass=0; pass<2; pass++) {
     106    for (vector<RingProcessor*>::iterator i = ringProcessors.begin();
     107         i != ringProcessors.end(); i++) {
     108      RingProcessor* proc = *i;
     109      proc->getRingRange(min, max);
     110    }
     111  }
    83112}
    84113
     
    162191}
    163192
     193RingPipe& TOIManager::connect(RingProcessor& pout, string out,
     194                              RingProcessor& pin, string in) {
     195  RingPipe* pipe;
     196  char buff[128];
     197  sprintf(buff, "Ring_[%s-%s]",  in.c_str(), out.c_str());
     198  if ((pipe = pout.getOutRing(out)) == NULL) {
     199    pipe = new RingPipe();
     200    pout.addRingOutput(out, pipe);
     201  }
     202
     203  pin.addRingInput(in, pipe);
     204  return(*pipe);
     205}
     206
    164207// methode connect de cgt simplifiee et corrigee
    165208TOI& TOIManager::connect(TOIProcessor& prout, string out,
     
    169212  if (nom.length() < 1) {
    170213    char buff[128];
    171     sprintf(buff, "TOI%s_[%s-%s]", nom, in, out);
     214    sprintf(buff, "TOI%s_[%s-%s]", nom.c_str(), in.c_str(), out.c_str());
    172215    nom = buff;
    173216  }
     
    230273  int nbmax_dns_print = 2;
    231274
    232   TOIManager* mgr = TOIManager::getManager();
     275  //  TOIManager* mgr = TOIManager::getManager();
    233276 
    234277  //  istart = mgr->getRequestedBegin();
     
    263306      nb_dns_print++;
    264307      fracperc = (double)processed_samples*100./(double)total_sample_count;
    265       fperc = fracperc*100;
     308      fperc = (int)(fracperc*100);
    266309      cout << ">>> " << _msg << ": ProcessedSampleCount()= " << last_sample_count
    267310           << " Frac done = " << (double)fperc/100. << " %" << endl;
     
    271314    else if ((nb_sleep+1)%5 == 0) {
    272315      fracperc = (double)processed_samples*100./(double)total_sample_count;
    273       fperc = fracperc*100;
     316      fperc = (int)(fracperc*100);
    274317      cout << "> " << _msg << ": ProcSamples()= " <<  processed_samples
    275318           << " Done = " << " %" << (double)fperc/100.
Note: See TracChangeset for help on using the changeset viewer.