Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
perfs.h
Go to the documentation of this file.
1
/** @file perfs.h
2
*/
3
/**
4
# Performance monitoring (for the layered solver)
5
6
This logs simple statistics available for the [layered
7
solver](/src/layered/hydro.h). */
8
9
/** @brief Event: perfs (i += 1) */
10
void
event_perfs
(
void
) {
11
static
FILE
*
fp
=
fopen
(
"perfs"
,
"w"
);
12
if
(
i
== 0)
13
fprintf
(
fp
,
14
"t dt mgp.i mgp.nrelax grid->tn perf.t perf.speed npe perf.ispeed\n"
);
15
static
double
start = 0.;
16
if
(
i
> 10 &&
perf
.t - start < 1.)
return
0;
17
fprintf
(
fp
,
"%g %g %d %d %ld %g %g %d %g\n"
,
18
t
,
dt
,
19
#
if
NH
20
mgp
.
i
,
mgp
.
nrelax
,
21
#
elif
IMPLICIT_H
22
mgH
.
i
,
mgH
.
nrelax
,
23
#
else
24
0, 0,
25
#
endif
26
grid
->
tn
*
nl
,
perf
.t,
perf
.speed*
nl
,
npe
(),
perf
.ispeed*
nl
);
27
fflush
(
fp
);
28
start =
perf
.t;
29
}
30
31
/**
32
If we have a display (and gnuplot works), a graph of the statistics is
33
displayed and updated at regular intervals (10 seconds as defined in
34
[perfs.plot]()). */
35
36
/** @brief Event: perf_plot (i = 10) */
37
void
event_perf_plot
(
void
) {
38
if
(
getenv
(
"DISPLAY"
))
39
popen
(
"gnuplot -e 'set term x11 noraise title perfs' "
40
"\f$BASILISK/layered/perfs.plot 2> /dev/null "
41
"& read dummy; kill \f$! 2> /dev/null"
,
"w"
);
42
}
43
44
/**
45
## See also
46
47
* [Performance monitoring (for the Navier-Stokes
48
solvers)](/src/navier-stokes/perfs.h).
49
* [Continuous profiling monitoring](/src/profiling.h).
50
*/
mgp
mgstats mgp
Definition
all-mach.h:66
npe
int npe
Definition
balance.h:195
x
int x
Definition
common.h:76
grid
Grid * grid
Definition
common.h:32
popen
#define popen
Definition
config.h:666
dt
double dt
Definition
predictor-corrector.h:18
i
scalar int i
Definition
embed.h:74
t
double t
Definition
events.h:24
mgH
mgstats mgH
Definition
implicit.h:26
IMPLICIT_H
#define IMPLICIT_H
Definition
implicit.h:29
event_perf_plot
void event_perf_plot(void)
If we have a display (and gnuplot works), a graph of the statistics is displayed and updated at regul...
Definition
perfs.h:37
nl
int nl
Definition
layers.h:9
fp
FILE * fp
Definition
mtrace.h:7
event_perfs
void event_perfs(void)
Event: perfs (i += 1)
Definition
perfs.h:10
NH
#define NH
Definition
nh-staggered.h:10
Grid::tn
long tn
Definition
common.h:28
mgstats::nrelax
int nrelax
Definition
poisson.h:116
mgstats::i
int i
Definition
poisson.h:113
perf
struct @16 perf
Performance statistics are stored in this structure.
fflush
src vof fflush(ferr)
layered
perfs.h
Generated by
1.9.8