Changeset 3895 in Sophya for trunk/AddOn
- Timestamp:
- Sep 28, 2010, 8:15:29 PM (15 years ago)
- Location:
- trunk/AddOn/TAcq
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/brviscalc.cc
r3893 r3895 69 69 { 70 70 if (totnbpaq_<1) return; 71 cout << " BRVisibilityCalculator - Visibility Datatable : " << endl;71 cout << " ~BRVisibilityCalculator - Visibility Datatable : " << endl; 72 72 cout << visdt_; 73 73 … … 76 76 if (nbcalc_>1) { 77 77 char sbuff[32]; 78 sprintf(sbuff,"visdt_%d ",(int)calcid_);78 sprintf(sbuff,"visdt_%d.ppf",(int)calcid_); 79 79 filename = outpath_+sbuff; 80 80 } … … 230 230 POutPersist po(flnm); 231 231 po << vismtx_; 232 cout << numfile_ << "-BRVisibilityCalculator[" << calcid_ << "]::run() NPaqProc=" 233 << totnbpaq_ << " -> Visibility Matrix in " << flnm << endl; 232 cout << numfile_ << "-BRVisCalc[" << calcid_ << "/" << nbcalc_ << "]::run() NPaqProc=" 233 << totnbpaq_ << " TotMegaFLOP=" << (uint_8)TotNbMegaFLOP() << " -> VisibMtx in " << flnm << endl; 234 234 235 FillVisibTable(moyfc_, moytt_); 235 236 numfile_++; … … 237 238 vismtx_ = complex<r_4>((r_4)0.,(r_4)0.); 238 239 moyfc_=moytt_=0.; 239 first_fc_=curfc_[0];240 first_tt_= (vpaq_[0].TimeTag()-ttfirst_[0]);241 240 first_tmstamp_.SetNow(); // Current date and time 242 241 } … … 260 259 moytt_ += (vpaq_[0].TimeTag()-ttfirst_[0]); 261 260 if ((fgcktt_)&&(calcid_==0)) CheckTimeTag(); 261 if (totnbpaq_%nmean_ == 0) { 262 first_fc_=curfc_[0]; 263 first_tt_= (vpaq_[0].TimeTag()-ttfirst_[0]); 264 } 262 265 totnbpaq_++; 263 266 } 264 267 } // Fin de boucle sur les paquets 265 268 266 269 // Execution parallele pour calcul des visibilites par bandes de frequence 267 270 int rcpex=paralex_.execute(); … … 314 317 POutPersist po(flnm); 315 318 po << vismtx_; 316 cout << numfile_ << "-BRVis ibilityCalculator::Process() NPaqProc="317 << totnbpaq_ << " -> Visibility Matrix in " << flnm << endl;319 cout << numfile_ << "-BRVisCalc[" << calcid_ << "/" << nbcalc_ << "]::Process() NPaqProc=" 320 << totnbpaq_ << " TotMegaFLOP=" << (uint_8)TotNbMegaFLOP() << " -> VisibMtx in " << flnm << endl; 318 321 FillVisibTable(moyfc_, moytt_); 319 322 numfile_++; … … 327 330 328 331 // kpair=numero sequentiel de la paire: 0->(0,0), 1->(0,1), 2->(0,2), 3->(0,3), 4->(1,1), 5->(1,2) ... 329 sa_size_t kpair=0; 332 sa_size_t kpair=0; 333 sa_size_t k=0; // numero de ligne dans la matrice des visibilites 330 334 for(size_t i=0; i<vpdata_.size(); i++) { 331 335 for(size_t j=i; j<vpdata_.size(); j++) { 332 if (kpair<pairst_) continue; 333 if (kpair>=(pairst_+nbpairs_)) break; 334 TVector< complex<r_4> > vis = vismtx_.Row(kpair); 336 kpair++; 337 if (kpair<(pairst_+1)) continue; 338 if (kpair>=(pairst_+nbpairs_+1)) break; 339 TVector< complex<r_4> > vis = vismtx_.Row(k); k++; 335 340 for(sa_size_t f=1; f<vis.Size(); f++) { 336 341 vis(f) += complex<r_4>((r_4)vpdata_[i][f].realB(), (r_4)vpdata_[i][f].imagB()) * 337 342 complex<r_4>((r_4)vpdata_[j][f].realB(), -(r_4)vpdata_[j][f].imagB()); 338 343 } 339 kpair++; 340 nb_flop_ += (7.*(r_8)vis.Size()); 344 nb_flop_ += (8.*(r_8)(vis.Size()-1)); 341 345 } 342 346 } … … 385 389 size_t paqsz=memgr_.PaqSize(); 386 390 BRPaquet ppaq(paqsz); 391 387 392 388 393 sa_size_t fdelt = vismtx_.NCols()/nparthr_; … … 400 405 pvpdata[2*fib+1] = ppaq.Data2C(); 401 406 } 407 408 402 409 // kpair=numero sequentiel de la paire: 0->(0,0), 1->(0,1), 2->(0,2), 3->(0,3), 4->(1,1), 5->(1,2) ... 403 sa_size_t kpair=0; 410 sa_size_t kpair=0; 411 sa_size_t k=0; // numero de ligne dans la matrice des visibilites 404 412 for(size_t i=0; i<vpdata_.size(); i++) { 405 413 for(size_t j=i; j<vpdata_.size(); j++) { 406 size_t kpair=i*vpdata_.size()+j;407 if (kpair< pairst_) continue;408 if (kpair>=(pairst_+nbpairs_ )) break;409 TVector< complex<r_4> > vis = vismtx_.Row(k pair);414 kpair++; 415 if (kpair<(pairst_+1)) continue; 416 if (kpair>=(pairst_+nbpairs_+1)) break; 417 TVector< complex<r_4> > vis = vismtx_.Row(k); k++; 410 418 for(sa_size_t f=fdeb; f<ffin; f++) { 411 419 vis(f) += complex<r_4>((r_4)pvpdata[i][f].realB(), (r_4)pvpdata[i][f].imagB()) * 412 420 complex<r_4>((r_4)pvpdata[j][f].realB(), -(r_4)pvpdata[j][f].imagB()); 413 421 } 414 kpair++; 415 nb_flop_ += (7.*(r_8)(ffin-fdeb)); 422 nb_flop_ += (8.*(r_8)(ffin-fdeb)); 416 423 } 417 424 } … … 539 546 for(size_t i=0; i<viscalcp_.size(); i++) { 540 547 viscalcp_[i]->join(); 548 // cout << " BRVisCalcGroup::join()/ VisibCalc[" << i << "]->TotNbMegaFLOP()=" 549 // << viscalcp_[i]->TotNbFLOP()/1024e3 << endl; 541 550 totflop += viscalcp_[i]->TotNbFLOP(); 542 551 } 543 552 tm_.SplitQ(); 544 553 cout << " ----------------------------------------------------------" << endl; 545 cout << " BRVisCalcGroup::join() : Finished , Elaspsed time: " << tm_.PartialElapsedTimems() 546 << " ms (total:" << tm_.TotalElapsedTimems() << ")" << endl; 554 cout << " BRVisCalcGroup::join() : Finished " << viscalcp_.size() << " VisibilityCalculator(s)" << endl; 555 cout << " ... Elaspsed time: " << tm_.PartialElapsedTimems() 556 << " ms (total:" << tm_.TotalElapsedTimems() << ")" << endl; 557 double mflopsrate=totflop/(r_8)tm_.PartialElapsedTimems()/(1024.); 547 558 cout << " ... TotalMegaFLOP= " << totflop/(1024.e3) << " @ " 548 << totflop/(r_8)tm_.PartialElapsedTimems()/(1024) << " MFLOP/s" << endl;559 << mflopsrate << " MFLOP/s" << " (=" << mflopsrate/(r_8)viscalcp_.size() << "/VisibCalcObject)" << endl; 549 560 cout << " ----------------------------------------------------------" << endl; 550 561 return; -
trunk/AddOn/TAcq/brviscalc.h
r3893 r3895 59 59 // Le nombre total d'operations effectuees 60 60 inline r_8 TotNbFLOP() { return nb_flop_; } 61 inline r_8 TotNbMegaFLOP() { return nb_flop_/(1024.e3); } 61 62 62 63 protected: -
trunk/AddOn/TAcq/vismfib.cc
r3894 r3895 50 50 if (rc) return rc; 51 51 par.Print(cout); 52 52 if ((par.action_!="cube3d")&&(par.action_!="vis")&&(par.action_!="viscktt")) { 53 cout << " !!! visimfib.cc BAD action = " << par.action_ << " possible values: vis,viscktt,cube3d" << endl; 54 return 5; 55 } 53 56 54 57 cout << " ---------- visimfib.cc Start - Action= " << par.action_ << " ------------- " << endl; … … 82 85 83 86 if (par.action_ == "viscktt") procg.ActivateTimeTagCheck(par.TotalNPaquets()); 84 BRMeanSpecCalculator procms(mmgr, par.outpath_, par.nmean_);85 87 86 88 FitsCubeWriter wrt(mmgr, par.outpath_, par.nbloc_); … … 90 92 reader.start(); 91 93 if (par.action_ == "cube3d") wrt.start(); 92 else if (par.action_ == "mspec") procms.start();93 94 else procg.start(); 94 95 usleep(200000); 95 96 reader.join(); 96 97 if (par.action_ == "cube3d") wrt.join(); 97 else if (par.action_ == "mspec") procms.join();98 98 else procg.join(); 99 99 mmgr.Print(cout);
Note:
See TracChangeset
for help on using the changeset viewer.