Commit 7bc60867 authored by Thomas Witkowski's avatar Thomas Witkowski

* Delayed writing removed

parent ecf4d835
......@@ -217,23 +217,7 @@ namespace AMDiS {
problemTime_->initTimestep(adaptInfo_);
#ifdef _OPENMP
if (problemTime_->existsDelayedCalculation()) {
#pragma omp parallel sections num_threads(2)
{
#pragma omp section
problemTime_->startDelayedTimestepCalculation();
#pragma omp section
oneTimestep();
}
} else {
oneTimestep();
}
#else
problemTime_->startDelayedTimestepCalculation();
oneTimestep();
#endif
problemTime_->closeTimestep(adaptInfo_);
......@@ -250,8 +234,6 @@ namespace AMDiS {
}
}
problemTime_->startDelayedTimestepCalculation();
return errorCode;
}
......
......@@ -30,12 +30,6 @@ namespace AMDiS {
Flag traverseFlag = Mesh::CALL_LEAF_EL,
bool (*writeElem)(ElInfo*) = NULL);
void writeDelayedFiles() {};
bool isWritingDelayed() {
return false;
};
protected:
/**
* Writes element data in tecplot format.
......
......@@ -111,10 +111,7 @@ namespace AMDiS {
indexDecimals = 3;
tsModulo = 1;
nTmpSolutions_ = 0;
delayWriting_ = 0;
writingIsDelayed_ = false;
delayedFilename_ = "";
paraViewAnimationFrames_.resize(0);
paraViewAnimationFrames_.resize(0),
compression = NONE;
readParameters();
......@@ -139,7 +136,6 @@ namespace AMDiS {
GET_PARAMETER(0, name + "->index length", "%d", &indexLength);
GET_PARAMETER(0, name + "->index decimals", "%d", &indexDecimals);
GET_PARAMETER(0, name + "->write every i-th timestep", "%d", &tsModulo);
GET_PARAMETER(0, name + "->delay", "%d", &delayWriting_);
std::string compressionStr = "";
GET_PARAMETER(0, name + "->compression", &compressionStr);
......@@ -148,9 +144,6 @@ namespace AMDiS {
} else if ((compressionStr == "bzip2") || (compressionStr == "bz2")) {
compression = BZIP2;
}
TEST_EXIT(!delayWriting_ || amdisHaveOpenMP)
("Delayed writing only possible with OpenMP support!\n");
}
void FileWriter::writeFiles(AdaptInfo *adaptInfo,
......@@ -164,10 +157,6 @@ namespace AMDiS {
if ((adaptInfo->getTimestepNumber() % tsModulo != 0) && !force)
return;
if (writingIsDelayed_) {
ERROR_EXIT("This should not happen!\n");
}
// Containers, which store the data to be written;
std::vector< DataCollector* > dataCollectors(solutionVecs_.size());
......@@ -199,24 +188,6 @@ namespace AMDiS {
fn += timeStr;
}
if (delayWriting_) {
if (writeTecPlotFormat || writeAMDiSFormat || writePeriodicFormat) {
ERROR_EXIT("Delay writing only supported for ParaView file format!\n");
}
for (int i = 0; i < static_cast<int>(dataCollectors.size()); i++) {
dataCollectors[i]->fillAllData();
}
writingIsDelayed_ = true;
delayedFilename_ = fn;
MSG("Delayed writing of ParaView file %s\n", (fn + paraViewFileExt).c_str());
return;
}
if (writeTecPlotFormat) {
TecPlotWriter<DOFVector<double> >::writeValues(solutionVecs_[0],
const_cast<char*>((fn + tecplotExt).c_str()),
......@@ -266,8 +237,4 @@ namespace AMDiS {
}
}
void FileWriter::writeDelayedFiles()
{
ERROR_EXIT("no more!\n");
}
}
......@@ -77,10 +77,6 @@ namespace AMDiS {
Flag traverseFlag = Mesh::CALL_LEAF_EL,
bool (*writeElem)(ElInfo*) = NULL) = 0;
virtual void writeDelayedFiles() = 0;
virtual bool isWritingDelayed() = 0;
void setTraverseProperties(int level,
Flag flag,
bool (*writeElem)(ElInfo*))
......@@ -162,18 +158,6 @@ namespace AMDiS {
Flag traverseFlag = Mesh::CALL_LEAF_EL,
bool (*writeElem)(ElInfo*) = NULL);
/** \brief
* Starts the delayed writing.
*/
virtual void writeDelayedFiles();
/** \brief
* Returns true, if the file writer is waiting to start writing.
*/
bool isWritingDelayed() {
return writingIsDelayed_;
}
protected:
/** \brief
* Initialization of the filewriter.
......@@ -297,23 +281,6 @@ namespace AMDiS {
*/
int nTmpSolutions_;
/** \brief
* If set to 1, the FileWriter will delay the file writing to the future, where
* it can be executed in parallel with some other independent calculations.
*/
int delayWriting_;
/** \brief
* If set to true, the FileWriter was filled with data, but the Files are currently
* not written to disk.
*/
bool writingIsDelayed_;
/** \brief
* Here the filename for the file, which should be written to the next, is stored.
*/
std::string delayedFilename_;
/** \brief
* Defines if, and with what kind of compression, the file should be compressed
* during writing.
......
......@@ -185,24 +185,4 @@ namespace AMDiS {
void ProblemInstatVec::initTimestep(AdaptInfo *adaptInfo) {
oldSolution->copy(*(problemStat->getSolution()));
}
void ProblemInstatScal::startDelayedTimestepCalculation()
{
problemStat->writeDelayedFiles();
}
void ProblemInstatVec::startDelayedTimestepCalculation()
{
problemStat->writeDelayedFiles();
}
bool ProblemInstatScal::existsDelayedCalculation()
{
return problemStat->existsDelayedCalculation();
}
bool ProblemInstatVec::existsDelayedCalculation()
{
return problemStat->existsDelayedCalculation();
}
}
......@@ -121,10 +121,6 @@ namespace AMDiS {
*/
virtual void solveInitialProblem(AdaptInfo *adaptInfo);
/** \brief
* Implements the parallel file writing for instationary problems.
*/
virtual void startDelayedTimestepCalculation() {};
protected:
/** \brief
......@@ -204,13 +200,9 @@ namespace AMDiS {
*/
virtual void transferInitialSolution(AdaptInfo *adaptInfo);
virtual void startDelayedTimestepCalculation();
virtual bool existsDelayedCalculation();
virtual void serialize(std::ostream &out) {};
virtual void deserialize(std::istream &in) {};
protected:
......@@ -281,27 +273,23 @@ namespace AMDiS {
*/
inline ProblemVec* getStatProblem() {
return problemStat;
};
}
/** \brief
* Returns \ref oldSolution.
*/
inline SystemVector *getOldSolution() {
return oldSolution;
};
}
/** \brief
* Used by \ref problemInitial
*/
virtual void transferInitialSolution(AdaptInfo *adaptInfo);
virtual void startDelayedTimestepCalculation();
virtual bool existsDelayedCalculation();
virtual void serialize(std::ostream &out) {}
virtual void serialize(std::ostream &out) {};
virtual void deserialize(std::istream &in) {};
virtual void deserialize(std::istream &in) {}
protected:
/** \brief
......
......@@ -35,23 +35,6 @@ namespace AMDiS {
}
}
void ProblemScal::writeDelayedFiles()
{
for (int i = 0; i < static_cast<int>(fileWriters_.size()); i++) {
fileWriters_[i]->writeDelayedFiles();
}
}
bool ProblemScal::existsDelayedCalculation()
{
for (int i = 0; i < static_cast<int>(fileWriters_.size()); i++) {
if (fileWriters_[i]->isWritingDelayed())
return true;
}
return false;
}
void ProblemScal::interpolInitialSolution(AbstractFunction<double, WorldVector<double> > *fct)
{
solution_->interpol(fct);
......
......@@ -201,16 +201,6 @@ namespace AMDiS {
*/
void writeFiles(AdaptInfo *adaptInfo, bool force);
/** \brief
* Startes parallel output writing;
*/
void writeDelayedFiles();
/** \brief
* Returns true, if there is calculation waiting to be started.
*/
bool existsDelayedCalculation();
/** \brief
* Interpolates fct to \ref solution.
*/
......
......@@ -69,17 +69,6 @@ namespace AMDiS {
*/
virtual void transferInitialSolution(AdaptInfo *adaptInfo) = 0;
/** \brief
* Starts calculations from the last timestep, which can be done in parallel
* with the calculations of the current timestep;
*/
virtual void startDelayedTimestepCalculation() = 0;
/** \brief
* Returns true, if there is some delayed calculation waiting to be started.
*/
virtual bool existsDelayedCalculation() = 0;
/** \brief
* Function that serializes the problem plus information about the iteration.
*/
......
......@@ -793,23 +793,6 @@ namespace AMDiS {
#endif
}
void ProblemVec::writeDelayedFiles()
{
for (int i = 0; i < static_cast<int>(fileWriters_.size()); i++) {
fileWriters_[i]->writeDelayedFiles();
}
}
bool ProblemVec::existsDelayedCalculation()
{
for (int i = 0; i < static_cast<int>(fileWriters_.size()); i++) {
if (fileWriters_[i]->isWritingDelayed())
return true;
}
return false;
}
void ProblemVec::interpolInitialSolution(std::vector<AbstractFunction<double, WorldVector<double> >*> *fct)
{
FUNCNAME("ProblemVec::interpolInitialSolution()");
......
......@@ -229,16 +229,6 @@ namespace AMDiS {
*/
void writeFiles(AdaptInfo *adaptInfo, bool force);
/** \brief
* Startes parallel output writing;
*/
void writeDelayedFiles();
/** \brief
* Returns true, if there is calculation waiting to be started.
*/
bool existsDelayedCalculation();
/** \brief
* Interpolates fct to \ref solution.
*/
......
......@@ -35,6 +35,7 @@ namespace AMDiS {
std::ofstream file;
file.open(name);
TEST_EXIT(file.is_open())("Cannot open file %s for writing\n", name);
writeFile(file);
file.close();
......
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