Index: /trunk/AddOn/TAcq/brviscalc.cc
===================================================================
--- /trunk/AddOn/TAcq/brviscalc.cc	(revision 3894)
+++ /trunk/AddOn/TAcq/brviscalc.cc	(revision 3895)
@@ -69,5 +69,5 @@
 {
   if (totnbpaq_<1)   return; 
-  cout << " BRVisibilityCalculator - Visibility Datatable : " << endl;
+  cout << " ~BRVisibilityCalculator - Visibility Datatable : " << endl;
   cout << visdt_;
   
@@ -76,5 +76,5 @@
   if (nbcalc_>1) {
     char sbuff[32];
-    sprintf(sbuff,"visdt_%d",(int)calcid_);
+    sprintf(sbuff,"visdt_%d.ppf",(int)calcid_);
     filename = outpath_+sbuff;
   }
@@ -230,6 +230,7 @@
 	  POutPersist po(flnm);
 	  po << vismtx_;
-	  cout << numfile_ << "-BRVisibilityCalculator[" << calcid_ << "]::run() NPaqProc="
-	       << totnbpaq_ << "  -> Visibility Matrix in " << flnm << endl;
+	  cout << numfile_ << "-BRVisCalc[" << calcid_ << "/" << nbcalc_ << "]::run() NPaqProc="
+	       << totnbpaq_ << " TotMegaFLOP=" << (uint_8)TotNbMegaFLOP() << " -> VisibMtx in " << flnm << endl;
+
 	  FillVisibTable(moyfc_, moytt_);
 	  numfile_++;
@@ -237,6 +238,4 @@
 	vismtx_ = complex<r_4>((r_4)0.,(r_4)0.);
 	moyfc_=moytt_=0.;
-	first_fc_=curfc_[0];
-	first_tt_= (vpaq_[0].TimeTag()-ttfirst_[0]);
 	first_tmstamp_.SetNow();  // Current date and time 
       }
@@ -260,8 +259,12 @@
 	  moytt_ += (vpaq_[0].TimeTag()-ttfirst_[0]);
 	  if ((fgcktt_)&&(calcid_==0))  CheckTimeTag();
+	  if (totnbpaq_%nmean_ == 0) {
+	    first_fc_=curfc_[0];
+	    first_tt_= (vpaq_[0].TimeTag()-ttfirst_[0]);
+	  }
 	  totnbpaq_++;
 	}
       }  // Fin de boucle sur les paquets 
-      
+
       // Execution parallele  pour calcul des visibilites par bandes de frequence
       int rcpex=paralex_.execute();
@@ -314,6 +317,6 @@
       POutPersist po(flnm);
       po << vismtx_;
-      cout << numfile_ << "-BRVisibilityCalculator::Process() NPaqProc="
-	   << totnbpaq_ << "  -> Visibility Matrix in " << flnm << endl;
+      cout << numfile_ << "-BRVisCalc[" << calcid_ << "/" << nbcalc_ << "]::Process() NPaqProc="
+	   << totnbpaq_ << " TotMegaFLOP=" << (uint_8)TotNbMegaFLOP() << " -> VisibMtx in " << flnm << endl;
       FillVisibTable(moyfc_, moytt_);
       numfile_++;
@@ -327,16 +330,17 @@
 
 // kpair=numero sequentiel de la paire: 0->(0,0), 1->(0,1), 2->(0,2), 3->(0,3), 4->(1,1), 5->(1,2) ...
-  sa_size_t kpair=0;  
+  sa_size_t kpair=0;
+  sa_size_t k=0;     // numero de ligne dans la matrice des visibilites 
   for(size_t i=0; i<vpdata_.size(); i++) {
     for(size_t j=i; j<vpdata_.size(); j++) {
-      if (kpair<pairst_)  continue;
-      if (kpair>=(pairst_+nbpairs_))  break;
-      TVector< complex<r_4> > vis = vismtx_.Row(kpair);   
+      kpair++;
+      if (kpair<(pairst_+1))  continue;
+      if (kpair>=(pairst_+nbpairs_+1))  break;
+      TVector< complex<r_4> > vis = vismtx_.Row(k);  k++;   
       for(sa_size_t f=1; f<vis.Size(); f++) {
 	vis(f) += complex<r_4>((r_4)vpdata_[i][f].realB(), (r_4)vpdata_[i][f].imagB()) * 
 	  complex<r_4>((r_4)vpdata_[j][f].realB(), -(r_4)vpdata_[j][f].imagB());
       }
-      kpair++;
-      nb_flop_ += (7.*(r_8)vis.Size());
+      nb_flop_ += (8.*(r_8)(vis.Size()-1));
     }
   }
@@ -385,4 +389,5 @@
   size_t paqsz=memgr_.PaqSize();
   BRPaquet ppaq(paqsz);
+
 
   sa_size_t fdelt = vismtx_.NCols()/nparthr_;
@@ -400,18 +405,20 @@
       pvpdata[2*fib+1] = ppaq.Data2C();
     }
