diff --git a/AMDiS/src/AdaptInstationary.cc b/AMDiS/src/AdaptInstationary.cc index eca9783c979d80b317e4e0ab3282c0362ddc537e..d185d75e6ed6630393ca1cc48fd003f59ccbdefd 100644 --- a/AMDiS/src/AdaptInstationary.cc +++ b/AMDiS/src/AdaptInstationary.cc @@ -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; } diff --git a/AMDiS/src/ElementFileWriter.h b/AMDiS/src/ElementFileWriter.h index 44d5b17139d51a25e577e15af3d6285300d74e8b..3ba744748ccd94e932423e8e0b796f80dc11a4bd 100644 --- a/AMDiS/src/ElementFileWriter.h +++ b/AMDiS/src/ElementFileWriter.h @@ -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. diff --git a/AMDiS/src/FileWriter.cc b/AMDiS/src/FileWriter.cc index aa53fe1dc621018556c294fe2768b6a5d5b94753..9278930e8fb79b8a8ff18b346b28880444436660 100644 --- a/AMDiS/src/FileWriter.cc +++ b/AMDiS/src/FileWriter.cc @@ -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"); - } } diff --git a/AMDiS/src/FileWriter.h b/AMDiS/src/FileWriter.h index 40469ecc759460fe7169e7dd2b47f48652a65716..b33952edddd980d4d5be37dfd0b6bef2e66c8284 100644 --- a/AMDiS/src/FileWriter.h +++ b/AMDiS/src/FileWriter.h @@ -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. diff --git a/AMDiS/src/ProblemInstat.cc b/AMDiS/src/ProblemInstat.cc index ffda85ef1dde6a996903b85617db4ad7fb071908..1b3dbe41b5fc69ca60f800cf0541066cdae07003 100644 --- a/AMDiS/src/ProblemInstat.cc +++ b/AMDiS/src/ProblemInstat.cc @@ -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(); - } } diff --git a/AMDiS/src/ProblemInstat.h b/AMDiS/src/ProblemInstat.h index 351dc864ae030d27432fb9c529345372bd28cc29..e3bd1d1a3fd6dc1f702b240a8fa1ee984189ab9f 100644 --- a/AMDiS/src/ProblemInstat.h +++ b/AMDiS/src/ProblemInstat.h @@ -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 diff --git a/AMDiS/src/ProblemScal.cc b/AMDiS/src/ProblemScal.cc index 3d65398e59fe383609f214f0e1c6aac6bfbf32e8..f3d1f178e1c48c50e947c3adeadf499ae6e015d4 100644 --- a/AMDiS/src/ProblemScal.cc +++ b/AMDiS/src/ProblemScal.cc @@ -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); diff --git a/AMDiS/src/ProblemScal.h b/AMDiS/src/ProblemScal.h index a61a1de1ed00b0b9864bbdf282da33220c63b6e9..d60bf76e9c0ea106b91940e4943ee13f6edc4e62 100644 --- a/AMDiS/src/ProblemScal.h +++ b/AMDiS/src/ProblemScal.h @@ -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. */ diff --git a/AMDiS/src/ProblemTimeInterface.h b/AMDiS/src/ProblemTimeInterface.h index ca71227cbad1051a8116e08c1375b31a5934da67..cb5600b47ace4c62d475dcecc94c72b9bf014fd7 100644 --- a/AMDiS/src/ProblemTimeInterface.h +++ b/AMDiS/src/ProblemTimeInterface.h @@ -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. */ diff --git a/AMDiS/src/ProblemVec.cc b/AMDiS/src/ProblemVec.cc index 66b8d22146b91bb272d8a451bcfe53f4efd6b751..76d4b38515e1fc37ee79006eaafb5efaa86eaf1d 100644 --- a/AMDiS/src/ProblemVec.cc +++ b/AMDiS/src/ProblemVec.cc @@ -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()"); diff --git a/AMDiS/src/ProblemVec.h b/AMDiS/src/ProblemVec.h index fd29d2e45d6d345fab1ea12e3e20411b750fda54..e3c6b6500d17b8dd9a80fd2285991f38b20abb6d 100644 --- a/AMDiS/src/ProblemVec.h +++ b/AMDiS/src/ProblemVec.h @@ -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. */ diff --git a/AMDiS/src/VtkWriter.cc b/AMDiS/src/VtkWriter.cc index e9ff0ce78b2d26ed890cc60023205af9c3e45ca3..0e4aa54f43f933411b3900c689c5c427d365b894 100644 --- a/AMDiS/src/VtkWriter.cc +++ b/AMDiS/src/VtkWriter.cc @@ -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();