From 2040e0a1fe20fb48a2f23effddb77613d4079b7c Mon Sep 17 00:00:00 2001
From: Alexander van Amesfoort <amesfoort@astron.nl>
Date: Sun, 1 Apr 2012 15:51:03 +0000
Subject: [PATCH] Task #3185: Revert MSWriter LDA to DAL, and disable building
 of TBB Writer.

The new DAL is not on Jenkins and may need more changes.
This revert/disabling should fix the Jenkins test build again.
---
 .gitattributes                                 |  6 +++---
 RTCP/Storage/CMakeLists.txt                    |  2 +-
 .../Storage/{MSWriterDAL.h => MSWriterLDA.h}   | 16 ++++++++--------
 RTCP/Storage/src/CMakeLists.txt                | 10 +++++-----
 .../src/{MSWriterDAL.cc => MSWriterLDA.cc}     | 18 +++++++++---------
 RTCP/Storage/src/OutputThread.cc               |  4 ++--
 RTCP/Storage/test/CMakeLists.txt               |  2 +-
 RTCP/Storage/test/{tDAL.cc => tLDA.cc}         |  8 ++++----
 8 files changed, 33 insertions(+), 33 deletions(-)
 rename RTCP/Storage/include/Storage/{MSWriterDAL.h => MSWriterLDA.h} (81%)
 rename RTCP/Storage/src/{MSWriterDAL.cc => MSWriterLDA.cc} (96%)
 rename RTCP/Storage/test/{tDAL.cc => tLDA.cc} (90%)

diff --git a/.gitattributes b/.gitattributes
index b26e810e18f..85c3f24d079 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2640,16 +2640,16 @@ RTCP/Storage/include/Storage/FastFileStream.h -text
 RTCP/Storage/include/Storage/Format.h -text
 RTCP/Storage/include/Storage/HDF5Attributes.h -text
 RTCP/Storage/include/Storage/IOPriority.h -text
-RTCP/Storage/include/Storage/MSWriterDAL.h -text
 RTCP/Storage/include/Storage/MSWriterFile.h -text
+RTCP/Storage/include/Storage/MSWriterLDA.h -text
 RTCP/Storage/include/Storage/MSWriterNull.h -text
 RTCP/Storage/include/Storage/MeasurementSetFormat.h -text
 RTCP/Storage/include/Storage/OutputThread.h -text
 RTCP/Storage/include/Storage/TBB_Writer.h -text
 RTCP/Storage/src/FastFileStream.cc -text
 RTCP/Storage/src/Format.cc -text
-RTCP/Storage/src/MSWriterDAL.cc -text
 RTCP/Storage/src/MSWriterFile.cc -text
+RTCP/Storage/src/MSWriterLDA.cc -text
 RTCP/Storage/src/MSWriterNull.cc -text
 RTCP/Storage/src/MeasurementSetFormat.cc -text
 RTCP/Storage/src/OutputThread.cc -text
@@ -2657,8 +2657,8 @@ RTCP/Storage/src/TBB_Writer.cc -text
 RTCP/Storage/src/TBB_Writer_main.cc -text
 RTCP/Storage/src/gnuplotMS.sh -text
 RTCP/Storage/src/plotMS.cc -text
-RTCP/Storage/test/tDAL.cc -text
 RTCP/Storage/test/tFastFileStream.cc -text
+RTCP/Storage/test/tLDA.cc -text
 RTCP/Storage/test/tMeasurementSetFormat.parset-j2000 -text
 RTCP/Storage/test/tMeasurementSetFormat.parset-sun -text
 SAS/Beaminfo/CMakeLists.txt -text
