Commit 9a775796 authored by Sebastian Rettenberger's avatar Sebastian Rettenberger

Merge branch 'master' into SSE_performance_measure

parents 93a4ae11 60d0d798
...@@ -195,7 +195,8 @@ env.Append(CCFLAGS=['-fstrict-aliasing', '-fargument-noalias']) ...@@ -195,7 +195,8 @@ env.Append(CCFLAGS=['-fstrict-aliasing', '-fargument-noalias'])
# Vectorization? # Vectorization?
if env['compileMode'] == 'release' and env['vectorize']: if env['compileMode'] == 'release' and env['vectorize']:
env.Append(CPPDEFINES=['VECTORIZE']) env.Append(CPPDEFINES=['VECTORIZE'])
env.Append(CCFLAGS=['-xHost']) if env['compiler'] == 'intel':
env.Append(CCFLAGS=['-xHost'])
if env['compiler'] == 'intel' and env['showVectorization']: if env['compiler'] == 'intel' and env['showVectorization']:
env.Append(CCFLAGS=['-vec-report2']) env.Append(CCFLAGS=['-vec-report2'])
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
* @param i_dY cell size in y-direction. * @param i_dY cell size in y-direction.
* @param i_originX * @param i_originX
* @param i_originY * @param i_originY
* @param i_flush If > 0, flush data to disk every i_flush write operation
* @param i_dynamicBathymetry * @param i_dynamicBathymetry
*/ */
io::NetCdfWriter::NetCdfWriter( const std::string &i_baseName, io::NetCdfWriter::NetCdfWriter( const std::string &i_baseName,
...@@ -50,9 +51,11 @@ io::NetCdfWriter::NetCdfWriter( const std::string &i_baseName, ...@@ -50,9 +51,11 @@ io::NetCdfWriter::NetCdfWriter( const std::string &i_baseName,
const BoundarySize &i_boundarySize, const BoundarySize &i_boundarySize,
int i_nX, int i_nY, int i_nX, int i_nY,
float i_dX, float i_dY, float i_dX, float i_dY,
float i_originX, float i_originY) : float i_originX, float i_originY,
unsigned int i_flush) :
//const bool &i_dynamicBathymetry) : //!TODO //const bool &i_dynamicBathymetry) : //!TODO
io::Writer(i_baseName + ".nc", i_b, i_boundarySize, i_nX, i_nY) io::Writer(i_baseName + ".nc", i_b, i_boundarySize, i_nX, i_nY),
flush(i_flush)
{ {
int status; int status;
...@@ -216,4 +219,7 @@ void io::NetCdfWriter::writeTimeStep( const Float2D &i_h, ...@@ -216,4 +219,7 @@ void io::NetCdfWriter::writeTimeStep( const Float2D &i_h,
// Increment timeStep for next call // Increment timeStep for next call
timeStep++; timeStep++;
if (flush > 0 && timeStep % flush == 0)
nc_sync(dataFile);
} }
...@@ -48,6 +48,9 @@ private: ...@@ -48,6 +48,9 @@ private:
/** Variable ids */ /** Variable ids */
int timeVar, hVar, huVar, hvVar, bVar; int timeVar, hVar, huVar, hvVar, bVar;
/** Flush after every x write operation? */
unsigned int flush;
// writer time dependent variables. // writer time dependent variables.
void writeVarTimeDependent( const Float2D &i_matrix, void writeVarTimeDependent( const Float2D &i_matrix,
int i_ncVariable); int i_ncVariable);
...@@ -63,7 +66,8 @@ private: ...@@ -63,7 +66,8 @@ private:
const BoundarySize &i_boundarySize, const BoundarySize &i_boundarySize,
int i_nX, int i_nY, int i_nX, int i_nY,
float i_dX, float i_dY, float i_dX, float i_dY,
float i_originX = 0., float i_originY = 0.); float i_originX = 0., float i_originY = 0.,
unsigned int i_flush = 0);
virtual ~NetCdfWriter(); virtual ~NetCdfWriter();
// writes the unknowns at a given time step to the netCDF-file. // writes the unknowns at a given time step to the netCDF-file.
......
Markdown is supported
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