Changeset 3681 in Sophya for trunk/AddOn/TAcq/mfacq.cc
- Timestamp:
- Nov 20, 2009, 12:46:54 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/mfacq.cc
r3680 r3681 124 124 RAcqMemZoneMgr mmgr(acpar.nZones, bpar.NFibers(), acpar.nPaqZone, acpar.MMgrPaquetSize()); 125 125 pMmgr=&mmgr; 126 int stepproc = 2; 127 int nmean = acpar.nPaqZone*acpar.NBlocPerFile/stepproc; 128 126 if (acpar.fgdoProc && (acpar.stepProc>0)) { 127 // Dans ce cas, toutes les zones doivent passer ds le thread de monitoring 128 // pour etre au moins marque comme traite - seul 1/acpar.stepProc sont effectivement traite 129 mmgr.SetFinalizedMask(((uint_4)MemZS_Saved) | ((uint_4)MemZS_Proc)); 130 cout << " mfacq[1.b]/Info: Mmgr.SetFinalizedMask( MemZS_Saved | MemZS_Proc )" << endl; 131 } 132 129 133 #ifndef NOPCIECARD 130 131 134 for (int i=0 ;i <acpar.NFibers() ;i++) { 132 135 UINT32 card=(acpar.FiberNum[i]-1)/2+1; … … 147 150 #endif 148 151 149 cout <<"mfacq[ 3] Creating DataSaver and DataProc2Cobjects ... " << endl;152 cout <<"mfacq[2] Creating MultiDataSaver and MonitorProc thread objects ... " << endl; 150 153 MultiDataSaver DsThr(mmgr); // Utilise les parametres globaux BRAcqConfig 151 154 string ppath=bpar.OutputDirectory(); 152 DataProc2C PrThr(mmgr, ppath, 1280, stepproc, acpar.NMaxProc);155 MonitorProc PrThr(mmgr); 153 156 vector<PCIEWrapperInterface*> vec_pciw; 154 157 for (int i=0 ;i<bpar.NFibers();i++) vec_pciw.push_back( pciwp[i]); 155 cout << "mfacq[3] Creating PCIEMultiReader 158 cout << "mfacq[3] Creating PCIEMultiReader thread object " << endl; 156 159 PCIEMultiReader PcierThr(vec_pciw, mmgr, bpar.GetParams()); 157 usleep(200); //attente au cas ou ...160 // usleep(200); attente au cas ou ... 158 161 pPcierThr=&PcierThr; 159 162 tm.Split("Threads created"); 160 cout << "mfacq[4] - starting 3 threads pcir, ds, pr ... " << endl; 163 if (acpar.fgdoProc>0) 164 cout << "mfacq[4] - starting three threads: PCIEMultiReader, MultiDataSaver, MonitorProc ... " << endl; 165 else 166 cout << "mfacq[4] - starting two threads: PCIEMultiReader, MultiDataSaver ... " << endl; 167 161 168 PcierThr.start(); 162 169 DsThr.start(); 163 if (acpar. NMaxProc>0) { // On ne demarre que si au moins NMaxProc>0170 if (acpar.fgdoProc>0) { // On ne demarre que si au moins NMaxProc>0 164 171 PrThr.start(); 165 172 } 166 173 167 174 // On attend avant de declencher la terminaison des threads 168 usleep( 100000);175 usleep(200000); 169 176 170 177 cout << "mfacq[5] - Waiting for threads to finish ... " << endl; … … 172 179 DsThr.join(); 173 180 mmgr.Stop(); 174 if (acpar. NMaxProc>0) { // On ne demarre que si au moins NMaxProc>0181 if (acpar.fgdoProc) { // On n'attend la fin que si le thread a ete demarre (NMaxProc>0) 175 182 PrThr.join(); 176 183 } … … 179 186 tm.Split("Threads Finished"); 180 187 188 mmgr.Print(cout); 181 189 #ifndef NOPCIECARD 182 190 for (int i=0 ;i <acpar.NbFibers ;i++) {
Note:
See TracChangeset
for help on using the changeset viewer.