xref: /petsc/include/petsclog.h (revision e1311b9049e89cb3452dcd306fde571f4b440ff2)
1 /* $Id: petsclog.h,v 1.118 1998/03/24 20:38:54 balay Exp balay $ */
2 
3 /*
4     Defines profile/logging in PETSc.
5 */
6 
7 #if !defined(__PLOG_PACKAGE)
8 #define __PLOG_PACKAGE
9 #include "petsc.h"
10 
11 /*
12   Lists all PETSc events that are logged/profiled.
13 
14   If you add an event here, make sure you add it to
15   petsc/bin/petscview.cfg,
16   petsc/bin/petscview,
17   petsc/src/plog/src/plog.c,
18   petsc/src/plog/src/plogmpe.c, and
19   petsc/include/FINCLUDE/petsclog.h!!!
20 */
21 #define MAT_Mult                                0
22 #define MAT_MatrixFreeMult                      1
23 #define MAT_AssemblyBegin                       2
24 #define MAT_AssemblyEnd                         3
25 #define MAT_GetReordering                       4
26 #define MAT_MultTrans                           5
27 #define MAT_MultAdd                             6
28 #define MAT_MultTransAdd                        7
29 #define MAT_LUFactor                            8
30 #define MAT_CholeskyFactor                      9
31 #define MAT_LUFactorSymbolic                    10
32 #define MAT_ILUFactorSymbolic                   11
33 #define MAT_CholeskyFactorSymbolic              12
34 #define MAT_IncompleteCholeskyFactorSymbolic    13
35 #define MAT_LUFactorNumeric                     14
36 #define MAT_CholeskyFactorNumeric               15
37 #define MAT_Relax                               16
38 #define MAT_Copy                                17
39 #define MAT_Convert                             18
40 #define MAT_Scale                               19
41 #define MAT_ZeroEntries                         20
42 #define MAT_Solve                               21
43 #define MAT_SolveAdd                            22
44 #define MAT_SolveTrans                          23
45 #define MAT_SolveTransAdd                       24
46 #define MAT_SetValues                           25
47 #define MAT_ForwardSolve                        26
48 #define MAT_BackwardSolve                       27
49 #define MAT_Load                                28
50 #define MAT_View                                29
51 #define MAT_ILUFactor                           30
52 #define MAT_GetColoring                         31
53 #define MAT_GetSubMatrices                      32
54 #define MAT_GetValues                           33
55 #define MAT_IncreaseOverlap                     34
56 #define MAT_GetRow                              35
57 #define MAT_Partitioning                        36
58 
59 #define VEC_ScatterBarrier                      39
60 #define VEC_Dot                                 40
61 #define VEC_Norm                                41
62 #define VEC_Max                                 42
63 #define VEC_Min                                 43
64 #define VEC_TDot                                44
65 #define VEC_Scale                               45
66 #define VEC_Copy                                46
67 #define VEC_Set                                 47
68 #define VEC_AXPY                                48
69 #define VEC_AYPX                                49
70 #define VEC_Swap                                50
71 #define VEC_WAXPY                               51
72 #define VEC_AssemblyBegin                       52
73 #define VEC_AssemblyEnd                         53
74 #define VEC_MTDot                               54
75 #define VEC_MDot                                55
76 #define VEC_MAXPY                               56
77 #define VEC_PMult                               57
78 #define VEC_SetValues                           58
79 #define VEC_Load                                59
80 #define VEC_View                                60
81 #define VEC_ScatterBegin                        61
82 #define VEC_ScatterEnd                          62
83 #define VEC_SetRandom                           63
84 
85 #define VEC_NormBarrier                         64
86 #define VEC_NormComm                            65
87 #define VEC_DotBarrier                          66
88 #define VEC_DotComm                             67
89 #define VEC_MDotBarrier                         68
90 #define VEC_MDotComm                            69
91 
92 #define SLES_Solve                              70
93 #define SLES_SetUp                              71
94 
95 #define KSP_GMRESOrthogonalization              72
96 
97 #define PC_ModifySubMatrices                    74
98 #define PC_SetUp                                75
99 #define PC_SetUpOnBlocks                        76
100 #define PC_Apply                                77
101 #define PC_ApplySymmetricLeft                   78
102 #define PC_ApplySymmetricRight                  79
103 
104 #define SNES_Solve                              80
105 #define SNES_LineSearch                         81
106 #define SNES_FunctionEval                       82
107 #define SNES_JacobianEval                       83
108 #define SNES_MinimizationFunctionEval           84
109 #define SNES_GradientEval                       85
110 #define SNES_HessianEval                        86
111 
112 #define TS_Step                                 90
113 #define TS_PseudoComputeTimeStep                91
114 
115 #define Petsc_Barrier                           100
116 
117 #define EC_SetUp                                105
118 #define EC_Solve                                106
119 
120 #define DFVec_RefineVector                      110
121 #define DFVec_AssembleFullVector                111
122 #define DFVec_GetComponentVectors               112
123 #define DFVec_DrawContours                      113
124 
125 /*
126    Event numbers PLOG_USER_EVENT_LOW to PLOG_USER_EVENT_HIGH are reserved
127    for applications.  Make sure that src/plog/src/plog.c defines enough
128    entries in (*name)[] to go up to PLOG_USER_EVENT_HIGH.
129 */
130 #define PLOG_USER_EVENT_LOW_STATIC              120
131 #define PLOG_USER_EVENT_HIGH                    200
132 
133 /* Global flop counter */
134 extern PLogDouble _TotalFlops;
135 
136 /* General logging of information; different from event logging */
137 extern int PLogInfo(void*,char*,...);
138 extern int PLogInfoDeactivateClass(int);
139 extern int PLogInfoActivateClass(int);
140 extern int PLogPrintInfo;  /* if 1, indicates PLogInfo() is turned on */
141 
142 #if defined(USE_PETSC_LOG)  /* --- Logging is turned on --------------------------------*/
143 
144 /*
145    Flop counting:  We count each arithmetic operation (e.g., addition, multiplication) separately.
146 
147    For the complex numbers version, note that
148        1 complex addition = 2 flops
149        1 complex multiplication = 6 flops,
150    where we define 1 flop as that for a double precision scalar.  We roughly approximate
151    flop counting for complex numbers by multiplying the total flops by 4; this corresponds
152    to the assumption that we're counting mostly additions and multiplications -- and
153    roughly the same number of each.  More accurate counting could be done by distinguishing
154    among the various arithmetic operations.
155  */
156 
157 #if defined(USE_PETSC_COMPLEX)
158 #define PLogFlops(n) {_TotalFlops += (4*n);}
159 #else
160 #define PLogFlops(n) {_TotalFlops += (n);}
161 #endif
162 
163 #if defined (HAVE_MPE)
164 #include "mpe.h"
165 #define MPEBEGIN    1000
166 extern int PLogMPEBegin(void);
167 extern int PLogMPEDump(char *);
168 extern int UseMPE,PLogEventMPEFlags[];
169 extern int PLogEventMPEActivate(int);
170 extern int PLogEventMPEDeactivate(int);
171 #else
172 #define PLogEventMPEActivate(a) 0
173 #define PLogEventMPEDeactivate(a) 0
174 #endif
175 
176 extern int PLogEventActivate(int);
177 extern int PLogEventDeactivate(int);
178 
179 extern int PLogEventActivateClass(int);
180 extern int PLogEventDeactivateClass(int);
181 
182 extern int PLogEventFlags[];
183 extern int (*_PLogPLB)(int,int,PetscObject,PetscObject,PetscObject,PetscObject);
184 extern int (*_PLogPLE)(int,int,PetscObject,PetscObject,PetscObject,PetscObject);
185 extern int (*_PLogPHC)(PetscObject);
186 extern int (*_PLogPHD)(PetscObject);
187 
188 #if defined(HAVE_MPE)
189 #define PLogEventBarrierBegin(e,o1,o2,o3,o4,cm) \
190   { \
191     if (_PLogPLB && PLogEventFlags[e]) {                           \
192       PLogEventBegin((e),o1,o2,o3,o4);                                   \
193       if (UseMPE && PLogEventMPEFlags[(e)])\
194         MPE_Log_event(MPEBEGIN+2*(e),0,"");\
195       MPI_Barrier(cm);                                             \
196       PLogEventEnd((e),o1,o2,o3,o4);                                     \
197       if (UseMPE && PLogEventMPEFlags[(e)])\
198         MPE_Log_event(MPEBEGIN+2*((e)+1),0,"");\
199     }                                                                \
200     PLogEventBegin(e+1,o1,o2,o3,o4);                                   \
201     if (UseMPE && PLogEventMPEFlags[(e)+1])\
202       MPE_Log_event(MPEBEGIN+2*((e)+1),0,"");\
203   }
204 #define PLogEventBegin(e,o1,o2,o3,o4)  \
205   {  \
206    if (_PLogPLB && PLogEventFlags[(e)]) \
207      (*_PLogPLB)((e),0,(PetscObject)(o1),(PetscObject)(o2),(PetscObject)(o3),(PetscObject)(o4));\
208    if (UseMPE && PLogEventMPEFlags[(e)])\
209      MPE_Log_event(MPEBEGIN+2*(e),0,"");\
210   }
211 #else
212 #define PLogEventBarrierBegin(e,o1,o2,o3,o4,cm) \
213   { \
214     if (_PLogPLB && PLogEventFlags[(e)]) {                           \
215       PLogEventBegin((e),o1,o2,o3,o4);                                   \
216       MPI_Barrier(cm);                                             \
217       PLogEventEnd((e),o1,o2,o3,o4);                                     \
218     }                                                                \
219     PLogEventBegin((e)+1,o1,o2,o3,o4);                                   \
220   }
221 #define PLogEventBegin(e,o1,o2,o3,o4)  \
222   {  \
223    if (_PLogPLB && PLogEventFlags[(e)]) \
224      (*_PLogPLB)((e),0,(PetscObject)(o1),(PetscObject)(o2),(PetscObject)(o3),(PetscObject)(o4));\
225   }
226 #endif
227 
228 #if defined(HAVE_MPE)
229 #define PLogEventBarrierEnd(e,o1,o2,o3,o4,cm) {\
230   if (_PLogPLE && PLogEventFlags[(e)+1]) \
231     (*_PLogPLE)((e)+1,0,(PetscObject)(o1),(PetscObject)(o2),(PetscObject)(o3),(PetscObject)(o4));\
232   if (UseMPE && PLogEventMPEFlags[(e)+1])\
233      MPE_Log_event(MPEBEGIN+2*((e)+1)+1,0,"");\
234   }
235 #define PLogEventEnd(e,o1,o2,o3,o4) {\
236   if (_PLogPLE && PLogEventFlags[(e)]) \
237     (*_PLogPLE)((e),0,(PetscObject)(o1),(PetscObject)(o2),(PetscObject)(o3),(PetscObject)(o4));\
238   if (UseMPE && PLogEventMPEFlags[(e)])\
239      MPE_Log_event(MPEBEGIN+2*(e)+1,0,"");\
240   }
241 #else
242 #define PLogEventBarrierEnd(e,o1,o2,o3,o4,cm) {\
243   if (_PLogPLE && PLogEventFlags[(e)+1]) \
244     (*_PLogPLE)((e)+1,0,(PetscObject)(o1),(PetscObject)(o2),(PetscObject)(o3),(PetscObject)(o4));\
245   }
246 #define PLogEventEnd(e,o1,o2,o3,o4) {\
247   if (_PLogPLE && PLogEventFlags[(e)]) \
248     (*_PLogPLE)((e),0,(PetscObject)(o1),(PetscObject)(o2),(PetscObject)(o3),(PetscObject)(o4));\
249   }
250 #endif
251 
252 
253 #define PLogObjectParent(p,c)       if (c) {PetscValidHeader((PetscObject)(c)); \
254                                      PetscValidHeader((PetscObject)(p));\
255                                      ((PetscObject)(c))->parent = (PetscObject) (p);}
256 #define PLogObjectParents(p,n,d)    {int _i; for ( _i=0; _i<n; _i++ ) \
257                                     PLogObjectParent(p,(d)[_i]);}
258 #define PLogObjectCreate(h)         {if (_PLogPHC) (*_PLogPHC)((PetscObject)h);}
259 #define PLogObjectDestroy(h)        {if (_PLogPHD) (*_PLogPHD)((PetscObject)h);}
260 #define PLogObjectMemory(p,m)       {PetscValidHeader((PetscObject)p);\
261                                     ((PetscObject)(p))->mem += (m);}
262 extern int  PLogObjectState(PetscObject,char *,...);
263 extern int  PLogDestroy(void);
264 extern int  PLogStagePush(int);
265 extern int  PLogStagePop(void);
266 extern int  PLogStageRegister(int,char*);
267 extern int  PLogPrintSummary(MPI_Comm,char *);
268 extern int  PLogBegin(void);
269 extern int  PLogTraceBegin(FILE *);
270 extern int  PLogAllBegin(void);
271 extern int  PLogSet(int (*)(int,int,PetscObject,PetscObject,PetscObject,PetscObject),
272                     int (*)(int,int,PetscObject,PetscObject,PetscObject,PetscObject));
273 extern int  PLogDump(char*);
274 extern int  PLogEventRegister(int*,char*,char*);
275 extern int  PetscGetFlops(PLogDouble*);
276 
277 extern PLogDouble irecv_ct, isend_ct, wait_ct, wait_any_ct, recv_ct, send_ct;
278 extern PLogDouble irecv_len, isend_len, recv_len, send_len;
279 extern PLogDouble wait_all_ct,allreduce_ct,sum_of_waits_ct;
280 extern int        PETSC_DUMMY,PETSC_DUMMY_SIZE;
281 
282 /*
283      This does not work for MPI-Uni because our src/mpiuni/mpi.h file
284    uses macros to defined the MPI operations.
285 
286      It does not work correctly from HP-UX because it processes the
287    macros in a way that sometimes it double counts.
288 
289      It does not work with Windows NT because winmpich lacks MPI_Type_size()
290 */
291 #if !defined(PETSC_USING_MPIUNI) && !defined(PARCH_hpux) && !defined (PARCH_nt)
292 /*
293    Logging of MPI activities
294 */
295 
296 #define TypeSize(buff,count,type)                                                \
297 (                                                                                \
298   MPI_Type_size(type,&PETSC_DUMMY_SIZE), buff += ((PLogDouble) ((count)*PETSC_DUMMY_SIZE)) \
299 )
300 
301 #define MPI_Irecv( buf, count,  datatype, source, tag, comm, request)        \
302 (                                                                            \
303   PETSC_DUMMY = MPI_Irecv( buf, count,  datatype, source, tag, comm, request),             \
304   irecv_ct++, TypeSize(irecv_len,count,datatype),PETSC_DUMMY                            \
305 )
306 
307 #define MPI_Isend( buf, count,  datatype, dest, tag, comm, request)          \
308 (                                                                            \
309   PETSC_DUMMY = MPI_Isend( buf, count,  datatype, dest, tag, comm, request),               \
310   isend_ct++,   TypeSize(isend_len,count,datatype),PETSC_DUMMY                          \
311 )
312 
313 #define MPI_Startall_irecv( count,number,requests)                                     \
314 (                                                                                      \
315   PETSC_DUMMY = MPI_Startall( number, requests),                                                     \
316   irecv_ct += (PLogDouble)(number), irecv_len += ((PLogDouble) (count*sizeof(Scalar))),PETSC_DUMMY \
317 )
318 
319 #define MPI_Startall_isend( count,number,requests)                                    \
320 (                                                                                     \
321   PETSC_DUMMY = MPI_Startall( number, requests),                                                    \
322   isend_ct += (PLogDouble)(number), isend_len += ((PLogDouble) (count*sizeof(Scalar))),PETSC_DUMMY \
323 )
324 
325 #define MPI_Start_isend(count,  requests)\
326 (\
327   PETSC_DUMMY = MPI_Start( requests),\
328   isend_ct++, isend_len += ((PLogDouble) (count*sizeof(Scalar))),PETSC_DUMMY\
329 )
330 
331 #define MPI_Recv( buf, count,  datatype, source, tag, comm, status)           \
332 (                                                                            \
333   PETSC_DUMMY = MPI_Recv( buf, count,  datatype, source, tag, comm, status),                \
334   recv_ct++, TypeSize(recv_len,count,datatype), PETSC_DUMMY                              \
335 )
336 
337 #define MPI_Send( buf, count,  datatype, dest, tag, comm)                     \
338 (                                                                             \
339   PETSC_DUMMY = MPI_Send( buf, count,  datatype, dest, tag, comm),                          \
340   send_ct++,  TypeSize(send_len,count,datatype),PETSC_DUMMY                              \
341 )
342 
343 #define MPI_Wait(request, status) \
344 (                                 \
345   wait_ct++, sum_of_waits_ct++,   \
346   MPI_Wait(request, status)       \
347 )
348 
349 #define MPI_Waitany(a, b, c, d)     \
350 (                                   \
351   wait_any_ct++, sum_of_waits_ct++, \
352   MPI_Waitany(a, b, c, d)           \
353 )
354 
355 #define MPI_Waitall(count, array_of_requests, array_of_statuses) \
356 (                                                                \
357   wait_all_ct++, sum_of_waits_ct += (PLogDouble) (count),        \
358   MPI_Waitall(count, array_of_requests, array_of_statuses)       \
359 )
360 
361 #define MPI_Allreduce( sendbuf,  recvbuf, count, datatype, op, comm) \
362     (allreduce_ct++,MPI_Allreduce( sendbuf,  recvbuf, count, datatype, op, comm))
363 
364 #else
365 
366 #define MPI_Startall_irecv( count,number,requests) \
367 (                                                  \
368   MPI_Startall( number, requests)                 \
369 )
370 
371 #define MPI_Startall_isend( count,number,requests) \
372 (                                                  \
373   MPI_Startall( number, requests)                 \
374 )
375 
376 #define MPI_Start_isend(count,  requests) \
377 (                                         \
378   MPI_Start( requests)                   \
379 )
380 
381 #endif /* ! PETSC_USING_MPIUNI && ! PARCH_hpux */
382 
383 #else  /* ---Logging is turned off --------------------------------------------*/
384 
385 #define PLogFlops(n)
386 
387 /*
388      With logging turned off, then MPE has to be turned off
389 */
390 #define MPEBEGIN                  1000
391 #define PLogMPEBegin()
392 #define PLogMPEDump(a)
393 #define PLogEventMPEActivate(a)   0
394 #define PLogEventMPEDeactivate(a) 0
395 
396 #define PLogEventActivate(a)   0
397 #define PLogEventDeactivate(a) 0
398 
399 #define PLogEventActivateClass(a)   0
400 #define PLogEventDeactivateClass(a) 0
401 
402 #define _PLogPLB                        0
403 #define _PLogPLE                        0
404 #define _PLogPHC                        0
405 #define _PLogPHD                        0
406 #define PetscGetFlops(a)                (*(a) = 0.0,0)
407 #define PLogEventBegin(e,o1,o2,o3,o4)
408 #define PLogEventEnd(e,o1,o2,o3,o4)
409 #define PLogEventBarrierBegin(e,o1,o2,o3,o4,cm)
410 #define PLogEventBarrierEnd(e,o1,o2,o3,o4,cm)
411 #define PLogObjectParent(p,c)
412 #define PLogObjectParents(p,n,c)
413 #define PLogObjectCreate(h)
414 #define PLogObjectDestroy(h)
415 #define PLogObjectMemory(p,m)
416 #define PLogDestroy()
417 #define PLogStagePush(a)
418 #define PLogStagePop()
419 #define PLogStageRegister(a,b)
420 #define PLogPrintSummary(comm,file)
421 #define PLogBegin()
422 #define PLogTraceBegin(file)            0
423 #define PLogSet(lb,le)
424 #define PLogAllBegin()
425 #define PLogDump(char)
426 #define PLogEventRegister(a,b,c)        0
427 #define PLogMPEBegin()
428 #define PLogMPEDump(a)
429 extern int PLogObjectState(PetscObject,char *,...);
430 
431 /* If USE_PETSC_LOG is NOT defined, these still need to be! */
432 #define MPI_Startall_irecv( count,number,requests) MPI_Startall( number, requests)
433 
434 #define MPI_Startall_isend( count,number,requests) MPI_Startall( number, requests)
435 
436 #define MPI_Start_isend(count,  requests) MPI_Start( requests)
437 
438 #endif   /* USE_PETSC_LOG */
439 
440 /*MC
441    PLogFlops - Adds floating point operations to the global counter.
442 
443    Input Parameter:
444 .  f - flop counter
445 
446    Synopsis:
447    void PLogFlops(int f)
448 
449    Notes:
450    A global counter logs all PETSc flop counts.  The user can use
451    PLogFlops() to increment this counter to include flops for the
452    application code.
453 
454    PETSc automatically logs library events if the code has been
455    compiled with -DUSE_PETSC_LOG (which is the default), and -log,
456    -log_summary, or -log_all are specified.  PLogFlops() is
457    intended for logging user flops to supplement this PETSc
458    information.
459 
460     Example of Usage:
461 $     int USER_EVENT;
462 $     PLogEventRegister(&USER_EVENT,"User event","Color:");
463 $     PLogEventBegin(USER_EVENT,0,0,0,0);
464 $        [code segment to monitor]
465 $        PLogFlops(user_flops)
466 $     PLogEventEnd(USER_EVENT,0,0,0,0);
467 
468 .seealso: PLogEventRegister(), PLogEventBegin(), PLogEventEnd(), PetscGetFlops()
469 
470 .keywords: log, flops, floating point operations
471 M*/
472 
473 
474 /*MC
475    PLogEventBegin - Logs the beginning of a user event.
476 
477    Input Parameters:
478 .  e - integer associated with the event obtained from PLogEventRegister()
479 .  o1,o2,o3,o4 - objects associated with the event, or 0
480 
481    Synopsis:
482    void PLogEventBegin(int e,PetscObject o1,PetscObject o2,PetscObject o3,
483                   PetscObject o4)
484 
485    Notes:
486    You should also register each integer event with the command
487    PLogRegisterEvent().  The source code must be compiled with
488    -DUSE_PETSC_LOG, which is the default.
489 
490    PETSc automatically logs library events if the code has been
491    compiled with -DUSE_PETSC_LOG, and -log, -log_summary, or -log_all are
492    specified.  PLogEventBegin() is intended for logging user events
493    to supplement this PETSc information.
494 
495     Example of Usage:
496 $     int USER_EVENT;
497 $     int user_event_flops;
498 $     PLogEventRegister(&USER_EVENT,"User event","Color:");
499 $     PLogEventBegin(&USER_EVENT,0,0,0,0);
500 $        [code segment to monitor]
501 $        PLogFlops(user_event_flops);
502 $     PLogEventEnd(&USER_EVENT,0,0,0,0);
503 
504 .seealso: PLogEventRegister(), PLogEventEnd(), PLogFlops()
505 
506 .keywords: log, event, begin
507 M*/
508 
509 /*MC
510    PLogEventEnd - Log the end of a user event.
511 
512    Input Parameters:
513 .  e - integer associated with the event obtained with PLogEventRegister()
514 .  o1,o2,o3,o4 - objects associated with the event, or 0
515 
516    Synopsis:
517    void PLogEventEnd(int e,PetscObject o1,PetscObject o2,PetscObject o3,
518                 PetscObject o4)
519 
520    Notes:
521    You should also register each additional integer event with the command
522    PLogRegisterEvent(). Source code must be compiled with
523    -DUSE_PETSC_LOG, which is the default.
524 
525    PETSc automatically logs library events if the code has been
526    compiled with -DUSE_PETSC_LOG, and -log, -log_summary, or -log_all are
527    specified.  PLogEventEnd() is intended for logging user events
528    to supplement this PETSc information.
529 
530     Example of Usage:
531 $     int USER_EVENT;
532 $     int user_event_flops;
533 $     PLogEventRegister(&USER_EVENT,"User event","Color:");
534 $     PLogEventBegin(USER_EVENT,0,0,0,0);
535 $        [code segment to monitor]
536 $        PLogFlops(user_event_flops);
537 $     PLogEventEnd(USER_EVENT,0,0,0,0);
538 
539 .seealso: PLogEventRegister(), PLogEventBegin(), PLogFlops()
540 
541 .keywords: log, event, end
542 M*/
543 
544 /*MC
545    PLogEventBarrierBegin - Logs the time in a barrier before an event.
546 
547    Input Parameters:
548 .  e - integer associated with the event obtained from PLogEventRegister()
549 .  o1,o2,o3,o4 - objects associated with the event, or 0
550 .  comm - communicator the barrier takes place over
551 
552    Synopsis:
553    void PLogEventBarrierBegin(int e,PetscObject o1,PetscObject o2,PetscObject o3,
554                   PetscObject o4,MPI_Comm comm)
555 
556    Notes:
557    This is for logging the amount of time spent in a barrier for an event
558    that requires synchronization.
559 
560     Example of Usage:
561 $     PLogEventBarrierBegin(VEC_NormBarrier,0,0,0,0,comm);
562 $       MPI_Allreduce()
563 $     PLogEventBarrierEnd(VEC_NormBarrier,0,0,0,0,comm);
564 
565    Additional Notes:
566    Synchronization events always come in pairs; for example, VEC_NormBarrier and
567    VEC_NormComm = VEC_NormBarrier + 1
568 
569 .seealso: PLogEventRegister(), PLogEventEnd(), PLogFlops(), PLogEventBegin(),
570           PLogEventBarrierEnd()
571 
572 .keywords: log, event, begin, barrier
573 M*/
574 
575 /*MC
576    PLogEventBarrierEnd - Logs the time in a barrier before an event.
577 
578    Input Parameters:
579 .  e - integer associated with the event obtained from PLogEventRegister()
580 .  o1,o2,o3,o4 - objects associated with the event, or 0
581 .  comm - communicator the barrier takes place over
582 
583    Synopsis:
584    void PLogEventBarrierEnd(int e,PetscObject o1,PetscObject o2,PetscObject o3,
585                   PetscObject o4,MPI_Comm comm)
586 
587    Notes:
588    This is for logging the amount of time spent in a barrier for an event
589    that requires synchronization.
590 
591     Example of Usage:
592 $     PLogEventBarrierBegin(VEC_NormBarrier,0,0,0,0,comm);
593 $       MPI_Allreduce()
594 $     PLogEventBarrierEnd(VEC_NormBarrier,0,0,0,0,comm);
595 
596    Additional Notes:
597    Synchronization events always come in pairs; for example, VEC_NormBarrier and
598    VEC_NormComm = VEC_NormBarrier + 1
599 
600 .seealso: PLogEventRegister(), PLogEventEnd(), PLogFlops(), PLogEventBegin(),
601           PLogEventBarrierBegin()
602 
603 .keywords: log, event, begin, barrier
604 M*/
605 
606 #endif
607 
608 
609 
610 
611 
612 
613