Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iwr
amdis
Commits
90f28a27
Commit
90f28a27
authored
Nov 08, 2011
by
Thomas Witkowski
Browse files
Fixed serious bug on serialization/deserialization.
parent
d2f8df57
Changes
6
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/AMDiS.h
View file @
90f28a27
...
...
@@ -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"
...
...
AMDiS/src/AdaptInstationary.cc
View file @
90f28a27
...
...
@@ -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
)
...
...
AMDiS/src/DOFVector.hh
View file @
90f28a27
...
...
@@ -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
();
}
...
...
AMDiS/src/Initfile.cc
View file @
90f28a27
...
...
@@ -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
);
...
...
AMDiS/src/ProblemStat.cc
View file @
90f28a27
...
...
@@ -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
);
...
...
AMDiS/src/parallel/MeshDistributor.cc
View file @
90f28a27
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment