File: PetscLogEventRegister.html

package info (click to toggle)
petsc 3.2.dfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 124,660 kB
  • sloc: ansic: 342,250; cpp: 62,975; python: 32,761; fortran: 17,337; makefile: 15,867; xml: 621; objc: 594; sh: 492; java: 381; f90: 347; csh: 245
file content (87 lines) | stat: -rw-r--r-- 5,600 bytes parent folder | download
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>PetscLogEventRegister</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<A NAME="PetscLogEventRegister"><H1>PetscLogEventRegister</H1></A>
Registers an event name for logging operations in an application code.  
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscsys.h"   
PetscErrorCode  PetscLogEventRegister(const char name[],PetscClassId classid,PetscLogEvent *event)
</PRE>
Not Collective
<P>
<H3><FONT COLOR="#CC3333">Input Parameter</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>name   </B></TD><TD>- The name associated with the event
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>classid </B></TD><TD>- The classid associated to the class for this event, obtain either with
<A HREF="../Profiling/PetscClassIdRegister.html#PetscClassIdRegister">PetscClassIdRegister</A>() or use a predefined one such as KSP_CLASSID, SNES_CLASSID, the predefined ones 
are only available in C code
</TD></TR></TABLE>
<H3><FONT COLOR="#CC3333">Output Parameter</FONT></H3>
<DT><B>event </B> -The event id for use with <A HREF="../Profiling/PetscLogEventBegin.html#PetscLogEventBegin">PetscLogEventBegin</A>() and <A HREF="../Profiling/PetscLogEventEnd.html#PetscLogEventEnd">PetscLogEventEnd</A>().
<br>
<P>
<H3><FONT COLOR="#CC3333">Example of Usage</FONT></H3>
<PRE>
      <A HREF="../Profiling/PetscLogEvent.html#PetscLogEvent">PetscLogEvent</A> USER_EVENT;
      <A HREF="../Sys/PetscClassId.html#PetscClassId">PetscClassId</A> classid;
      PetscLogDouble user_event_flops;
      <A HREF="../Profiling/PetscClassIdRegister.html#PetscClassIdRegister">PetscClassIdRegister</A>("class name",&amp;classid);
      <A HREF="../Profiling/PetscLogEventRegister.html#PetscLogEventRegister">PetscLogEventRegister</A>("User event name",classid,&amp;USER_EVENT);
      <A HREF="../Profiling/PetscLogEventBegin.html#PetscLogEventBegin">PetscLogEventBegin</A>(USER_EVENT,0,0,0,0);
         [code segment to monitor]
         <A HREF="../Profiling/PetscLogFlops.html#PetscLogFlops">PetscLogFlops</A>(user_event_flops);
      <A HREF="../Profiling/PetscLogEventEnd.html#PetscLogEventEnd">PetscLogEventEnd</A>(USER_EVENT,0,0,0,0);
</PRE>

<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
PETSc automatically logs library events if the code has been
compiled with -DPETSC_USE_LOG (which is the default) and -log,
-log_summary, or -log_all are specified.  <A HREF="../Profiling/PetscLogEventRegister.html#PetscLogEventRegister">PetscLogEventRegister</A>() is
intended for logging user events to supplement this PETSc
information.
<P>
PETSc can gather data for use with the utilities Upshot/Nupshot
(part of the MPICH distribution).  If PETSc has been compiled
with flag -DPETSC_HAVE_MPE (MPE is an additional utility within
MPICH), the user can employ another command line option, -log_mpe,
to create a logfile, "mpe.log", which can be visualized
Upshot/Nupshot.
<P>
The classid is associated with each event so that classes of events
can be disabled simultaneously, such as all matrix events. The user
can either use an existing classid, such as MAT_CLASSID, or create
their own as shown in the example.
<P>

<P>
<H3><FONT COLOR="#CC3333">Keywords</FONT></H3>
 log, event, register
<BR>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
 <A HREF="../Profiling/PetscLogEventBegin.html#PetscLogEventBegin">PetscLogEventBegin</A>(), <A HREF="../Profiling/PetscLogEventEnd.html#PetscLogEventEnd">PetscLogEventEnd</A>(), <A HREF="../Profiling/PetscLogFlops.html#PetscLogFlops">PetscLogFlops</A>(),
<BR>PetscLogEventMPEActivate(), PetscLogEventMPEDeactivate(),
<A HREF="../Profiling/PetscLogEventActivate.html#PetscLogEventActivate">PetscLogEventActivate</A>(), <A HREF="../Profiling/PetscLogEventDeactivate.html#PetscLogEventDeactivate">PetscLogEventDeactivate</A>(), <A HREF="../Profiling/PetscClassIdRegister.html#PetscClassIdRegister">PetscClassIdRegister</A>()
<P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>intermediate
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../src/sys/plog/plog.c.html#PetscLogEventRegister">src/sys/plog/plog.c</A>
<BR><A HREF="./index.html">Index of all Profiling routines</A>
<BR><A HREF="../../index.html">Table of Contents for all manual pages</A>
<BR><A HREF="../singleindex.html">Index of all manual pages</A>
<P><H3><FONT COLOR="#CC3333">Examples</FONT></H3>
<A HREF="../../../src/sys/random/examples/tutorials/ex1.c.html">src/sys/random/examples/tutorials/ex1.c.html</A><BR>
<A HREF="../../../src/sys/examples/tutorials/ex3.c.html">src/sys/examples/tutorials/ex3.c.html</A><BR>
<A HREF="../../../src/sys/examples/tutorials/ex3f.F.html">src/sys/examples/tutorials/ex3f.F.html</A><BR>
<A HREF="../../../src/vec/vec/examples/tutorials/ex5.c.html">src/vec/vec/examples/tutorials/ex5.c.html</A><BR>
<A HREF="../../../src/vec/vec/examples/tutorials/ex10.c.html">src/vec/vec/examples/tutorials/ex10.c.html</A><BR>
<A HREF="../../../src/vec/vec/examples/tutorials/ex15.c.html">src/vec/vec/examples/tutorials/ex15.c.html</A><BR>
<A HREF="../../../src/dm/ao/examples/tutorials/ex2.c.html">src/dm/ao/examples/tutorials/ex2.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex4.c.html">src/ksp/ksp/examples/tutorials/ex4.c.html</A><BR>
<A HREF="../../../src/ksp/ksp/examples/tutorials/ex9.c.html">src/ksp/ksp/examples/tutorials/ex9.c.html</A><BR>
<A HREF="../../../src/snes/examples/tutorials/ex54.c.html">src/snes/examples/tutorials/ex54.c.html</A><BR>
</BODY></HTML>