diff --git a/RTCP/Storage/CMakeLists.txt b/RTCP/Storage/CMakeLists.txt
index 4388dc440aa..e21bbd5e5b1 100644
--- a/RTCP/Storage/CMakeLists.txt
+++ b/RTCP/Storage/CMakeLists.txt
@@ -4,7 +4,7 @@ lofar_package(Storage 1.0 DEPENDS Common ApplCommon Interface MSLofar LofarStMan
 
 include(LofarFindPackage)
 lofar_find_package(Casacore COMPONENTS casa measures ms tables REQUIRED)
-lofar_find_package(DAL REQUIRED)
+lofar_find_package(LDA REQUIRED)
 lofar_find_package(HDF5 REQUIRED)
 
 add_subdirectory(include/Storage)
diff --git a/RTCP/Storage/include/Storage/MSWriterDAL.h b/RTCP/Storage/include/Storage/MSWriterLDA.h
similarity index 81%
rename from RTCP/Storage/include/Storage/MSWriterDAL.h
rename to RTCP/Storage/include/Storage/MSWriterLDA.h
index 6b32a1ecd6b..9f2985c7431 100644
--- a/RTCP/Storage/include/Storage/MSWriterDAL.h
+++ b/RTCP/Storage/include/Storage/MSWriterLDA.h
@@ -1,6 +1,6 @@
-//  MSMriterDAL.h: implementation of MSWriter using the DAL to write HDF5
+//  MSMriterLDA.h: implementation of MSWriter using the LDA to write HDF5
 //
-//  Copyright (C) 2001
+//  Copyright (C) 2011
 //  ASTRON (Netherlands Foundation for Research in Astronomy)
 //  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
 //
@@ -18,13 +18,13 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 //
-//  $Id: MSWriterImpl.h 11891 2008-10-14 13:43:51Z gels $
+//  $Id: MSWriterLDA.h 11891 2011-10-14 13:43:51Z gels $
 //
 //////////////////////////////////////////////////////////////////////
 
 
-#ifndef LOFAR_STORAGE_MSWRITERDAL_H
-#define LOFAR_STORAGE_MSWRITERDAL_H
+#ifndef LOFAR_STORAGE_MSWRITERLDA_H
+#define LOFAR_STORAGE_MSWRITERLDA_H
 
 //# Includes
 #include <Common/LofarTypes.h>
@@ -42,11 +42,11 @@ namespace LOFAR
 
   namespace RTCP
   {
-    template<typename T, unsigned DIM> class MSWriterDAL : public MSWriterFile
+    template<typename T, unsigned DIM> class MSWriterLDA : public MSWriterFile
     {
     public:
-      MSWriterDAL(const string &filename, const Parset &parset, unsigned fileno, bool isBigEndian);
-      ~MSWriterDAL();
+      MSWriterLDA(const string &filename, const Parset &parset, unsigned fileno, bool isBigEndian);
+      ~MSWriterLDA();
       virtual void write(StreamableData *data);
     private:
       const Transpose2 &itsTransposeLogic;
diff --git a/RTCP/Storage/src/CMakeLists.txt b/RTCP/Storage/src/CMakeLists.txt
index f1d1c58d6db..b135cd4b0b3 100644
--- a/RTCP/Storage/src/CMakeLists.txt
+++ b/RTCP/Storage/src/CMakeLists.txt
@@ -9,13 +9,13 @@ lofar_add_library(storage
   OutputThread.cc
   SubbandWriter.cc
   MSWriter.cc
-  MSWriterDAL.cc
+  MSWriterLDA.cc
   MSWriterNull.cc
   MSWriterFile.cc
   Format.cc
-  MeasurementSetFormat.cc
-  TBB_Writer_main.cc
-  TBB_Writer.cc)
+  MeasurementSetFormat.cc)
+#  TBB_Writer_main.cc
+#  TBB_Writer.cc)
 
 install(PROGRAMS
   gnuplotMS.sh
@@ -28,4 +28,4 @@ install(FILES
 lofar_add_bin_program(Storage_main Storage_main.cc)
 lofar_add_bin_program(plotMS plotMS.cc)
 lofar_add_bin_program(versionstorage versionstorage.cc)
-lofar_add_bin_program(TBB_Writer_main TBB_Writer_main.cc)
+#lofar_add_bin_program(TBB_Writer_main TBB_Writer_main.cc)
diff --git a/RTCP/Storage/src/MSWriterDAL.cc b/RTCP/Storage/src/MSWriterLDA.cc
similarity index 96%
rename from RTCP/Storage/src/MSWriterDAL.cc
rename to RTCP/Storage/src/MSWriterLDA.cc
index 9a1cb2c04a4..5ca09d6c687 100644
--- a/RTCP/Storage/src/MSWriterDAL.cc
+++ b/RTCP/Storage/src/MSWriterLDA.cc
@@ -1,4 +1,4 @@
-//# MSWriterDAL: an implementation of MSWriter using the DAL to write HDF5
+//# MSWriterLDA: an implementation of MSWriter using the LDA to write HDF5
 //#
 //#  Copyright (C) 2011
 //#  ASTRON (Netherlands Foundation for Research in Astronomy)
@@ -26,11 +26,11 @@
 #include <Common/SystemUtil.h>
 
 #include <Storage/MSWriter.h>
-#include <Storage/MSWriterDAL.h>
+#include <Storage/MSWriterLDA.h>
 
 #include <lofar/BF_File.h>
 
-using namespace DAL;
+using namespace LDA;
 using namespace std;
 
 #include <Common/Thread/Mutex.h>
@@ -101,7 +101,7 @@ namespace LOFAR
     // uses global locks too anyway.
     static Mutex HDF5Mutex;
 
-    template <typename T,unsigned DIM> MSWriterDAL<T,DIM>::MSWriterDAL (const string &filename, const Parset &parset, unsigned fileno, bool isBigEndian)
+    template <typename T,unsigned DIM> MSWriterLDA<T,DIM>::MSWriterLDA (const string &filename, const Parset &parset, unsigned fileno, bool isBigEndian)
     :
       MSWriterFile(forceextension(string(filename),".raw"),false),
       itsTransposeLogic(parset.transposeLogic()),
@@ -157,11 +157,11 @@ namespace LOFAR
           break;
 
         case INVALID_STOKES:
-          LOG_ERROR("MSWriterDAL asked to write INVALID_STOKES");
+          LOG_ERROR("MSWriterLDA asked to write INVALID_STOKES");
           return;
       }    
 
-      LOG_DEBUG_STR("MSWriterDAL: opening " << filename);
+      LOG_DEBUG_STR("MSWriterLDA: opening " << filename);
 
       // create the top structure
       BF_File file(h5filename, BF_File::CREATE);
@@ -408,11 +408,11 @@ namespace LOFAR
       stokesDS.nofSamples()     .set(dims[0]);
     }
 
-    template <typename T,unsigned DIM> MSWriterDAL<T,DIM>::~MSWriterDAL()
+    template <typename T,unsigned DIM> MSWriterLDA<T,DIM>::~MSWriterLDA()
     {
     }
 
-    template <typename T,unsigned DIM> void MSWriterDAL<T,DIM>::write(StreamableData *data)
+    template <typename T,unsigned DIM> void MSWriterLDA<T,DIM>::write(StreamableData *data)
     {
       SampleData<T,DIM> *sdata = dynamic_cast<SampleData<T,DIM> *>(data);
 
@@ -434,7 +434,7 @@ namespace LOFAR
     }
 
     // specialisation for FinalBeamFormedData
-    template class MSWriterDAL<float,3>;
+    template class MSWriterLDA<float,3>;
 
   } // namespace RTCP
 } // namespace LOFAR
