WSL/SLF GitLab Repository

Commit c9dc6179 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

The popc structure has been reverted to what it was before. The new structure,...

The popc structure has been reverted to what it was before. The new structure, without any parallel objects was not working. 

The gcc flags used by the autotools have been adapted to follow more closely what cmake generates.
parent 4739a0c9
......@@ -24,12 +24,12 @@ PROJ4 = @PROJ4@
#SVNREV_GEN = $(shell main/version.sh)
#SVNREV = $(eval SVNREV := $(SVNREV_GEN))$(SVNREV)
CC = @CC@ -DGNU
CXX = @CXX@
CC = @CC@ -DGNU -DLINUX -D_USE_MATH_DEFINES
CXX = @CXX@ -DGNU -DLINUX -D_USE_MATH_DEFINES
LINKER = @CXX@ -DGNU
POPCC = popcc
DEBUG = -g -O0 -D__DEBUG #-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC #-dr
DEBUG = -g -O0 #-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC #-dr
debug_arithm = -DDEBUG_ARITHM -g
WARNING = @WARNING@ @EXTRA_WARN@ #-Weffc++ #-pedantic-errors #-Werror
ARCH = @ARCH@
......@@ -118,7 +118,7 @@ METEOIO_OBJ = $(SRCDIR)/IOManager.o \
$(SRCDIR)/meteolaws/Suntrajectory.o \
$(SRCDIR)/meteolaws/Sun.o
METEOIO_OBJ_POPC =$(SRCDIR)/IOManager.stub.o \
METEOIO_OBJ_POPC = $(SRCDIR)/IOHandler.stub.o \
$(SRCDIR)/marshal_meteoio_par.o \
$(SRCDIR)/IOManager_par.o \
$(SRCDIR)/Matrix_par.o \
......@@ -206,7 +206,10 @@ meteoIO_module_par: $(LIBDIR)/meteoio.module
############## END ##############
clean:
-rm -f $(SRCDIR)/*~ $(SRCDIR)/*.o $(TOOLSDIR)/*.o $(PLUGINDIR)/*.o
-rm -f $(SRCDIR)/*~ $(SRCDIR)/*.o $(TOOLSDIR)/*.o
-rm -f $(PLUGINDIR)/*~ $(PLUGINDIR)/*.o
-rm -f $(SRCDIR)/meteolaws/*~ $(SRCDIR)/meteolaws/*.o
-rm -f $(SRCDIR)/meteofilters/*~ $(SRCDIR)/meteofilters/*.o
# cd $(PLUGINDIR)/gsn; make clean
distclean: clean
......
......@@ -47,8 +47,8 @@ namespace mio {
* (10% by default)
* - BUFF_BEFORE: alternate way of buffer centering: When rebuffering, the new date will be located BUFF_BEFORE days from the
* begining of the buffer (therefore, it takes a value in days); [General] section, optional. Only one of
* two centering option can be used.
*
* two centering option can be used.
*
* @author Thomas Egger
* @date 2009-07-25
*/
......@@ -88,7 +88,7 @@ class BufferedIOHandler : public IOInterface {
} buffer_policy;
/**
* @brief Read the metadata for a given date.
* @brief Read the metadata for a given date.
* @param date date for which to read the metadata
* @param vecStation vector of metadata
*/
......@@ -120,15 +120,15 @@ class BufferedIOHandler : public IOInterface {
friend std::ostream& operator<<(std::ostream& os, const BufferedIOHandler& data);
//friend class IOManager;
friend class IOManager;
//private:
private:
//private methods
const std::vector<METEO_TIMESERIE>& get_complete_buffer(Date& start, Date& end);
void push_meteo_data(const Date& date_start, const Date& date_end,
const std::vector< METEO_TIMESERIE >& vecMeteo);
private:
void setDfltBufferProperties();
void bufferData(const Date& date_start, const Date& date_end, std::vector< METEO_TIMESERIE >& vecvecMeteo);
......
......@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public License
along with MeteoIO. If not, see <http://www.gnu.org/licenses/>.
*/
/*#ifdef _POPC_
#ifdef _POPC_
#include <meteoio/IOHandler.ph>
#ifdef DEBUG_ARITHM
#ifndef _GNU_SOURCE
......@@ -25,9 +25,7 @@
#endif
#else
#include <meteoio/IOHandler.h>
#endif*/
#include <meteoio/IOHandler.h>
#endif
using namespace std;
......@@ -83,11 +81,11 @@ void IOHandler::registerPlugins()
}
#ifdef _POPC_
IOHandler::IOHandler(const std::string& configfile) : cfg(configfile), fileio(configfile)
IOHandler::IOHandler(const std::string& configfile) : cfg(configfile), fileio(configfile){
#else
IOHandler::IOHandler(const std::string& configfile) : IOInterface(NULL), cfg(configfile), fileio(configfile)
#endif
{
#endif
registerPlugins();
}
......@@ -110,18 +108,17 @@ IOHandler::IOHandler(const Config& cfgreader) : cfg(cfgreader), fileio(cfgreader
IOHandler::IOHandler(const Config& cfgreader) : IOInterface(NULL), cfg(cfgreader), fileio(cfgreader)
#endif
{
/*#if defined(_POPC_) && defined(DEBUG_ARITHM)
#if defined(_POPC_) && defined(DEBUG_ARITHM)
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW );
#endif*/
#endif
registerPlugins();
}
#ifdef _POPC_
IOHandler::~IOHandler()
IOHandler::~IOHandler(){
#else
IOHandler::~IOHandler() throw()
IOHandler::~IOHandler() throw(){
#endif
{
// Get rid of the objects
std::map<std::string, IOPlugin>::iterator mapit;
for (mapit = mapPlugins.begin(); mapit!=mapPlugins.end(); mapit++){
......@@ -249,14 +246,18 @@ void IOHandler::readMeteoData(const Date& date, METEO_TIMESERIE& vecMeteo)
void IOHandler::readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector<METEO_TIMESERIE>& vecMeteo,
const unsigned int& stationindex)
const unsigned& stationindex)
{
IOInterface *plugin = getPlugin("METEO", "Input");
plugin->readMeteoData(dateStart, dateEnd, vecMeteo, stationindex);
}
#ifdef _POPC_
void IOHandler::writeMeteoData(std::vector<METEO_TIMESERIE>& vecMeteo,
const std::string& name)
#else
void IOHandler::writeMeteoData(const std::vector<METEO_TIMESERIE>& vecMeteo,
const std::string& name)
#endif
{
IOInterface *plugin = getPlugin("METEO", "Output");
plugin->writeMeteoData(vecMeteo, name);
......
......@@ -18,9 +18,9 @@
#ifndef __IOHANDLER_H__
#define __IOHANDLER_H__
/*#ifdef _POPC_
#ifdef _POPC_
#error
#endif*/
#endif
#include <meteoio/IOInterface.h>
#include <meteoio/A3DIO.h>
......@@ -39,20 +39,12 @@ namespace mio {
* and it follows the interface defined by the IOInterface class with the addition of
* a few convenience methods.
*/
#ifdef _POPC_
class IOHandler {
#else
class IOHandler : public IOInterface {
#endif
public:
IOHandler(const std::string& configfile);
IOHandler(const IOHandler&);
IOHandler(const Config&);
#ifdef _POPC_
~IOHandler();
#else
~IOHandler() throw();
#endif
//methods defined in the IOInterface class
virtual void read2DGrid(Grid2DObject& out_grid, const std::string& parameter="");
......@@ -64,7 +56,7 @@ class IOHandler : public IOInterface {
const std::string& name="");
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector<METEO_TIMESERIE>& vecMeteo,
const unsigned int& stationindex=IOUtils::npos);
const unsigned& stationindex=IOUtils::npos);
void readMeteoData(const Date& date, METEO_TIMESERIE& vecMeteo);
virtual void readAssimilationData(const Date&, Grid2DObject& da_out);
......@@ -72,22 +64,13 @@ class IOHandler : public IOInterface {
virtual void write2DGrid(const Grid2DObject& grid_in, const std::string& name);
friend std::ostream& operator<<(std::ostream& os, const IOHandler& data);
#ifdef _POPC_
std::string toString();
#else
std::string toString() const;
#endif
private:
void loadDynamicPlugins();
void loadPlugin(const std::string& libname, const std::string& classname,
DynamicLibrary*& dynLibrary, IOInterface*& io);
#ifdef _POPC_
void deletePlugin(DynamicLibrary*& dynLibrary, IOInterface*& io);
#else
void deletePlugin(DynamicLibrary*& dynLibrary, IOInterface*& io) throw();
#endif
void registerPlugins();
IOInterface *getPlugin(const std::string& cfgkey, const std::string& cfgsection="GENERAL");
......
......@@ -16,26 +16,14 @@
along with MeteoIO. If not, see <http://www.gnu.org/licenses/>.
*/
/*#ifdef _POPC_
#include <meteoio/IOManager.ph>
#else
#include <meteoio/IOManager.h>
#endif*/
#include <meteoio/IOManager.h>
using namespace std;
namespace mio {
#ifndef _POPC_
const unsigned int raw=1, filtered=2, resampled=3, num_of_levels=3;
#endif
IOManager::IOManager(const Config& i_cfg) : cfg(i_cfg), rawio(i_cfg), bufferedio(rawio, i_cfg), meteoprocessor(i_cfg)
{
/*#ifdef _POPC_
raw=1; filtered=2; resampled=3; num_of_levels=3;
#endif*/
setProcessingLevel(IOManager::filtered | IOManager::resampled);
fcache_start = fcache_end = Date(0.0, 0.); //this should not matter, since 0 is still way back before any real data...
......@@ -48,7 +36,7 @@ void IOManager::setProcessingLevel(const unsigned int& i_level)
if (i_level >= IOManager::num_of_levels)
throw InvalidArgumentException("The processing level is invalid", AT);
if (((i_level & IOManager::raw) == IOManager::raw)
if (((i_level & IOManager::raw) == IOManager::raw)
&& ((i_level & IOManager::filtered) == IOManager::filtered))
throw InvalidArgumentException("The processing level is invalid (raw and filtered at the same time)", AT);
......@@ -64,8 +52,8 @@ double IOManager::getAvgSamplingRate()
}
}
void IOManager::push_meteo_data(const unsigned int& level, const Date& date_start, const Date& date_end,
const std::vector< METEO_TIMESERIE >& vecMeteo)
void IOManager::push_meteo_data(const ProcessingLevel& level, const Date& date_start, const Date& date_end,
const std::vector< METEO_TIMESERIE >& vecMeteo)
{
//perform check on date_start and date_end
if (date_end < date_start)
......@@ -106,13 +94,13 @@ size_t IOManager::getMeteoData(const Date& dateStart, const Date& dateEnd,
vecMeteo.clear();
if (processing_level == IOManager::raw){
rawio.readMeteoData(dateStart, dateEnd, vecMeteo, IOUtils::npos);
rawio.readMeteoData(dateStart, dateEnd, vecMeteo);
} else {
bool success = read_filtered_cache(dateStart, dateEnd, vecMeteo);
if (!success){
vector< vector<MeteoData> > tmp_meteo;
bufferedio.readMeteoData(dateStart, dateEnd, tmp_meteo, IOUtils::npos);
bufferedio.readMeteoData(dateStart, dateEnd, tmp_meteo);
//now it needs to be secured that the data is actually filtered, if configured
if ((IOManager::filtered & processing_level) == IOManager::filtered){
......@@ -184,7 +172,7 @@ bool IOManager::read_filtered_cache(const Date& start_date, const Date& end_date
return true;
}
return false;
}
......@@ -214,7 +202,7 @@ size_t IOManager::getMeteoData(const Date& i_date, METEO_TIMESERIE& vecMeteo)
if (index != IOUtils::npos)
vecMeteo.push_back(vec_cache[ii][index]); //Insert station into vecMeteo
}
return vecMeteo.size();
}
......@@ -250,12 +238,12 @@ size_t IOManager::getMeteoData(const Date& i_date, METEO_TIMESERIE& vecMeteo)
return vecMeteo.size();
}
#ifdef _POPC_ //HACK popc
void IOManager::writeMeteoData(std::vector< METEO_TIMESERIE >& vecMeteo, std::string& name)
void IOManager::writeMeteoData(/*const*/ std::vector< METEO_TIMESERIE >& vecMeteo, /*const*/ std::string& name)
#else
void IOManager::writeMeteoData(const std::vector< METEO_TIMESERIE >& vecMeteo, const std::string& name)
#endif
{
if (processing_level == IOManager::raw) {
if (processing_level == IOManager::raw){
rawio.writeMeteoData(vecMeteo, name);
} else {
bufferedio.writeMeteoData(vecMeteo, name);
......@@ -263,10 +251,10 @@ void IOManager::writeMeteoData(const std::vector< METEO_TIMESERIE >& vecMeteo, c
}
#ifdef _POPC_ //HACK popc
void IOManager::interpolate(Date& date, DEMObject& dem, MeteoData::Parameters meteoparam,
void IOManager::interpolate(/*const*/ Date& date, /*const*/ DEMObject& dem, /*const*/ MeteoData::Parameters meteoparam,
Grid2DObject& result)
#else
void IOManager::interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
void IOManager::interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
Grid2DObject& result)
#endif
{
......@@ -275,7 +263,7 @@ void IOManager::interpolate(const Date& date, const DEMObject& dem, const MeteoD
}
#ifdef _POPC_ //HACK popc
void IOManager::interpolate(Date& date, DEMObject& dem, MeteoData::Parameters meteoparam,
void IOManager::interpolate(/*const*/ Date& date, /*const*/ DEMObject& dem, /*const*/ MeteoData::Parameters meteoparam,
Grid2DObject& result, std::string& info_string)
#else
void IOManager::interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
......
......@@ -18,16 +18,11 @@
#ifndef __IOMANAGER_H__
#define __IOMANAGER_H__
#include <meteoio/IOHandler.h>
#include <meteoio/BufferedIOHandler.h>
#include <meteoio/Meteo2DInterpolator.h>
#include <meteoio/MeteoProcessor.h>
#include <meteoio/MeteoData.h>
/*#ifdef _POPC_
#error
#endif*/
namespace mio {
class IOManager {
......@@ -39,6 +34,7 @@ class IOManager {
resampled = 1 << 2,
num_of_levels = 1 << 3
};
IOManager(const Config& i_cfg);
//Legacy support to support functionality of the IOInterface superclass:
......@@ -57,12 +53,12 @@ class IOManager {
* corresponding to the interval indicated by dateStart and dateEnd.
* Depending on the ProcessingLevel for the instance of the IOManager
* the data returned will be either raw (read directly from the IOHandler)
* or processed (read from an BufferedIOHandler and filtered through the
* or processed (read from an BufferedIOHandler and filtered through the
* MeteoProcessor
*
* vecMeteo will be empty if no datasets were retrieved in the interval defined
* by dateStart and dateEnd
*
*
* Example Usage:
* @code
* vector< vector<MeteoData> > vecMeteo; //empty vector
......@@ -82,8 +78,8 @@ class IOManager {
/**
* @brief Fill vector<MeteoData> object with multiple instances of MeteoData
* corresponding to the instant indicated by a Date object. Each MeteoData
* instance within the vector represents the data for one station at the given
* instant. Depending on the ProcessingLevel configured data will be either
* instance within the vector represents the data for one station at the given
* instant. Depending on the ProcessingLevel configured data will be either
* raw (read directly from the IOHandler)
*
* NOTE:
......@@ -105,29 +101,29 @@ class IOManager {
* @brief Push a vector of time series of MeteoData objects into the IOManager. This overwrites
* any internal buffers that are used and subsequent calls to getMeteoData or interpolate
* will be performed upon this data. This method is a way to bypass the internal reading
* of MeteoData from a certain source and is useful in case the user is only interested
* in data processing and interpolation performed by the IOManager object.
* of MeteoData from a certain source and is useful in case the user is only interested
* in data processing and interpolation performed by the IOManager object.
* @param level Level of processing that has already been performed on the data (raw XOR filtered)
* @param date_start Representing the beginning of the data
* @param date_end Representing the end of the data
* @param vecMeteo The actual data being pushed into the IOManager object
*/
void push_meteo_data(const unsigned int& level, const Date& date_start, const Date& date_end,
void push_meteo_data(const ProcessingLevel& level, const Date& date_start, const Date& date_end,
const std::vector< METEO_TIMESERIE >& vecMeteo);
#ifdef _POPC_ //HACK popc
void interpolate(Date& date, DEMObject& dem, MeteoData::Parameters meteoparam,
void interpolate(/*const*/ Date& date, /*const*/ DEMObject& dem, /*const*/ MeteoData::Parameters meteoparam,
Grid2DObject& result);
#else
void interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
void interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
Grid2DObject& result);
#endif
#ifdef _POPC_ //HACK popc
void interpolate(Date& date, DEMObject& dem, MeteoData::Parameters meteoparam,
void interpolate(/*const*/ Date& date, /*const*/ DEMObject& dem, /*const*/ MeteoData::Parameters meteoparam,
Grid2DObject& result, std::string& info_string);
#else
void interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
void interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
Grid2DObject& result, std::string& info_string);
#endif
......@@ -148,7 +144,7 @@ class IOManager {
double getAvgSamplingRate();
#ifdef _POPC_ //HACK popc
void writeMeteoData(std::vector< METEO_TIMESERIE >& vecMeteo, std::string& name/*=""*/);
void writeMeteoData(/*const*/ std::vector< METEO_TIMESERIE >& vecMeteo, /*const*/ std::string& name/*=""*/);
#else
void writeMeteoData(const std::vector< METEO_TIMESERIE >& vecMeteo, const std::string& name="");
#endif
......@@ -172,12 +168,6 @@ class IOManager {
std::vector< METEO_TIMESERIE > filtered_cache; ///< stores already filtered data intervals
Date fcache_start, fcache_end; ///< store the beginning and the end date of the filtered_cache
unsigned int processing_level;
/*#ifdef _POPC_
unsigned int raw, filtered, resampled, num_of_levels;
#else
static const unsigned int raw, filtered, resampled, num_of_levels;
#endif*/
};
} //end namespace
#endif
......@@ -57,25 +57,29 @@ parclass IOManager {
[out, proc=marshal_vector_METEO_TIMESERIE]std::vector< METEO_TIMESERIE >& vecMeteo);
unsigned int getMeteoData([in]const Date& i_date, [out, proc=marshal_METEO_TIMESERIE]METEO_TIMESERIE& vecMeteo);
void push_meteo_data([in] const unsigned int& level, [in] const Date& date_start, [in] const Date& date_end,
[in] const std::vector< METEO_TIMESERIE >& vecMeteo);
void interpolate([in] Date& date, [in] DEMObject& dem, [in, proc=marshal_MeteoParameters] MeteoData::Parameters& meteoparam,
void interpolate([in]const Date& date, [in]const DEMObject& dem, [in, proc=marshal_MeteoParameters]/*const*/ MeteoData::Parameters& meteoparam,
[out]Grid2DObject& result, [out]std::string& info_string);
void interpolate([in] Date& date, [in] DEMObject& dem, [in, proc=marshal_MeteoParameters] MeteoData::Parameters& meteoparam,
void interpolate([in]const Date& date, [in]const DEMObject& dem, [in, proc=marshal_MeteoParameters]/*const*/ MeteoData::Parameters& meteoparam,
[out]Grid2DObject& result); //HACK popc
void setProcessingLevel([in]const unsigned int& i_level);
double getAvgSamplingRate();
void writeMeteoData([in ,proc=marshal_vector_METEO_TIMESERIE] std::vector< METEO_TIMESERIE >& vecMeteo, [in] std::string name=""); //HACK popc
void writeMeteoData([in ,proc=marshal_vector_METEO_TIMESERIE]/*const*/ std::vector< METEO_TIMESERIE >& vecMeteo, [in]const std::string& name=""); //HACK popc
std::string toString() /*const*/; //HACK popc
//friend std::ostream& operator<<(std::ostream& os, const IOManager& io);
enum ProcessingLevel { //HACK BUG popc
raw = 1,
filtered = 1 << 1,
resampled = 1 << 2,
num_of_levels = 1 << 3
};
private:
void add_to_cache(const Date& i_date, const METEO_TIMESERIE& vecMeteo);
void fill_filtered_cache();
......@@ -91,10 +95,8 @@ parclass IOManager {
std::map<Date, METEO_TIMESERIE > resampled_cache; ///< stores already resampled data points
std::vector< METEO_TIMESERIE > filtered_cache; ///< stores already filtered data intervals
Date fcache_start, fcache_end; ///< store the beginning and the end date of the filtered_cache
Date fcache_start, fcache_end;
unsigned int processing_level;
unsigned int raw, filtered, resampled, num_of_levels; //HACK POPC
};
} //end namespace
......
......@@ -72,7 +72,7 @@
#include <meteoio/Timer.h>
#ifdef _POPC_
#include <meteoio/IOHandler.h> //HACK
#include <meteoio/IOHandler.ph>
#include <meteoio/IOManager.h> //HACK
#include <meteoio/marshal_meteoio.h>
#else
......
......@@ -15,9 +15,8 @@
You should have received a copy of the GNU Lesser General Public License
along with MeteoIO. If not, see <http://www.gnu.org/licenses/>.
*/
//#include <meteoio/IOHandler.ph>
#include <meteoio/IOHandler.ph>
//#include <meteoio/IOManager.ph>
//@pack(IOHandler, IOManager)
//@pack(IOManager)
//@pack(IOHandler)
@pack(IOHandler)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment