Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Backofen, Rainer
amdis
Commits
7bc60867
Commit
7bc60867
authored
Sep 29, 2008
by
Thomas Witkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Delayed writing removed
parent
ecf4d835
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
6 additions
and
192 deletions
+6
-192
AMDiS/src/AdaptInstationary.cc
AMDiS/src/AdaptInstationary.cc
+0
-18
AMDiS/src/ElementFileWriter.h
AMDiS/src/ElementFileWriter.h
+0
-6
AMDiS/src/FileWriter.cc
AMDiS/src/FileWriter.cc
+1
-34
AMDiS/src/FileWriter.h
AMDiS/src/FileWriter.h
+0
-33
AMDiS/src/ProblemInstat.cc
AMDiS/src/ProblemInstat.cc
+0
-20
AMDiS/src/ProblemInstat.h
AMDiS/src/ProblemInstat.h
+4
-16
AMDiS/src/ProblemScal.cc
AMDiS/src/ProblemScal.cc
+0
-17
AMDiS/src/ProblemScal.h
AMDiS/src/ProblemScal.h
+0
-10
AMDiS/src/ProblemTimeInterface.h
AMDiS/src/ProblemTimeInterface.h
+0
-11
AMDiS/src/ProblemVec.cc
AMDiS/src/ProblemVec.cc
+0
-17
AMDiS/src/ProblemVec.h
AMDiS/src/ProblemVec.h
+0
-10
AMDiS/src/VtkWriter.cc
AMDiS/src/VtkWriter.cc
+1
-0
No files found.
AMDiS/src/AdaptInstationary.cc
View file @
7bc60867
...
...
@@ -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
;
}
...
...
AMDiS/src/ElementFileWriter.h
View file @
7bc60867
...
...
@@ -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.
...
...
AMDiS/src/FileWriter.cc
View file @
7bc60867
...
...
@@ -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
"
);
}
}
AMDiS/src/FileWriter.h
View file @
7bc60867
...
...
@@ -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.
...
...
AMDiS/src/ProblemInstat.cc
View file @
7bc60867
...
...
@@ -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
();
}
}
AMDiS/src/ProblemInstat.h
View file @
7bc60867
...
...
@@ -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
...
...
AMDiS/src/ProblemScal.cc
View file @
7bc60867
...
...
@@ -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
);
...
...
AMDiS/src/ProblemScal.h
View file @
7bc60867
...
...
@@ -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.
*/
...
...
AMDiS/src/ProblemTimeInterface.h
View file @
7bc60867
...
...
@@ -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.
*/
...
...
AMDiS/src/ProblemVec.cc
View file @
7bc60867
...
...
@@ -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()"
);
...
...
AMDiS/src/ProblemVec.h
View file @
7bc60867
...
...
@@ -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.
*/
...
...
AMDiS/src/VtkWriter.cc
View file @
7bc60867
...
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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