Changeset 3724 in Sophya for trunk/AddOn/TAcq/brproc.cc
- Timestamp:
- Dec 29, 2009, 12:34:19 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/brproc.cc
r3710 r3724 32 32 /* --Methode-- */ 33 33 BRVisibilityCalculator::BRVisibilityCalculator(RAcqMemZoneMgr& memgr, string outpath, uint_4 nmean, 34 uint_4 freq1, uint_4 freq2, uint_4 nbfreq )35 : BRBaseProcessor(memgr), outpath_(outpath), nmean_(nmean), numfreq1_(freq1), numfreq2_(freq2), nbinfreq_(nbfreq),36 vpdata_(2*memgr.NbFibres())34 uint_4 freq1, uint_4 freq2, uint_4 nbfreq, size_t nthr) 35 : BRBaseProcessor(memgr), paralex_(*this, nthr), nparthr_(nthr), outpath_(outpath), nmean_(nmean), 36 numfreq1_(freq1), numfreq2_(freq2), nbinfreq_(nbfreq), vpdata_(2*memgr.NbFibres()) 37 37 // , dtfos_(outpath+"visdt.fits", Fits_Create), visdt_(dtfos_, 1024, true); 38 38 … … 100 100 } 101 101 delete[] xnt_; 102 } 103 104 /* --Methode-- */ 105 void BRVisibilityCalculator::run() 106 { 107 if (nparthr_ > 1) { 108 paralex_.SetParallelTask(*this); 109 cout << " BRVisibilityCalculator::run()/Info : starting ParallelExecutor with nThreads=" 110 << paralex_.nThreads() << " ... " << endl; 111 paralex_.start(); 112 } 113 return BRBaseProcessor::run(); 102 114 } 103 115 … … 152 164 moyfc_=moytt_=0.; 153 165 } 166 167 if (nparthr_ > 1) { // Execution parallele 168 int rcpex=paralex_.execute(); 169 if (rcpex!=0) cout << " BRVisibilityCalculator::Process() / Error Rc[paralex_.execute()]=" << rcpex << endl; 170 } 171 else { 172 sa_size_t k=0; 173 for(size_t i=0; i<vpdata_.size(); i++) { 174 for(size_t j=i; j<vpdata_.size(); j++) { 175 TVector< complex<r_4> > vis = vismtx_.Row(k); k++; 176 for(sa_size_t f=1; f<vis.Size(); f++) { 177 vis(f) += complex<r_4>((r_4)vpdata_[i][f].realB(), (r_4)vpdata_[i][f].imagB()) * 178 complex<r_4>((r_4)vpdata_[j][f].realB(), -(r_4)vpdata_[j][f].imagB()); 179 } 180 } 181 } 182 } 183 moyfc_ += curfc_[0]; 184 moytt_ += (vpaq_[0].TimeTag()-ttfirst_[0]); 185 if (fgcktt_) CheckTimeTag(); 186 totnbpaq_++; 187 return 0; 188 } 189 190 /* --Methode-- */ 191 int BRVisibilityCalculator::execute(int tid) 192 { 193 sa_size_t fdelt = vismtx_.NCols()/nparthr_; 194 sa_size_t fdeb = tid*fdelt; 195 sa_size_t ffin = (tid+1)*fdelt; 196 if (fdeb<1) fdeb=1; 197 if ((ffin>vismtx_.NCols())||(tid==(nparthr_-1))) ffin=vismtx_.NCols(); 154 198 155 199 sa_size_t k=0; … … 157 201 for(size_t j=i; j<vpdata_.size(); j++) { 158 202 TVector< complex<r_4> > vis = vismtx_.Row(k); k++; 159 for(sa_size_t f= 1; f<vis.Size(); f++) {203 for(sa_size_t f=fdeb; f<ffin; f++) { 160 204 vis(f) += complex<r_4>((r_4)vpdata_[i][f].realB(), (r_4)vpdata_[i][f].imagB()) * 161 205 complex<r_4>((r_4)vpdata_[j][f].realB(), -(r_4)vpdata_[j][f].imagB()); … … 163 207 } 164 208 } 165 166 moyfc_ += curfc_[0];167 moytt_ += (vpaq_[0].TimeTag()-ttfirst_[0]);168 if (fgcktt_) CheckTimeTag();169 totnbpaq_++;170 209 return 0; 171 210 }
Note:
See TracChangeset
for help on using the changeset viewer.