Commit 52419cef authored by Backofen, Rainer's avatar Backofen, Rainer
Browse files

Error message for missing file in deserialization

parent 5ce8ac8b
...@@ -82,7 +82,7 @@ namespace AMDiS { ...@@ -82,7 +82,7 @@ namespace AMDiS {
// serialization file mentioned in the used init file. // serialization file mentioned in the used init file.
MSG("Deserialization from file: %s\n", queueSerializationFilename.c_str()); MSG("Deserialization from file: %s\n", queueSerializationFilename.c_str());
std::ifstream in(queueSerializationFilename.c_str()); std::ifstream in(queueSerializationFilename.c_str() , ios::in);
deserialize(in); deserialize(in);
in.close(); in.close();
...@@ -388,7 +388,8 @@ namespace AMDiS { ...@@ -388,7 +388,8 @@ namespace AMDiS {
void AdaptInstationary::deserialize(std::istream &in) void AdaptInstationary::deserialize(std::istream &in)
{ {
FUNCNAME("AdaptInstationary::deserialize()"); FUNCNAME("AdaptInstationary::deserialize()");
if(in.fail())
ERROR_EXIT("File not found for deserialization \n");
problemIteration->deserialize(in); problemIteration->deserialize(in);
adaptInfo->deserialize(in); adaptInfo->deserialize(in);
if (problemTime) if (problemTime)
......
...@@ -196,11 +196,11 @@ namespace AMDiS { ...@@ -196,11 +196,11 @@ namespace AMDiS {
// If AMDiS is compiled for parallel computations, the deserialization is // If AMDiS is compiled for parallel computations, the deserialization is
// controlled by the parallel problem object. // controlled by the parallel problem object.
#ifndef HAVE_PARALLEL_DOMAIN_AMDIS #ifndef HAVE_PARALLEL_DOMAIN_AMDIS
MSG("Deserialization from file: %s\n", serializationFilename.c_str());
ifstream in(serializationFilename.c_str()); ifstream in(serializationFilename.c_str());
deserialize(in); deserialize(in);
in.close(); in.close();
MSG("Deserialization from file: %s\n", serializationFilename.c_str());
#endif #endif
deserialized = true; deserialized = true;
...@@ -1814,6 +1814,8 @@ namespace AMDiS { ...@@ -1814,6 +1814,8 @@ namespace AMDiS {
void ProblemStatSeq::deserialize(istream &in) void ProblemStatSeq::deserialize(istream &in)
{ {
FUNCNAME("ProblemStat::deserialize()"); FUNCNAME("ProblemStat::deserialize()");
if(in.fail())
ERROR_EXIT("File not found for deserialization \n");
for (unsigned int i = 0; i < meshes.size(); i++) for (unsigned int i = 0; i < meshes.size(); i++)
meshes[i]->deserialize(in); meshes[i]->deserialize(in);
......
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