File: profiling.htm

package info (click to toggle)
evolver 2.70+ds-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 17,148 kB
  • sloc: ansic: 127,395; makefile: 209; sh: 98
file content (93 lines) | stat: -rw-r--r-- 3,401 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE HTML>
<HEAD><TITLE>Surface Evolver Documentation: Debugging </title>
<link rel="stylesheet" type="text/css" href="evdoc-style.css" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
</head>

<BODY>

<h1 class="center">
<a href="http://www.susqu.edu/brakke/evolver/evolver.htm" class="comic">
Surface Evolver</a> Documentation</h1>

<a href="evolver.htm#doc-top">Back to top of Surface Evolver documentation.</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="index.htm">Index.</a>


<hr><a   id="profiling"> </a>
<h2>Surface Evolver Execution Time Profiling</h2>

<hr>
<H3>Coarse Profiling</H3>
Coarse timing with resolution of 0,01 second or so can be done with
Evolver's <a href="syntax.htm#clock"><code>clock</code></a> variable. 
 For example, to time iterations I
typically do
<pre>

   Enter command: quiet; start := clock; g 100; print start-clock; quiet off
</pre>
which will print out the elapsed time in seconds.  I do 
<a href="toggle.htm#quiet"><code>quiet</code></a> here
to suppress output to the screen, which can slow down things considerably.
<p>
<hr>
<H3>Fine Profiling</h3>
Nanosecond resolution can be done with Evolver's 
<a href="syntax.htm#cpu_counter"><code>cpu_counter</code></a>
variable.

<p>
<hr>
<a   id="print-profiling"></a>
<a   id="reset_profiling"></a>
<H3>Expression Evaluation Profiling</h3>

On systems where Evolver has
<a href="syntax.htm#cpu_counter"><code>cpu_counter</code></a>
available and Evolver has been compiled with the manifest
constant PROF_EVALS defined, the expression evaluator
inside Evolver keeps track of the clock cycles elapsed
during each expression evaluation.  These expressions
include procedures, functions, constraint and boundary
formulas, content integrands, energy integrands, quantity
integrands, etc; everything that prints out as code in
a dump file.  The <a href="#print-profiling">
<code>print profiling</code></a> command will print the 
accumulated CPU cycles so far for each type of expression.
The times are inclusive of any child functions or procedures.
An example, from mound.fe after running "gogo":
<pre>
Enter command: print profiling
Inclusive profiling counts:
                      Name            CPU Cycles
                              re           1,952,792
                            gogo         125,201,889
                           gogo2                   0
                           gogo3                   0
                           gogo4                   0
                           gogo5                   0

Constraint expressions
                    Constraint  Formula Cycles   Energy Cycles  Content Cycles
                             1         877,047       2,337,727               0
</pre>
Note that hard-coded evaluations of area, volume, etc. do not show up here,
except for their effect on overall elapsed time.
<p>
The command <code>reset_profiling</code> will set all the cycle values back to 0.

<p>
<hr>
<h3>Execution sampling</h3>
Of course, if you are compiling Evolver yourself, you can use any
type of profiling you would ordinarily use on a C program.  i leave
you to your own devices on this.
<p>
<hr>
<a href="evolver.htm#doc-top">Back to top of Surface Evolver documentation.</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="index.htm">Index.</a>
</body>
</html>