diff --git a/AMDiS/src/AMDiS.h b/AMDiS/src/AMDiS.h index 82b62be99f93f9967c9ee4865fff951452e3e080..1a873c9a110c196886acfb0455f5c64d2ceffe32 100644 --- a/AMDiS/src/AMDiS.h +++ b/AMDiS/src/AMDiS.h @@ -134,6 +134,7 @@ #if HAVE_PARALLEL_DOMAIN_AMDIS #include "parallel/InteriorBoundary.h" #include "parallel/MpiHelper.h" +#include "parallel/StdMpi.h" #if HAVE_PARALLEL_MTL4 #include "parallel/Mtl4Solver.h" diff --git a/AMDiS/src/AdaptInstationary.cc b/AMDiS/src/AdaptInstationary.cc index 2cef837795c42efc5818b5af42f0d9ae46041716..c402888a53b95f732781f327c1de15973ba85ca6 100644 --- a/AMDiS/src/AdaptInstationary.cc +++ b/AMDiS/src/AdaptInstationary.cc @@ -85,6 +85,12 @@ namespace AMDiS { MSG("Deserialization from file: %s\n", queueSerializationFilename.c_str()); std::ifstream in(queueSerializationFilename.c_str() , ios::in); + + // Read the revision number of the AMDiS version which was used to create + // the serialization file. + int revNumber = -1; + SerUtil::deserialize(in, revNumber); + deserialize(in); in.close(); @@ -108,6 +114,12 @@ namespace AMDiS { MSG("Deserialization with AdaptInfo from file: %s\n", serializationFilename.c_str()); std::ifstream in(serializationFilename.c_str()); + + // Read the revision number of the AMDiS version which was used to create + // the serialization file. + int revNumber = -1; + SerUtil::deserialize(in, revNumber); + deserialize(in); in.close(); } @@ -372,7 +384,6 @@ namespace AMDiS { { FUNCNAME("AdaptInstationary::serialize()"); - SerUtil::serialize(out, amdisRevisionNumber); problemIteration->serialize(out); adaptInfo->serialize(out); if (problemTime) @@ -383,8 +394,10 @@ namespace AMDiS { void AdaptInstationary::deserialize(std::istream &in) { FUNCNAME("AdaptInstationary::deserialize()"); - if(in.fail()) - ERROR_EXIT("File not found for deserialization \n"); + + if (in.fail()) + ERROR_EXIT("File not found for deserialization!\n"); + problemIteration->deserialize(in); adaptInfo->deserialize(in); if (problemTime) diff --git a/AMDiS/src/DOFVector.hh b/AMDiS/src/DOFVector.hh index 94cf9fa622236be8496c9cf0decbecc124717a60..7ca24888e32a054b2d6e6123da999202c9d52d39 100644 --- a/AMDiS/src/DOFVector.hh +++ b/AMDiS/src/DOFVector.hh @@ -120,10 +120,10 @@ namespace AMDiS { { if (this->feSpace && this->feSpace->getAdmin()) (this->feSpace->getAdmin())->removeDOFIndexed(this); - + if (this->boundaryManager) delete this->boundaryManager; - + vec.clear(); } diff --git a/AMDiS/src/Initfile.cc b/AMDiS/src/Initfile.cc index 72899ec6da7c9401fbd6d0d1cd9b67f44a4dffda..c5a063457f75d8dc5c00082475f50690ed0d290e 100644 --- a/AMDiS/src/Initfile.cc +++ b/AMDiS/src/Initfile.cc @@ -15,8 +15,8 @@ namespace AMDiS { { size_t pos = line.find(':'); if (pos == string::npos) { - throw runtime_error("cannot find the delimiter ':' in line " - "'" + line + "'"); + throw runtime_error("cannot find the delimiter ':' in line " + "'" + line + "'"); } name = line.substr(0, pos); value = line.substr(pos + 1, line.length() - (pos + 1)); @@ -24,7 +24,7 @@ namespace AMDiS { // remove everything after the % pos = value.find('%'); if (pos != string::npos) - value = value.substr(0, pos); + value = value.substr(0, pos); } string name; string value; @@ -72,7 +72,7 @@ namespace AMDiS { char swap[line_length]; in.getline(swap, line_length); while (in.good() || in.gcount()>0) { - std::string whitespaces = " \t\r\f"; + std::string whitespaces = " \t\r\f\n"; std::string sw(swap); size_t pos0 = sw.find_first_not_of(whitespaces); diff --git a/AMDiS/src/ProblemStat.cc b/AMDiS/src/ProblemStat.cc index 348423d923406c7acb5552b01c66b6d3ad978bfd..79bc39b8b05cf4a211401c63e60c7cffd04ec924 100644 --- a/AMDiS/src/ProblemStat.cc +++ b/AMDiS/src/ProblemStat.cc @@ -217,9 +217,14 @@ namespace AMDiS { #ifndef HAVE_PARALLEL_DOMAIN_AMDIS MSG("Deserialization from file: %s\n", serializationFilename.c_str()); ifstream in(serializationFilename.c_str()); + + // Read the revision number of the AMDiS version which was used to create + // the serialization file. + int revNumber = -1; + SerUtil::deserialize(in, revNumber); + deserialize(in); in.close(); - #endif deserialized = true; @@ -1697,8 +1702,8 @@ namespace AMDiS { void ProblemStatSeq::deserialize(istream &in) { FUNCNAME("ProblemStat::deserialize()"); - if(in.fail()) - ERROR_EXIT("File not found for deserialization \n"); + if (in.fail()) + ERROR_EXIT("File not found for deserialization!\n"); for (unsigned int i = 0; i < meshes.size(); i++) meshes[i]->deserialize(in); diff --git a/AMDiS/src/parallel/MeshDistributor.cc b/AMDiS/src/parallel/MeshDistributor.cc index b55ad5bf09c5a707eb3628fa157d4a05a850b6fe..937ea8b371d725fecdb36b095317291edef2f02d 100644 --- a/AMDiS/src/parallel/MeshDistributor.cc +++ b/AMDiS/src/parallel/MeshDistributor.cc @@ -349,6 +349,11 @@ namespace AMDiS { if (feSpace != NULL) { vector<FiniteElemSpace*> feSpaces = probStat->getFeSpaces(); for (unsigned int i = 0; i < feSpaces.size(); i++) { + MSG("MESH %p <-> %p BF %p <-> %p\n", + feSpace->getMesh(), + feSpaces[i]->getMesh(), + feSpace->getBasisFcts(), + feSpaces[i]->getBasisFcts()); TEST_EXIT(feSpace == feSpaces[i]) ("Parallelizaton is not supported for multiple FE spaces!\n"); } @@ -409,6 +414,11 @@ namespace AMDiS { TEST_EXIT(!in.fail())("Could not open deserialization file: %s\n", filename.c_str()); + // Read the revision number of the AMDiS version which was used to create + // the serialization file. + int revNumber = -1; + SerUtil::deserialize(in, revNumber); + probStat->deserialize(in); in.close(); MSG("Deserialization from file: %s\n", filename.c_str()); @@ -424,6 +434,11 @@ namespace AMDiS { TEST_EXIT(!in.fail())("Could not open parallel deserialization file: %s\n", filename.c_str()); + + // Read the revision number of the AMDiS version which was used to create + // the serialization file. + revNumber = -1; + SerUtil::deserialize(in, revNumber); deserialize(in); in.close();