+
+
 // kpair=numero sequentiel de la paire: 0->(0,0), 1->(0,1), 2->(0,2), 3->(0,3), 4->(1,1), 5->(1,2) ...
-    sa_size_t kpair=0;  
+    sa_size_t kpair=0;
+    sa_size_t k=0;     // numero de ligne dans la matrice des visibilites 
     for(size_t i=0; i<vpdata_.size(); i++) {
       for(size_t j=i; j<vpdata_.size(); j++) {
-	size_t kpair=i*vpdata_.size()+j;
-	if (kpair<pairst_)  continue;
-	if (kpair>=(pairst_+nbpairs_))  break;
-	TVector< complex<r_4> > vis = vismtx_.Row(kpair);  
+	kpair++;
+	if (kpair<(pairst_+1))  continue;
+	if (kpair>=(pairst_+nbpairs_+1))  break;
+	TVector< complex<r_4> > vis = vismtx_.Row(k);  k++;  
 	for(sa_size_t f=fdeb; f<ffin; f++) {
 	  vis(f) += complex<r_4>((r_4)pvpdata[i][f].realB(), (r_4)pvpdata[i][f].imagB()) * 
 	    complex<r_4>((r_4)pvpdata[j][f].realB(), -(r_4)pvpdata[j][f].imagB());
 	}
-	kpair++;
-	nb_flop_ += (7.*(r_8)(ffin-fdeb));
+	nb_flop_ += (8.*(r_8)(ffin-fdeb));
       }
     }
@@ -539,12 +546,16 @@
   for(size_t i=0; i<viscalcp_.size(); i++) {
     viscalcp_[i]->join();
+    //    cout << " BRVisCalcGroup::join()/ VisibCalc[" << i << "]->TotNbMegaFLOP()=" 
+    //	 << viscalcp_[i]->TotNbFLOP()/1024e3 << endl;
     totflop += viscalcp_[i]->TotNbFLOP();
   }
   tm_.SplitQ();
   cout << "      ----------------------------------------------------------" << endl;
-  cout << " BRVisCalcGroup::join() : Finished , Elaspsed time: " << tm_.PartialElapsedTimems() 
-       << " ms (total:" << tm_.TotalElapsedTimems() << ")" << endl;
+  cout << " BRVisCalcGroup::join() : Finished " << viscalcp_.size() << " VisibilityCalculator(s)" << endl;
+  cout << " ... Elaspsed time: " << tm_.PartialElapsedTimems() 
+       << " ms (total:" << tm_.TotalElapsedTimems() << ")"  << endl;
+  double mflopsrate=totflop/(r_8)tm_.PartialElapsedTimems()/(1024.);
   cout << " ... TotalMegaFLOP= " << totflop/(1024.e3) << " @ " 
-       << totflop/(r_8)tm_.PartialElapsedTimems()/(1024) << " MFLOP/s" << endl; 
+       << mflopsrate << " MFLOP/s" << " (=" << mflopsrate/(r_8)viscalcp_.size() << "/VisibCalcObject)" << endl; 
   cout << "      ----------------------------------------------------------" << endl;
   return;
Index: /trunk/AddOn/TAcq/brviscalc.h
===================================================================
--- /trunk/AddOn/TAcq/brviscalc.h	(revision 3894)
+++ /trunk/AddOn/TAcq/brviscalc.h	(revision 3895)
@@ -59,4 +59,5 @@
   // Le nombre total d'operations effectuees
   inline r_8 TotNbFLOP() { return nb_flop_; }
+  inline r_8 TotNbMegaFLOP() { return nb_flop_/(1024.e3); }
 
 protected:
Index: /trunk/AddOn/TAcq/vismfib.cc
===================================================================
--- /trunk/AddOn/TAcq/vismfib.cc	(revision 3894)
+++ /trunk/AddOn/TAcq/vismfib.cc	(revision 3895)
@@ -50,5 +50,8 @@
     if (rc) return rc;
     par.Print(cout);
-
+    if ((par.action_!="cube3d")&&(par.action_!="vis")&&(par.action_!="viscktt")) {
+      cout << " !!! visimfib.cc  BAD action = " << par.action_ << " possible values: vis,viscktt,cube3d" << endl;
+      return 5;
+    }   
 
     cout << " ---------- visimfib.cc Start - Action= " << par.action_ << " ------------- " << endl;
@@ -82,5 +85,4 @@
 
     if (par.action_ == "viscktt")  procg.ActivateTimeTagCheck(par.TotalNPaquets());
-    BRMeanSpecCalculator procms(mmgr, par.outpath_, par.nmean_);
 
     FitsCubeWriter wrt(mmgr, par.outpath_, par.nbloc_);
@@ -90,10 +92,8 @@
     reader.start();
     if (par.action_ == "cube3d")   wrt.start();
-    else if (par.action_ == "mspec")   procms.start();
     else  procg.start();
     usleep(200000);
     reader.join();
     if (par.action_ == "cube3d")  wrt.join();
-    else if (par.action_ == "mspec")  procms.join();
     else procg.join();
     mmgr.Print(cout);