diff --git a/RTCP/Storage/src/OutputThread.cc b/RTCP/Storage/src/OutputThread.cc
index ddefbccbef7..73de63beca2 100644
--- a/RTCP/Storage/src/OutputThread.cc
+++ b/RTCP/Storage/src/OutputThread.cc
@@ -25,7 +25,7 @@
 
 #include <Common/StringUtil.h>
 #include <Storage/MSWriterFile.h>
-#include <Storage/MSWriterDAL.h>
+#include <Storage/MSWriterLDA.h>
 #include <Storage/MSWriterNull.h>
 #include <Storage/MeasurementSetFormat.h>
 #include <Storage/OutputThread.h>
@@ -159,7 +159,7 @@ void OutputThread::createMS()
     // HDF5 writer requested
     switch (itsOutputType) {
       case BEAM_FORMED_DATA:
-        itsWriter = new MSWriterDAL<float,3>(path.c_str(), itsParset, itsStreamNr, itsIsBigEndian);
+        itsWriter = new MSWriterLDA<float,3>(path.c_str(), itsParset, itsStreamNr, itsIsBigEndian);
         break;
       default:
         itsWriter = new MSWriterFile(path, itsOutputType == BEAM_FORMED_DATA);
diff --git a/RTCP/Storage/test/CMakeLists.txt b/RTCP/Storage/test/CMakeLists.txt
index 77d72bbd126..00a59edf1ca 100644
--- a/RTCP/Storage/test/CMakeLists.txt
+++ b/RTCP/Storage/test/CMakeLists.txt
@@ -3,6 +3,6 @@
 include(LofarCTest)
 
 lofar_add_test(tMeasurementSetFormat tMeasurementSetFormat.cc)
-lofar_add_test(tDAL tDAL.cc)
+lofar_add_test(tLDA tLDA.cc)
 lofar_add_test(tFastFileStream tFastFileStream.cc)
 #lofar_add_test(tAH_TestStorage tAH_TestStorage.cc)
diff --git a/RTCP/Storage/test/tDAL.cc b/RTCP/Storage/test/tLDA.cc
similarity index 90%
rename from RTCP/Storage/test/tDAL.cc
rename to RTCP/Storage/test/tLDA.cc
index a687b6dd96c..980b88db800 100644
--- a/RTCP/Storage/test/tDAL.cc
+++ b/RTCP/Storage/test/tLDA.cc
@@ -1,4 +1,4 @@
-//# tDAL: Test HDF5 routines through DAL
+//# tLDA: Test HDF5 routines through LDA
 //#
 //#  Copyright (C) 2011
 //#  ASTRON (Netherlands Foundation for Research in Astronomy)
@@ -22,18 +22,18 @@
 
 #include <lofar_config.h>
 
-#ifdef HAVE_DAL
+#ifdef HAVE_LDA
 
 #include <dal_version.h>
 #include <iostream>
 #include <string>
 
 using namespace std;
-using namespace DAL;
+using namespace LDA;
 
 int main() {
   if (!check_hdf5_versions()) {
-    cerr << "HDF5 version mismatch. DAL was compiled with " << get_dal_hdf5_version() << ", our headers are " << get_current_hdf5_header_version() << ", our library is " << get_current_hdf5_lib_version() << endl;
+    cerr << "HDF5 version mismatch. LDA was compiled with " << get_dal_hdf5_version() << ", our headers are " << get_current_hdf5_header_version() << ", our library is " << get_current_hdf5_lib_version() << endl;
     return 1;
   }
   
-- 
GitLab