Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dune-fem-dg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dune-fem
dune-fem-dg
Commits
2863e77e
Commit
2863e77e
authored
11 years ago
by
Robert Kloefkorn
Browse files
Options
Downloads
Patches
Plain Diff
renamed runfile to diagnostics.
parent
778977fc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/fem-dg/misc/Makefile.am
+1
-1
1 addition, 1 deletion
dune/fem-dg/misc/Makefile.am
dune/fem-dg/misc/diagnostics.hh
+49
-49
49 additions, 49 deletions
dune/fem-dg/misc/diagnostics.hh
with
50 additions
and
50 deletions
dune/fem-dg/misc/Makefile.am
+
1
−
1
View file @
2863e77e
miscdir
=
$(
includedir
)
/dune/fem-dg/misc
misc_HEADERS
=
runfile
.hh cons2prim.hh streams.hh
misc_HEADERS
=
diagnostics
.hh cons2prim.hh streams.hh
include
$(top_srcdir)/am/global-rules
This diff is collapsed.
Click to expand it.
dune/fem-dg/misc/
runfile
.hh
→
dune/fem-dg/misc/
diagnostics
.hh
+
49
−
49
View file @
2863e77e
#ifndef DUNE_FEM_DG_
RUNFILE
_HH
#define DUNE_FEM_DG_
RUNFILE
_HH
#ifndef DUNE_FEM_DG_
DIAGNOSTICS
_HH
#define DUNE_FEM_DG_
DIAGNOSTICS
_HH
#include
<dune/fem/io/parameter.hh>
#include
<dune/fem/misc/mpimanager.hh>
#include
<dune/fem/misc/threads/threadmanager.hh>
#include
<dune/fem-dg/pass/threadpass.hh>
namespace
Dune
{
template
<
class
GridType
>
class
RunFile
:
public
Fem
::
AutoPersistentObject
class
Diagnostics
:
public
Fem
::
AutoPersistentObject
{
typedef
typename
GridType
::
Traits
::
CollectiveCommunication
CommunicatorType
;
typedef
Fem
::
MPIManager
::
CollectiveCommunication
CommunicatorType
;
const
CommunicatorType
&
comm_
;
const
std
::
string
runFileName_
;
const
int
write
RunFile
_
;
// 0 don't, 1 only speedup file, 2 write all
runfile
s
const
int
write
Diagnostics
_
;
// 0 don't, 1 only speedup file, 2 write all
diagnostics
s
// 3 only write 0, others at end, 4 all files at end
std
::
ostream
*
runfile
_
;
std
::
ostream
*
diagnostics
_
;
std
::
vector
<
double
>
times_
;
double
elements_
;
...
...
@@ -28,35 +28,35 @@ namespace Dune {
return
(
size_t
(
t
*
1e3
));
}
void
writeHeader
(
std
::
ostream
&
runfile
)
void
writeHeader
(
std
::
ostream
&
diagnostics
)
{
// write header
runfile
<<
"# Time "
;
runfile
<<
" dt "
;
runfile
<<
" Elements "
;
runfile
<<
" dg "
;
runfile
<<
" ode "
;
runfile
<<
" adapt "
;
runfile
<<
" lb "
;
runfile
<<
" all "
;
runfile
<<
" indi "
;
runfile
<<
" limfunc "
;
runfile
<<
" limit (in ms) "
<<
std
::
endl
;
runfile
.
flush
();
diagnostics
<<
"# Time "
;
diagnostics
<<
" dt "
;
diagnostics
<<
" Elements "
;
diagnostics
<<
" dg "
;
diagnostics
<<
" ode "
;
diagnostics
<<
" adapt "
;
diagnostics
<<
" lb "
;
diagnostics
<<
" all "
;
diagnostics
<<
" indi "
;
diagnostics
<<
" limfunc "
;
diagnostics
<<
" limit (in ms) "
<<
std
::
endl
;
diagnostics
.
flush
();
}
std
::
string
runFileName
(
const
int
rank
)
const
{
std
::
stringstream
runfile
;
runfile
<<
Fem
::
Parameter
::
commonOutputPath
()
<<
"/run."
<<
rank
;
return
runfile
.
str
();
std
::
stringstream
diagnostics
;
diagnostics
<<
Fem
::
Parameter
::
commonOutputPath
()
<<
"/run."
<<
rank
;
return
diagnostics
.
str
();
}
std
::
ostream
*
create
RunFile
(
const
int
rank
,
std
::
ostream
*
create
Diagnostics
(
const
int
rank
,
const
int
writeId
,
const
bool
newStart
)
{
// in case of no writing or only speedup table don't create
runfile
// in case of no writing or only speedup table don't create
diagnostics
if
(
writeId
<=
1
)
return
0
;
bool
writeAtOnce
=
(
writeId
>
2
);
...
...
@@ -80,26 +80,26 @@ namespace Dune {
}
}
public
:
RunFile
(
const
CommunicatorType
&
comm
,
const
bool
newStart
)
:
comm_
(
comm
)
explicit
Diagnostics
(
const
bool
newStart
)
:
comm_
(
Fem
::
MPIManager
::
comm
()
)
,
runFileName_
(
runFileName
(
comm_
.
rank
()
)
)
,
write
RunFile
_
(
Fem
::
Parameter
::
getValue
<
int
>
(
"fem.parallel.
runfile
"
,
0
)
)
,
runfile_
(
createRunFile
(
comm_
.
rank
(),
write
RunFile
_
,
newStart
)
)
,
write
Diagnostics
_
(
Fem
::
Parameter
::
getValue
<
int
>
(
"fem.parallel.
diagnostics
"
,
0
)
)
,
diagnostics_
(
createDiagnostics
(
comm_
.
rank
(),
write
Diagnostics
_
,
newStart
)
)
,
times_
()
,
elements_
(
0.0
)
,
maxDofs_
(
0.0
)
,
timesteps_
(
0
)
{
if
(
runfile
_
&&
newStart
)
if
(
diagnostics
_
&&
newStart
)
{
writeHeader
(
*
runfile
_
);
writeHeader
(
*
diagnostics
_
);
}
}
//! destructor
~
RunFile
()
~
Diagnostics
()
{
delete
runfile
_
;
delete
diagnostics
_
;
}
...
...
@@ -137,7 +137,7 @@ namespace Dune {
void
flush
()
const
{
// if write is > 0 then create speedup file
if
(
write
RunFile
_
)
if
(
write
Diagnostics
_
)
{
std
::
vector
<
double
>
times
(
times_
);
...
...
@@ -169,9 +169,9 @@ namespace Dune {
minTimes
[
i
]
/=
(
double
)
timesteps_
;
}
std
::
stringstream
runfile
;
runfile
<<
Fem
::
Parameter
::
commonOutputPath
()
<<
"/speedup."
<<
comm_
.
size
();
std
::
ofstream
file
(
runfile
.
str
().
c_str
()
);
std
::
stringstream
diagnostics
;
diagnostics
<<
Fem
::
Parameter
::
commonOutputPath
()
<<
"/speedup."
<<
comm_
.
size
();
std
::
ofstream
file
(
diagnostics
.
str
().
c_str
()
);
if
(
file
)
{
const
double
averageElements
=
sumTimes
[
size
-
1
]
/
tasks
;
...
...
@@ -242,9 +242,9 @@ namespace Dune {
}
}
// end speedup file
if
(
runfile
_
)
if
(
diagnostics
_
)
{
std
::
stringstream
*
str
=
dynamic_cast
<
std
::
stringstream
*
>
(
runfile
_
);
std
::
stringstream
*
str
=
dynamic_cast
<
std
::
stringstream
*
>
(
diagnostics
_
);
if
(
str
)
{
std
::
ofstream
file
(
runFileName_
.
c_str
()
);
...
...
@@ -295,7 +295,7 @@ namespace Dune {
const
size_t
nElements
,
const
std
::
vector
<
double
>&
times
)
{
if
(
write
RunFile
_
)
if
(
write
Diagnostics
_
)
{
const
size_t
size
=
times
.
size
()
;
const
size_t
oldsize
=
times_
.
size
();
...
...
@@ -314,18 +314,18 @@ namespace Dune {
++
timesteps_
;
if
(
runfile
_
)
if
(
diagnostics
_
)
{
std
::
ostream
&
runfile
=
(
*
runfile
_
);
std
::
ostream
&
diagnostics
=
(
*
diagnostics
_
);
const
int
space
=
12
;
runfile
<<
std
::
scientific
<<
t
<<
" "
;
runfile
<<
std
::
setw
(
space
)
<<
ldt
<<
" "
;
runfile
<<
std
::
setw
(
space
)
<<
nElements
<<
" "
;
diagnostics
<<
std
::
scientific
<<
t
<<
" "
;
diagnostics
<<
std
::
setw
(
space
)
<<
ldt
<<
" "
;
diagnostics
<<
std
::
setw
(
space
)
<<
nElements
<<
" "
;
for
(
size_t
i
=
0
;
i
<
size
;
++
i
)
runfile
<<
std
::
setw
(
space
)
<<
inMS
(
times
[
i
]
)
<<
" "
;
runfile
<<
std
::
endl
;
diagnostics
<<
std
::
setw
(
space
)
<<
inMS
(
times
[
i
]
)
<<
" "
;
diagnostics
<<
std
::
endl
;
runfile
.
flush
();
diagnostics
.
flush
();
}
}
}
...
...
@@ -369,7 +369,7 @@ namespace Dune {
stream
>>
times_
[
i
];
}
}
};
// end class
runfile
};
// end class
diagnostics
}
// end namespace Dune
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment