File: | sys/logging/plog.c |
Warning: | line 1726, column 76 The left operand of '/' is a garbage value |
[?] Use j/k keys for keyboard navigation
1 | ||||
2 | /* | |||
3 | PETSc code to log object creation and destruction and PETSc events. | |||
4 | ||||
5 | This provides the public API used by the rest of PETSc and by users. | |||
6 | ||||
7 | These routines use a private API that is not used elsewhere in PETSc and is not | |||
8 | accessible to users. The private API is defined in logimpl.h and the utils directory. | |||
9 | ||||
10 | */ | |||
11 | #include <petsc/private/logimpl.h> /*I "petscsys.h" I*/ | |||
12 | #include <petsctime.h> | |||
13 | #include <petscviewer.h> | |||
14 | ||||
15 | PetscErrorCode PetscLogObjectParent(PetscObject p,PetscObject c) | |||
16 | { | |||
17 | if (!c || !p) return 0; | |||
18 | c->parent = p; | |||
19 | c->parentid = p->id; | |||
20 | return 0; | |||
21 | } | |||
22 | ||||
23 | /*@C | |||
24 | PetscLogObjectMemory - Adds to an object a count of additional amount of memory that is used by the object. | |||
25 | ||||
26 | Not collective. | |||
27 | ||||
28 | Input Parameters: | |||
29 | + obj - the PETSc object | |||
30 | - mem - the amount of memory that is being added to the object | |||
31 | ||||
32 | Level: developer | |||
33 | ||||
34 | Developer Notes: | |||
35 | Currently we do not always do a good job of associating all memory allocations with an object. | |||
36 | ||||
37 | .seealso: PetscFinalize(), PetscInitializeFortran(), PetscGetArgs(), PetscInitializeNoArguments() | |||
38 | ||||
39 | @*/ | |||
40 | PetscErrorCode PetscLogObjectMemory(PetscObject p,PetscLogDouble m) | |||
41 | { | |||
42 | if (!p) return 0; | |||
43 | p->mem += m; | |||
44 | return 0; | |||
45 | } | |||
46 | ||||
47 | PetscLogEvent PETSC_LARGEST_EVENT = PETSC_EVENT1311311; | |||
48 | ||||
49 | #if defined(PETSC_USE_LOG1) | |||
50 | #include <petscmachineinfo.h> | |||
51 | #include <petscconfiginfo.h> | |||
52 | ||||
53 | /* used in the MPI_XXX() count macros in petsclog.h */ | |||
54 | ||||
55 | /* Action and object logging variables */ | |||
56 | Action *petsc_actions = NULL((void*)0); | |||
57 | Object *petsc_objects = NULL((void*)0); | |||
58 | PetscBool petsc_logActions = PETSC_FALSE; | |||
59 | PetscBool petsc_logObjects = PETSC_FALSE; | |||
60 | int petsc_numActions = 0, petsc_maxActions = 100; | |||
61 | int petsc_numObjects = 0, petsc_maxObjects = 100; | |||
62 | int petsc_numObjectsDestroyed = 0; | |||
63 | ||||
64 | /* Global counters */ | |||
65 | PetscLogDouble petsc_BaseTime = 0.0; | |||
66 | PetscLogDouble petsc_TotalFlops = 0.0; /* The number of flops */ | |||
67 | PetscLogDouble petsc_tmp_flops = 0.0; /* The incremental number of flops */ | |||
68 | PetscLogDouble petsc_send_ct = 0.0; /* The number of sends */ | |||
69 | PetscLogDouble petsc_recv_ct = 0.0; /* The number of receives */ | |||
70 | PetscLogDouble petsc_send_len = 0.0; /* The total length of all sent messages */ | |||
71 | PetscLogDouble petsc_recv_len = 0.0; /* The total length of all received messages */ | |||
72 | PetscLogDouble petsc_isend_ct = 0.0; /* The number of immediate sends */ | |||
73 | PetscLogDouble petsc_irecv_ct = 0.0; /* The number of immediate receives */ | |||
74 | PetscLogDouble petsc_isend_len = 0.0; /* The total length of all immediate send messages */ | |||
75 | PetscLogDouble petsc_irecv_len = 0.0; /* The total length of all immediate receive messages */ | |||
76 | PetscLogDouble petsc_wait_ct = 0.0; /* The number of waits */ | |||
77 | PetscLogDouble petsc_wait_any_ct = 0.0; /* The number of anywaits */ | |||
78 | PetscLogDouble petsc_wait_all_ct = 0.0; /* The number of waitalls */ | |||
79 | PetscLogDouble petsc_sum_of_waits_ct = 0.0; /* The total number of waits */ | |||
80 | PetscLogDouble petsc_allreduce_ct = 0.0; /* The number of reductions */ | |||
81 | PetscLogDouble petsc_gather_ct = 0.0; /* The number of gathers and gathervs */ | |||
82 | PetscLogDouble petsc_scatter_ct = 0.0; /* The number of scatters and scattervs */ | |||
83 | #if defined(PETSC_HAVE_VIENNACL) || defined(PETSC_HAVE_CUDA) | |||
84 | PetscLogDouble petsc_ctog_ct = 0.0; /* The total number of CPU to GPU copies */ | |||
85 | PetscLogDouble petsc_gtoc_ct = 0.0; /* The total number of GPU to CPU copies */ | |||
86 | PetscLogDouble petsc_ctog_sz = 0.0; /* The total size of CPU to GPU copies */ | |||
87 | PetscLogDouble petsc_gtoc_sz = 0.0; /* The total size of GPU to CPU copies */ | |||
88 | #endif | |||
89 | ||||
90 | /* Logging functions */ | |||
91 | PetscErrorCode (*PetscLogPHC)(PetscObject) = NULL((void*)0); | |||
92 | PetscErrorCode (*PetscLogPHD)(PetscObject) = NULL((void*)0); | |||
93 | PetscErrorCode (*PetscLogPLB)(PetscLogEvent, int, PetscObject, PetscObject, PetscObject, PetscObject) = NULL((void*)0); | |||
94 | PetscErrorCode (*PetscLogPLE)(PetscLogEvent, int, PetscObject, PetscObject, PetscObject, PetscObject) = NULL((void*)0); | |||
95 | ||||
96 | /* Tracing event logging variables */ | |||
97 | FILE *petsc_tracefile = NULL((void*)0); | |||
98 | int petsc_tracelevel = 0; | |||
99 | const char *petsc_traceblanks = " "; | |||
100 | char petsc_tracespace[128] = " "; | |||
101 | PetscLogDouble petsc_tracetime = 0.0; | |||
102 | static PetscBool PetscLogInitializeCalled = PETSC_FALSE; | |||
103 | ||||
104 | PETSC_INTERNextern __attribute__((visibility ("hidden"))) PetscErrorCode PetscLogInitialize(void) | |||
105 | { | |||
106 | int stage; | |||
107 | PetscBool opt; | |||
108 | PetscErrorCode ierr; | |||
109 | ||||
110 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 110; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
111 | if (PetscLogInitializeCalled) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
112 | PetscLogInitializeCalled = PETSC_TRUE; | |||
113 | ||||
114 | ierr = PetscOptionsHasName(NULL((void*)0),NULL((void*)0), "-log_exclude_actions", &opt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),114,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
115 | if (opt) petsc_logActions = PETSC_FALSE; | |||
116 | ierr = PetscOptionsHasName(NULL((void*)0),NULL((void*)0), "-log_exclude_objects", &opt);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),116,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
117 | if (opt) petsc_logObjects = PETSC_FALSE; | |||
118 | if (petsc_logActions) { | |||
119 | ierr = PetscMalloc1(petsc_maxActions, &petsc_actions)PetscMallocA(1,PETSC_FALSE,119,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,(size_t)(petsc_maxActions)*sizeof(**(&petsc_actions)),(& petsc_actions));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),119,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
120 | } | |||
121 | if (petsc_logObjects) { | |||
122 | ierr = PetscMalloc1(petsc_maxObjects, &petsc_objects)PetscMallocA(1,PETSC_FALSE,122,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,(size_t)(petsc_maxObjects)*sizeof(**(&petsc_objects)),(& petsc_objects));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),122,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
123 | } | |||
124 | PetscLogPHC = PetscLogObjCreateDefault; | |||
125 | PetscLogPHD = PetscLogObjDestroyDefault; | |||
126 | /* Setup default logging structures */ | |||
127 | ierr = PetscStageLogCreate(&petsc_stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),127,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
128 | ierr = PetscStageLogRegister(petsc_stageLog, "Main Stage", &stage);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),128,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
129 | ||||
130 | /* All processors sync here for more consistent logging */ | |||
131 | ierr = MPI_Barrier(PETSC_COMM_WORLD);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),131,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
132 | PetscTime(&petsc_BaseTime); | |||
133 | ierr = PetscLogStagePush(stage);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),133,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
134 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
135 | } | |||
136 | ||||
137 | PETSC_INTERNextern __attribute__((visibility ("hidden"))) PetscErrorCode PetscLogFinalize(void) | |||
138 | { | |||
139 | PetscStageLog stageLog; | |||
140 | PetscErrorCode ierr; | |||
141 | ||||
142 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 142; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
143 | ierr = PetscFree(petsc_actions)((*PetscTrFree)((void*)(petsc_actions),143,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_actions) = 0,0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),143,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
144 | ierr = PetscFree(petsc_objects)((*PetscTrFree)((void*)(petsc_objects),144,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_objects) = 0,0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),144,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
145 | ierr = PetscLogNestedEnd();CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),145,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
146 | ierr = PetscLogSet(NULL((void*)0), NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),146,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
147 | ||||
148 | /* Resetting phase */ | |||
149 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),149,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
150 | ierr = PetscStageLogDestroy(stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),150,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
151 | ||||
152 | petsc_TotalFlops = 0.0; | |||
153 | petsc_numActions = 0; | |||
154 | petsc_numObjects = 0; | |||
155 | petsc_numObjectsDestroyed = 0; | |||
156 | petsc_maxActions = 100; | |||
157 | petsc_maxObjects = 100; | |||
158 | petsc_actions = NULL((void*)0); | |||
159 | petsc_objects = NULL((void*)0); | |||
160 | petsc_logActions = PETSC_FALSE; | |||
161 | petsc_logObjects = PETSC_FALSE; | |||
162 | petsc_BaseTime = 0.0; | |||
163 | petsc_TotalFlops = 0.0; | |||
164 | petsc_tmp_flops = 0.0; | |||
165 | petsc_send_ct = 0.0; | |||
166 | petsc_recv_ct = 0.0; | |||
167 | petsc_send_len = 0.0; | |||
168 | petsc_recv_len = 0.0; | |||
169 | petsc_isend_ct = 0.0; | |||
170 | petsc_irecv_ct = 0.0; | |||
171 | petsc_isend_len = 0.0; | |||
172 | petsc_irecv_len = 0.0; | |||
173 | petsc_wait_ct = 0.0; | |||
174 | petsc_wait_any_ct = 0.0; | |||
175 | petsc_wait_all_ct = 0.0; | |||
176 | petsc_sum_of_waits_ct = 0.0; | |||
177 | petsc_allreduce_ct = 0.0; | |||
178 | petsc_gather_ct = 0.0; | |||
179 | petsc_scatter_ct = 0.0; | |||
180 | #if defined(PETSC_HAVE_VIENNACL) || defined(PETSC_HAVE_CUDA) | |||
181 | petsc_ctog_ct = 0.0; | |||
182 | petsc_gtoc_ct = 0.0; | |||
183 | petsc_ctog_sz = 0.0; | |||
184 | petsc_gtoc_sz = 0.0; | |||
185 | #endif | |||
186 | PETSC_LARGEST_EVENT = PETSC_EVENT1311311; | |||
187 | PetscLogPHC = NULL((void*)0); | |||
188 | PetscLogPHD = NULL((void*)0); | |||
189 | petsc_tracefile = NULL((void*)0); | |||
190 | petsc_tracelevel = 0; | |||
191 | petsc_traceblanks = " "; | |||
192 | petsc_tracespace[0] = ' '; petsc_tracespace[1] = 0; | |||
193 | petsc_tracetime = 0.0; | |||
194 | PETSC_LARGEST_CLASSID = PETSC_SMALLEST_CLASSID1211211; | |||
195 | PETSC_OBJECT_CLASSID = 0; | |||
196 | petsc_stageLog = 0; | |||
197 | PetscLogInitializeCalled = PETSC_FALSE; | |||
198 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
199 | } | |||
200 | ||||
201 | /*@C | |||
202 | PetscLogSet - Sets the logging functions called at the beginning and ending of every event. | |||
203 | ||||
204 | Not Collective | |||
205 | ||||
206 | Input Parameters: | |||
207 | + b - The function called at beginning of event | |||
208 | - e - The function called at end of event | |||
209 | ||||
210 | Level: developer | |||
211 | ||||
212 | .seealso: PetscLogDump(), PetscLogDefaultBegin(), PetscLogAllBegin(), PetscLogTraceBegin() | |||
213 | @*/ | |||
214 | PetscErrorCode PetscLogSet(PetscErrorCode (*b)(PetscLogEvent, int, PetscObject, PetscObject, PetscObject, PetscObject), | |||
215 | PetscErrorCode (*e)(PetscLogEvent, int, PetscObject, PetscObject, PetscObject, PetscObject)) | |||
216 | { | |||
217 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 217; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
218 | PetscLogPLB = b; | |||
219 | PetscLogPLE = e; | |||
220 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
221 | } | |||
222 | ||||
223 | /*@C | |||
224 | PetscLogDefaultBegin - Turns on logging of objects and events. This logs flop | |||
225 | rates and object creation and should not slow programs down too much. | |||
226 | This routine may be called more than once. | |||
227 | ||||
228 | Logically Collective over PETSC_COMM_WORLD | |||
229 | ||||
230 | Options Database Keys: | |||
231 | . -log_view [viewertype:filename:viewerformat] - Prints summary of flop and timing information to the | |||
232 | screen (for code configured with --with-log=1 (which is the default)) | |||
233 | ||||
234 | Usage: | |||
235 | .vb | |||
236 | PetscInitialize(...); | |||
237 | PetscLogDefaultBegin(); | |||
238 | ... code ... | |||
239 | PetscLogView(viewer); or PetscLogDump(); | |||
240 | PetscFinalize(); | |||
241 | .ve | |||
242 | ||||
243 | Notes: | |||
244 | PetscLogView(viewer) or PetscLogDump() actually cause the printing of | |||
245 | the logging information. | |||
246 | ||||
247 | Level: advanced | |||
248 | ||||
249 | .seealso: PetscLogDump(), PetscLogAllBegin(), PetscLogView(), PetscLogTraceBegin() | |||
250 | @*/ | |||
251 | PetscErrorCode PetscLogDefaultBegin(void) | |||
252 | { | |||
253 | PetscErrorCode ierr; | |||
254 | ||||
255 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 255; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
256 | ierr = PetscLogSet(PetscLogEventBeginDefault, PetscLogEventEndDefault);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),256,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
257 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
258 | } | |||
259 | ||||
260 | /*@C | |||
261 | PetscLogAllBegin - Turns on extensive logging of objects and events. Logs | |||
262 | all events. This creates large log files and slows the program down. | |||
263 | ||||
264 | Logically Collective on PETSC_COMM_WORLD | |||
265 | ||||
266 | Options Database Keys: | |||
267 | . -log_all - Prints extensive log information | |||
268 | ||||
269 | Usage: | |||
270 | .vb | |||
271 | PetscInitialize(...); | |||
272 | PetscLogAllBegin(); | |||
273 | ... code ... | |||
274 | PetscLogDump(filename); | |||
275 | PetscFinalize(); | |||
276 | .ve | |||
277 | ||||
278 | Notes: | |||
279 | A related routine is PetscLogDefaultBegin() (with the options key -log), which is | |||
280 | intended for production runs since it logs only flop rates and object | |||
281 | creation (and shouldn't significantly slow the programs). | |||
282 | ||||
283 | Level: advanced | |||
284 | ||||
285 | .seealso: PetscLogDump(), PetscLogDefaultBegin(), PetscLogTraceBegin() | |||
286 | @*/ | |||
287 | PetscErrorCode PetscLogAllBegin(void) | |||
288 | { | |||
289 | PetscErrorCode ierr; | |||
290 | ||||
291 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 291; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
292 | ierr = PetscLogSet(PetscLogEventBeginComplete, PetscLogEventEndComplete);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),292,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
293 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
294 | } | |||
295 | ||||
296 | /*@ | |||
297 | PetscLogTraceBegin - Activates trace logging. Every time a PETSc event | |||
298 | begins or ends, the event name is printed. | |||
299 | ||||
300 | Logically Collective on PETSC_COMM_WORLD | |||
301 | ||||
302 | Input Parameter: | |||
303 | . file - The file to print trace in (e.g. stdout) | |||
304 | ||||
305 | Options Database Key: | |||
306 | . -log_trace [filename] - Activates PetscLogTraceBegin() | |||
307 | ||||
308 | Notes: | |||
309 | PetscLogTraceBegin() prints the processor number, the execution time (sec), | |||
310 | then "Event begin:" or "Event end:" followed by the event name. | |||
311 | ||||
312 | PetscLogTraceBegin() allows tracing of all PETSc calls, which is useful | |||
313 | to determine where a program is hanging without running in the | |||
314 | debugger. Can be used in conjunction with the -info option. | |||
315 | ||||
316 | Level: intermediate | |||
317 | ||||
318 | .seealso: PetscLogDump(), PetscLogAllBegin(), PetscLogView(), PetscLogDefaultBegin() | |||
319 | @*/ | |||
320 | PetscErrorCode PetscLogTraceBegin(FILE *file) | |||
321 | { | |||
322 | PetscErrorCode ierr; | |||
323 | ||||
324 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 324; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
325 | petsc_tracefile = file; | |||
326 | ||||
327 | ierr = PetscLogSet(PetscLogEventBeginTrace, PetscLogEventEndTrace);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),327,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
328 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
329 | } | |||
330 | ||||
331 | /*@ | |||
332 | PetscLogActions - Determines whether actions are logged for the graphical viewer. | |||
333 | ||||
334 | Not Collective | |||
335 | ||||
336 | Input Parameter: | |||
337 | . flag - PETSC_TRUE if actions are to be logged | |||
338 | ||||
339 | Level: intermediate | |||
340 | ||||
341 | Note: Logging of actions continues to consume more memory as the program | |||
342 | runs. Long running programs should consider turning this feature off. | |||
343 | ||||
344 | Options Database Keys: | |||
345 | . -log_exclude_actions - Turns off actions logging | |||
346 | ||||
347 | .seealso: PetscLogStagePush(), PetscLogStagePop() | |||
348 | @*/ | |||
349 | PetscErrorCode PetscLogActions(PetscBool flag) | |||
350 | { | |||
351 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 351; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
352 | petsc_logActions = flag; | |||
353 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
354 | } | |||
355 | ||||
356 | /*@ | |||
357 | PetscLogObjects - Determines whether objects are logged for the graphical viewer. | |||
358 | ||||
359 | Not Collective | |||
360 | ||||
361 | Input Parameter: | |||
362 | . flag - PETSC_TRUE if objects are to be logged | |||
363 | ||||
364 | Level: intermediate | |||
365 | ||||
366 | Note: Logging of objects continues to consume more memory as the program | |||
367 | runs. Long running programs should consider turning this feature off. | |||
368 | ||||
369 | Options Database Keys: | |||
370 | . -log_exclude_objects - Turns off objects logging | |||
371 | ||||
372 | .seealso: PetscLogStagePush(), PetscLogStagePop() | |||
373 | @*/ | |||
374 | PetscErrorCode PetscLogObjects(PetscBool flag) | |||
375 | { | |||
376 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 376; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
377 | petsc_logObjects = flag; | |||
378 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
379 | } | |||
380 | ||||
381 | /*------------------------------------------------ Stage Functions --------------------------------------------------*/ | |||
382 | /*@C | |||
383 | PetscLogStageRegister - Attaches a character string name to a logging stage. | |||
384 | ||||
385 | Not Collective | |||
386 | ||||
387 | Input Parameter: | |||
388 | . sname - The name to associate with that stage | |||
389 | ||||
390 | Output Parameter: | |||
391 | . stage - The stage number | |||
392 | ||||
393 | Level: intermediate | |||
394 | ||||
395 | .seealso: PetscLogStagePush(), PetscLogStagePop() | |||
396 | @*/ | |||
397 | PetscErrorCode PetscLogStageRegister(const char sname[],PetscLogStage *stage) | |||
398 | { | |||
399 | PetscStageLog stageLog; | |||
400 | PetscLogEvent event; | |||
401 | PetscErrorCode ierr; | |||
402 | ||||
403 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 403; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
404 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),404,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
405 | ierr = PetscStageLogRegister(stageLog, sname, stage);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),405,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
406 | /* Copy events already changed in the main stage, this sucks */ | |||
407 | ierr = PetscEventPerfLogEnsureSize(stageLog->stageInfo[*stage].eventLog, stageLog->eventLog->numEvents);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),407,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
408 | for (event = 0; event < stageLog->eventLog->numEvents; event++) { | |||
409 | ierr = PetscEventPerfInfoCopy(&stageLog->stageInfo[0].eventLog->eventInfo[event],&stageLog->stageInfo[*stage].eventLog->eventInfo[event]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),409,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
410 | } | |||
411 | ierr = PetscClassPerfLogEnsureSize(stageLog->stageInfo[*stage].classLog, stageLog->classLog->numClasses);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),411,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
412 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
413 | } | |||
414 | ||||
415 | /*@C | |||
416 | PetscLogStagePush - This function pushes a stage on the stack. | |||
417 | ||||
418 | Not Collective | |||
419 | ||||
420 | Input Parameter: | |||
421 | . stage - The stage on which to log | |||
422 | ||||
423 | Usage: | |||
424 | If the option -log_sumary is used to run the program containing the | |||
425 | following code, then 2 sets of summary data will be printed during | |||
426 | PetscFinalize(). | |||
427 | .vb | |||
428 | PetscInitialize(int *argc,char ***args,0,0); | |||
429 | [stage 0 of code] | |||
430 | PetscLogStagePush(1); | |||
431 | [stage 1 of code] | |||
432 | PetscLogStagePop(); | |||
433 | PetscBarrier(...); | |||
434 | [more stage 0 of code] | |||
435 | PetscFinalize(); | |||
436 | .ve | |||
437 | ||||
438 | Notes: | |||
439 | Use PetscLogStageRegister() to register a stage. | |||
440 | ||||
441 | Level: intermediate | |||
442 | ||||
443 | .seealso: PetscLogStagePop(), PetscLogStageRegister(), PetscBarrier() | |||
444 | @*/ | |||
445 | PetscErrorCode PetscLogStagePush(PetscLogStage stage) | |||
446 | { | |||
447 | PetscStageLog stageLog; | |||
448 | PetscErrorCode ierr; | |||
449 | ||||
450 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 450; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
451 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),451,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
452 | ierr = PetscStageLogPush(stageLog, stage);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),452,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
453 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
454 | } | |||
455 | ||||
456 | /*@C | |||
457 | PetscLogStagePop - This function pops a stage from the stack. | |||
458 | ||||
459 | Not Collective | |||
460 | ||||
461 | Usage: | |||
462 | If the option -log_sumary is used to run the program containing the | |||
463 | following code, then 2 sets of summary data will be printed during | |||
464 | PetscFinalize(). | |||
465 | .vb | |||
466 | PetscInitialize(int *argc,char ***args,0,0); | |||
467 | [stage 0 of code] | |||
468 | PetscLogStagePush(1); | |||
469 | [stage 1 of code] | |||
470 | PetscLogStagePop(); | |||
471 | PetscBarrier(...); | |||
472 | [more stage 0 of code] | |||
473 | PetscFinalize(); | |||
474 | .ve | |||
475 | ||||
476 | Notes: | |||
477 | Use PetscLogStageRegister() to register a stage. | |||
478 | ||||
479 | Level: intermediate | |||
480 | ||||
481 | .seealso: PetscLogStagePush(), PetscLogStageRegister(), PetscBarrier() | |||
482 | @*/ | |||
483 | PetscErrorCode PetscLogStagePop(void) | |||
484 | { | |||
485 | PetscStageLog stageLog; | |||
486 | PetscErrorCode ierr; | |||
487 | ||||
488 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 488; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
489 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),489,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
490 | ierr = PetscStageLogPop(stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),490,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
491 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
492 | } | |||
493 | ||||
494 | /*@ | |||
495 | PetscLogStageSetActive - Determines stage activity for PetscLogEventBegin() and PetscLogEventEnd(). | |||
496 | ||||
497 | Not Collective | |||
498 | ||||
499 | Input Parameters: | |||
500 | + stage - The stage | |||
501 | - isActive - The activity flag, PETSC_TRUE for logging, else PETSC_FALSE (defaults to PETSC_TRUE) | |||
502 | ||||
503 | Level: intermediate | |||
504 | ||||
505 | .seealso: PetscLogStagePush(), PetscLogStagePop(), PetscLogEventBegin(), PetscLogEventEnd(), PetscPreLoadBegin(), PetscPreLoadEnd(), PetscPreLoadStage() | |||
506 | @*/ | |||
507 | PetscErrorCode PetscLogStageSetActive(PetscLogStage stage, PetscBool isActive) | |||
508 | { | |||
509 | PetscStageLog stageLog; | |||
510 | PetscErrorCode ierr; | |||
511 | ||||
512 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 512; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
513 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),513,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
514 | ierr = PetscStageLogSetActive(stageLog, stage, isActive);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),514,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
515 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
516 | } | |||
517 | ||||
518 | /*@ | |||
519 | PetscLogStageGetActive - Returns stage activity for PetscLogEventBegin() and PetscLogEventEnd(). | |||
520 | ||||
521 | Not Collective | |||
522 | ||||
523 | Input Parameter: | |||
524 | . stage - The stage | |||
525 | ||||
526 | Output Parameter: | |||
527 | . isActive - The activity flag, PETSC_TRUE for logging, else PETSC_FALSE (defaults to PETSC_TRUE) | |||
528 | ||||
529 | Level: intermediate | |||
530 | ||||
531 | .seealso: PetscLogStagePush(), PetscLogStagePop(), PetscLogEventBegin(), PetscLogEventEnd(), PetscPreLoadBegin(), PetscPreLoadEnd(), PetscPreLoadStage() | |||
532 | @*/ | |||
533 | PetscErrorCode PetscLogStageGetActive(PetscLogStage stage, PetscBool *isActive) | |||
534 | { | |||
535 | PetscStageLog stageLog; | |||
536 | PetscErrorCode ierr; | |||
537 | ||||
538 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 538; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
539 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),539,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
540 | ierr = PetscStageLogGetActive(stageLog, stage, isActive);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),540,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
541 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
542 | } | |||
543 | ||||
544 | /*@ | |||
545 | PetscLogStageSetVisible - Determines stage visibility in PetscLogView() | |||
546 | ||||
547 | Not Collective | |||
548 | ||||
549 | Input Parameters: | |||
550 | + stage - The stage | |||
551 | - isVisible - The visibility flag, PETSC_TRUE to print, else PETSC_FALSE (defaults to PETSC_TRUE) | |||
552 | ||||
553 | Level: intermediate | |||
554 | ||||
555 | .seealso: PetscLogStagePush(), PetscLogStagePop(), PetscLogView() | |||
556 | @*/ | |||
557 | PetscErrorCode PetscLogStageSetVisible(PetscLogStage stage, PetscBool isVisible) | |||
558 | { | |||
559 | PetscStageLog stageLog; | |||
560 | PetscErrorCode ierr; | |||
561 | ||||
562 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 562; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
563 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),563,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
564 | ierr = PetscStageLogSetVisible(stageLog, stage, isVisible);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),564,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
565 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
566 | } | |||
567 | ||||
568 | /*@ | |||
569 | PetscLogStageGetVisible - Returns stage visibility in PetscLogView() | |||
570 | ||||
571 | Not Collective | |||
572 | ||||
573 | Input Parameter: | |||
574 | . stage - The stage | |||
575 | ||||
576 | Output Parameter: | |||
577 | . isVisible - The visibility flag, PETSC_TRUE to print, else PETSC_FALSE (defaults to PETSC_TRUE) | |||
578 | ||||
579 | Level: intermediate | |||
580 | ||||
581 | .seealso: PetscLogStagePush(), PetscLogStagePop(), PetscLogView() | |||
582 | @*/ | |||
583 | PetscErrorCode PetscLogStageGetVisible(PetscLogStage stage, PetscBool *isVisible) | |||
584 | { | |||
585 | PetscStageLog stageLog; | |||
586 | PetscErrorCode ierr; | |||
587 | ||||
588 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 588; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
589 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),589,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
590 | ierr = PetscStageLogGetVisible(stageLog, stage, isVisible);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),590,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
591 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
592 | } | |||
593 | ||||
594 | /*@C | |||
595 | PetscLogStageGetId - Returns the stage id when given the stage name. | |||
596 | ||||
597 | Not Collective | |||
598 | ||||
599 | Input Parameter: | |||
600 | . name - The stage name | |||
601 | ||||
602 | Output Parameter: | |||
603 | . stage - The stage, , or -1 if no stage with that name exists | |||
604 | ||||
605 | Level: intermediate | |||
606 | ||||
607 | .seealso: PetscLogStagePush(), PetscLogStagePop(), PetscPreLoadBegin(), PetscPreLoadEnd(), PetscPreLoadStage() | |||
608 | @*/ | |||
609 | PetscErrorCode PetscLogStageGetId(const char name[], PetscLogStage *stage) | |||
610 | { | |||
611 | PetscStageLog stageLog; | |||
612 | PetscErrorCode ierr; | |||
613 | ||||
614 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 614; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
615 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),615,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
616 | ierr = PetscStageLogGetStage(stageLog, name, stage);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),616,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
617 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
618 | } | |||
619 | ||||
620 | /*------------------------------------------------ Event Functions --------------------------------------------------*/ | |||
621 | /*@C | |||
622 | PetscLogEventRegister - Registers an event name for logging operations in an application code. | |||
623 | ||||
624 | Not Collective | |||
625 | ||||
626 | Input Parameter: | |||
627 | + name - The name associated with the event | |||
628 | - classid - The classid associated to the class for this event, obtain either with | |||
629 | PetscClassIdRegister() or use a predefined one such as KSP_CLASSID, SNES_CLASSID, the predefined ones | |||
630 | are only available in C code | |||
631 | ||||
632 | Output Parameter: | |||
633 | . event - The event id for use with PetscLogEventBegin() and PetscLogEventEnd(). | |||
634 | ||||
635 | Example of Usage: | |||
636 | .vb | |||
637 | PetscLogEvent USER_EVENT; | |||
638 | PetscClassId classid; | |||
639 | PetscLogDouble user_event_flops; | |||
640 | PetscClassIdRegister("class name",&classid); | |||
641 | PetscLogEventRegister("User event name",classid,&USER_EVENT); | |||
642 | PetscLogEventBegin(USER_EVENT,0,0,0,0); | |||
643 | [code segment to monitor] | |||
644 | PetscLogFlops(user_event_flops); | |||
645 | PetscLogEventEnd(USER_EVENT,0,0,0,0); | |||
646 | .ve | |||
647 | ||||
648 | Notes: | |||
649 | PETSc automatically logs library events if the code has been | |||
650 | configured with --with-log (which is the default) and | |||
651 | -log_view or -log_all is specified. PetscLogEventRegister() is | |||
652 | intended for logging user events to supplement this PETSc | |||
653 | information. | |||
654 | ||||
655 | PETSc can gather data for use with the utilities Jumpshot | |||
656 | (part of the MPICH distribution). If PETSc has been compiled | |||
657 | with flag -DPETSC_HAVE_MPE (MPE is an additional utility within | |||
658 | MPICH), the user can employ another command line option, -log_mpe, | |||
659 | to create a logfile, "mpe.log", which can be visualized | |||
660 | Jumpshot. | |||
661 | ||||
662 | The classid is associated with each event so that classes of events | |||
663 | can be disabled simultaneously, such as all matrix events. The user | |||
664 | can either use an existing classid, such as MAT_CLASSID, or create | |||
665 | their own as shown in the example. | |||
666 | ||||
667 | If an existing event with the same name exists, its event handle is | |||
668 | returned instead of creating a new event. | |||
669 | ||||
670 | Level: intermediate | |||
671 | ||||
672 | .seealso: PetscLogEventBegin(), PetscLogEventEnd(), PetscLogFlops(), | |||
673 | PetscLogEventActivate(), PetscLogEventDeactivate(), PetscClassIdRegister() | |||
674 | @*/ | |||
675 | PetscErrorCode PetscLogEventRegister(const char name[],PetscClassId classid,PetscLogEvent *event) | |||
676 | { | |||
677 | PetscStageLog stageLog; | |||
678 | int stage; | |||
679 | PetscErrorCode ierr; | |||
680 | ||||
681 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 681; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
682 | *event = PETSC_DECIDE-1; | |||
683 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),683,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
684 | ierr = PetscEventRegLogGetEvent(stageLog->eventLog, name, event);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),684,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
685 | if (*event > 0) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
686 | ierr = PetscEventRegLogRegister(stageLog->eventLog, name, classid, event);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),686,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
687 | for (stage = 0; stage < stageLog->numStages; stage++) { | |||
688 | ierr = PetscEventPerfLogEnsureSize(stageLog->stageInfo[stage].eventLog, stageLog->eventLog->numEvents);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),688,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
689 | ierr = PetscClassPerfLogEnsureSize(stageLog->stageInfo[stage].classLog, stageLog->classLog->numClasses);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),689,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
690 | } | |||
691 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
692 | } | |||
693 | ||||
694 | /*@ | |||
695 | PetscLogEventSetCollective - Indicates that a particular event is collective. | |||
696 | ||||
697 | Not Collective | |||
698 | ||||
699 | Input Parameter: | |||
700 | + event - The event id | |||
701 | - collective - Bolean flag indicating whether a particular event is collective | |||
702 | ||||
703 | Note: | |||
704 | New events returned from PetscLogEventRegister() are collective by default. | |||
705 | ||||
706 | Level: developer | |||
707 | ||||
708 | .seealso: PetscLogEventRegister() | |||
709 | @*/ | |||
710 | PetscErrorCode PetscLogEventSetCollective(PetscLogEvent event,PetscBool collective) | |||
711 | { | |||
712 | PetscStageLog stageLog; | |||
713 | PetscEventRegLog eventRegLog; | |||
714 | PetscErrorCode ierr; | |||
715 | ||||
716 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 716; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
717 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),717,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
718 | ierr = PetscStageLogGetEventRegLog(stageLog,&eventRegLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),718,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
719 | if (event < 0 || event > eventRegLog->numEvents) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Invalid event id")return PetscError(((MPI_Comm)0x44000001),719,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,63,PETSC_ERROR_INITIAL,"Invalid event id"); | |||
720 | eventRegLog->eventInfo[event].collective = collective; | |||
721 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
722 | } | |||
723 | ||||
724 | /*@ | |||
725 | PetscLogEventIncludeClass - Activates event logging for a PETSc object class in every stage. | |||
726 | ||||
727 | Not Collective | |||
728 | ||||
729 | Input Parameter: | |||
730 | . classid - The object class, for example MAT_CLASSID, SNES_CLASSID, etc. | |||
731 | ||||
732 | Level: developer | |||
733 | ||||
734 | .seealso: PetscLogEventActivateClass(),PetscLogEventDeactivateClass(),PetscLogEventActivate(),PetscLogEventDeactivate() | |||
735 | @*/ | |||
736 | PetscErrorCode PetscLogEventIncludeClass(PetscClassId classid) | |||
737 | { | |||
738 | PetscStageLog stageLog; | |||
739 | int stage; | |||
740 | PetscErrorCode ierr; | |||
741 | ||||
742 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 742; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
743 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),743,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
744 | for (stage = 0; stage < stageLog->numStages; stage++) { | |||
745 | ierr = PetscEventPerfLogActivateClass(stageLog->stageInfo[stage].eventLog, stageLog->eventLog, classid);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),745,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
746 | } | |||
747 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
748 | } | |||
749 | ||||
750 | /*@ | |||
751 | PetscLogEventExcludeClass - Deactivates event logging for a PETSc object class in every stage. | |||
752 | ||||
753 | Not Collective | |||
754 | ||||
755 | Input Parameter: | |||
756 | . classid - The object class, for example MAT_CLASSID, SNES_CLASSID, etc. | |||
757 | ||||
758 | Level: developer | |||
759 | ||||
760 | .seealso: PetscLogEventDeactivateClass(),PetscLogEventActivateClass(),PetscLogEventDeactivate(),PetscLogEventActivate() | |||
761 | @*/ | |||
762 | PetscErrorCode PetscLogEventExcludeClass(PetscClassId classid) | |||
763 | { | |||
764 | PetscStageLog stageLog; | |||
765 | int stage; | |||
766 | PetscErrorCode ierr; | |||
767 | ||||
768 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 768; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
769 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),769,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
770 | for (stage = 0; stage < stageLog->numStages; stage++) { | |||
771 | ierr = PetscEventPerfLogDeactivateClass(stageLog->stageInfo[stage].eventLog, stageLog->eventLog, classid);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),771,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
772 | } | |||
773 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
774 | } | |||
775 | ||||
776 | /*@ | |||
777 | PetscLogEventActivate - Indicates that a particular event should be logged. | |||
778 | ||||
779 | Not Collective | |||
780 | ||||
781 | Input Parameter: | |||
782 | . event - The event id | |||
783 | ||||
784 | Usage: | |||
785 | .vb | |||
786 | PetscLogEventDeactivate(VEC_SetValues); | |||
787 | [code where you do not want to log VecSetValues()] | |||
788 | PetscLogEventActivate(VEC_SetValues); | |||
789 | [code where you do want to log VecSetValues()] | |||
790 | .ve | |||
791 | ||||
792 | Note: | |||
793 | The event may be either a pre-defined PETSc event (found in include/petsclog.h) | |||
794 | or an event number obtained with PetscLogEventRegister(). | |||
795 | ||||
796 | Level: advanced | |||
797 | ||||
798 | .seealso: PlogEventDeactivate() | |||
799 | @*/ | |||
800 | PetscErrorCode PetscLogEventActivate(PetscLogEvent event) | |||
801 | { | |||
802 | PetscStageLog stageLog; | |||
803 | int stage; | |||
804 | PetscErrorCode ierr; | |||
805 | ||||
806 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 806; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
807 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),807,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
808 | ierr = PetscStageLogGetCurrent(stageLog, &stage);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),808,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
809 | ierr = PetscEventPerfLogActivate(stageLog->stageInfo[stage].eventLog, event);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),809,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
810 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
811 | } | |||
812 | ||||
813 | /*@ | |||
814 | PetscLogEventDeactivate - Indicates that a particular event should not be logged. | |||
815 | ||||
816 | Not Collective | |||
817 | ||||
818 | Input Parameter: | |||
819 | . event - The event id | |||
820 | ||||
821 | Usage: | |||
822 | .vb | |||
823 | PetscLogEventDeactivate(VEC_SetValues); | |||
824 | [code where you do not want to log VecSetValues()] | |||
825 | PetscLogEventActivate(VEC_SetValues); | |||
826 | [code where you do want to log VecSetValues()] | |||
827 | .ve | |||
828 | ||||
829 | Note: | |||
830 | The event may be either a pre-defined PETSc event (found in | |||
831 | include/petsclog.h) or an event number obtained with PetscLogEventRegister()). | |||
832 | ||||
833 | Level: advanced | |||
834 | ||||
835 | .seealso: PlogEventActivate() | |||
836 | @*/ | |||
837 | PetscErrorCode PetscLogEventDeactivate(PetscLogEvent event) | |||
838 | { | |||
839 | PetscStageLog stageLog; | |||
840 | int stage; | |||
841 | PetscErrorCode ierr; | |||
842 | ||||
843 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 843; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
844 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),844,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
845 | ierr = PetscStageLogGetCurrent(stageLog, &stage);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),845,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
846 | ierr = PetscEventPerfLogDeactivate(stageLog->stageInfo[stage].eventLog, event);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),846,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
847 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
848 | } | |||
849 | ||||
850 | /*@ | |||
851 | PetscLogEventSetActiveAll - Sets the event activity in every stage. | |||
852 | ||||
853 | Not Collective | |||
854 | ||||
855 | Input Parameters: | |||
856 | + event - The event id | |||
857 | - isActive - The activity flag determining whether the event is logged | |||
858 | ||||
859 | Level: advanced | |||
860 | ||||
861 | .seealso: PlogEventActivate(),PlogEventDeactivate() | |||
862 | @*/ | |||
863 | PetscErrorCode PetscLogEventSetActiveAll(PetscLogEvent event, PetscBool isActive) | |||
864 | { | |||
865 | PetscStageLog stageLog; | |||
866 | int stage; | |||
867 | PetscErrorCode ierr; | |||
868 | ||||
869 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 869; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
870 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),870,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
871 | for (stage = 0; stage < stageLog->numStages; stage++) { | |||
872 | if (isActive) { | |||
873 | ierr = PetscEventPerfLogActivate(stageLog->stageInfo[stage].eventLog, event);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),873,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
874 | } else { | |||
875 | ierr = PetscEventPerfLogDeactivate(stageLog->stageInfo[stage].eventLog, event);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),875,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
876 | } | |||
877 | } | |||
878 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
879 | } | |||
880 | ||||
881 | /*@ | |||
882 | PetscLogEventActivateClass - Activates event logging for a PETSc object class. | |||
883 | ||||
884 | Not Collective | |||
885 | ||||
886 | Input Parameter: | |||
887 | . classid - The event class, for example MAT_CLASSID, SNES_CLASSID, etc. | |||
888 | ||||
889 | Level: developer | |||
890 | ||||
891 | .seealso: PetscLogEventDeactivateClass(),PetscLogEventActivate(),PetscLogEventDeactivate() | |||
892 | @*/ | |||
893 | PetscErrorCode PetscLogEventActivateClass(PetscClassId classid) | |||
894 | { | |||
895 | PetscStageLog stageLog; | |||
896 | int stage; | |||
897 | PetscErrorCode ierr; | |||
898 | ||||
899 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 899; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
900 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),900,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
901 | ierr = PetscStageLogGetCurrent(stageLog, &stage);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),901,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
902 | ierr = PetscEventPerfLogActivateClass(stageLog->stageInfo[stage].eventLog, stageLog->eventLog, classid);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),902,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
903 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
904 | } | |||
905 | ||||
906 | /*@ | |||
907 | PetscLogEventDeactivateClass - Deactivates event logging for a PETSc object class. | |||
908 | ||||
909 | Not Collective | |||
910 | ||||
911 | Input Parameter: | |||
912 | . classid - The event class, for example MAT_CLASSID, SNES_CLASSID, etc. | |||
913 | ||||
914 | Level: developer | |||
915 | ||||
916 | .seealso: PetscLogEventActivateClass(),PetscLogEventActivate(),PetscLogEventDeactivate() | |||
917 | @*/ | |||
918 | PetscErrorCode PetscLogEventDeactivateClass(PetscClassId classid) | |||
919 | { | |||
920 | PetscStageLog stageLog; | |||
921 | int stage; | |||
922 | PetscErrorCode ierr; | |||
923 | ||||
924 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 924; petscstack->petscroutine [petscstack->currentsize] = PETSC_TRUE; petscstack->currentsize ++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0); ; } while (0); | |||
925 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),925,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
926 | ierr = PetscStageLogGetCurrent(stageLog, &stage);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),926,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
927 | ierr = PetscEventPerfLogDeactivateClass(stageLog->stageInfo[stage].eventLog, stageLog->eventLog, classid);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),927,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
928 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
929 | } | |||
930 | ||||
931 | /*MC | |||
932 | PetscLogEventSync - Synchronizes the beginning of a user event. | |||
933 | ||||
934 | Synopsis: | |||
935 | #include <petsclog.h> | |||
936 | PetscErrorCode PetscLogEventSync(int e,MPI_Comm comm) | |||
937 | ||||
938 | Collective | |||
939 | ||||
940 | Input Parameters: | |||
941 | + e - integer associated with the event obtained from PetscLogEventRegister() | |||
942 | - comm - an MPI communicator | |||
943 | ||||
944 | Usage: | |||
945 | .vb | |||
946 | PetscLogEvent USER_EVENT; | |||
947 | PetscLogEventRegister("User event",0,&USER_EVENT); | |||
948 | PetscLogEventSync(USER_EVENT,PETSC_COMM_WORLD); | |||
949 | PetscLogEventBegin(USER_EVENT,0,0,0,0); | |||
950 | [code segment to monitor] | |||
951 | PetscLogEventEnd(USER_EVENT,0,0,0,0); | |||
952 | .ve | |||
953 | ||||
954 | Notes: | |||
955 | This routine should be called only if there is not a | |||
956 | PetscObject available to pass to PetscLogEventBegin(). | |||
957 | ||||
958 | Level: developer | |||
959 | ||||
960 | .seealso: PetscLogEventRegister(), PetscLogEventBegin(), PetscLogEventEnd() | |||
961 | ||||
962 | M*/ | |||
963 | ||||
964 | /*MC | |||
965 | PetscLogEventBegin - Logs the beginning of a user event. | |||
966 | ||||
967 | Synopsis: | |||
968 | #include <petsclog.h> | |||
969 | PetscErrorCode PetscLogEventBegin(int e,PetscObject o1,PetscObject o2,PetscObject o3,PetscObject o4) | |||
970 | ||||
971 | Not Collective | |||
972 | ||||
973 | Input Parameters: | |||
974 | + e - integer associated with the event obtained from PetscLogEventRegister() | |||
975 | - o1,o2,o3,o4 - objects associated with the event, or 0 | |||
976 | ||||
977 | ||||
978 | Fortran Synopsis: | |||
979 | void PetscLogEventBegin(int e,PetscErrorCode ierr) | |||
980 | ||||
981 | Usage: | |||
982 | .vb | |||
983 | PetscLogEvent USER_EVENT; | |||
984 | PetscLogDouble user_event_flops; | |||
985 | PetscLogEventRegister("User event",0,&USER_EVENT); | |||
986 | PetscLogEventBegin(USER_EVENT,0,0,0,0); | |||
987 | [code segment to monitor] | |||
988 | PetscLogFlops(user_event_flops); | |||
989 | PetscLogEventEnd(USER_EVENT,0,0,0,0); | |||
990 | .ve | |||
991 | ||||
992 | Notes: | |||
993 | You need to register each integer event with the command | |||
994 | PetscLogEventRegister(). | |||
995 | ||||
996 | Level: intermediate | |||
997 | ||||
998 | .seealso: PetscLogEventRegister(), PetscLogEventEnd(), PetscLogFlops() | |||
999 | ||||
1000 | M*/ | |||
1001 | ||||
1002 | /*MC | |||
1003 | PetscLogEventEnd - Log the end of a user event. | |||
1004 | ||||
1005 | Synopsis: | |||
1006 | #include <petsclog.h> | |||
1007 | PetscErrorCode PetscLogEventEnd(int e,PetscObject o1,PetscObject o2,PetscObject o3,PetscObject o4) | |||
1008 | ||||
1009 | Not Collective | |||
1010 | ||||
1011 | Input Parameters: | |||
1012 | + e - integer associated with the event obtained with PetscLogEventRegister() | |||
1013 | - o1,o2,o3,o4 - objects associated with the event, or 0 | |||
1014 | ||||
1015 | ||||
1016 | Fortran Synopsis: | |||
1017 | void PetscLogEventEnd(int e,PetscErrorCode ierr) | |||
1018 | ||||
1019 | Usage: | |||
1020 | .vb | |||
1021 | PetscLogEvent USER_EVENT; | |||
1022 | PetscLogDouble user_event_flops; | |||
1023 | PetscLogEventRegister("User event",0,&USER_EVENT,); | |||
1024 | PetscLogEventBegin(USER_EVENT,0,0,0,0); | |||
1025 | [code segment to monitor] | |||
1026 | PetscLogFlops(user_event_flops); | |||
1027 | PetscLogEventEnd(USER_EVENT,0,0,0,0); | |||
1028 | .ve | |||
1029 | ||||
1030 | Notes: | |||
1031 | You should also register each additional integer event with the command | |||
1032 | PetscLogEventRegister(). | |||
1033 | ||||
1034 | Level: intermediate | |||
1035 | ||||
1036 | .seealso: PetscLogEventRegister(), PetscLogEventBegin(), PetscLogFlops() | |||
1037 | ||||
1038 | M*/ | |||
1039 | ||||
1040 | /*@C | |||
1041 | PetscLogEventGetId - Returns the event id when given the event name. | |||
1042 | ||||
1043 | Not Collective | |||
1044 | ||||
1045 | Input Parameter: | |||
1046 | . name - The event name | |||
1047 | ||||
1048 | Output Parameter: | |||
1049 | . event - The event, or -1 if no event with that name exists | |||
1050 | ||||
1051 | Level: intermediate | |||
1052 | ||||
1053 | .seealso: PetscLogEventBegin(), PetscLogEventEnd(), PetscLogStageGetId() | |||
1054 | @*/ | |||
1055 | PetscErrorCode PetscLogEventGetId(const char name[], PetscLogEvent *event) | |||
1056 | { | |||
1057 | PetscStageLog stageLog; | |||
1058 | PetscErrorCode ierr; | |||
1059 | ||||
1060 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 1060; petscstack-> petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); | |||
1061 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1061,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1062 | ierr = PetscEventRegLogGetEvent(stageLog->eventLog, name, event);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1062,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1063 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
1064 | } | |||
1065 | ||||
1066 | ||||
1067 | /*------------------------------------------------ Output Functions -------------------------------------------------*/ | |||
1068 | /*@C | |||
1069 | PetscLogDump - Dumps logs of objects to a file. This file is intended to | |||
1070 | be read by bin/petscview. This program no longer exists. | |||
1071 | ||||
1072 | Collective on PETSC_COMM_WORLD | |||
1073 | ||||
1074 | Input Parameter: | |||
1075 | . name - an optional file name | |||
1076 | ||||
1077 | Usage: | |||
1078 | .vb | |||
1079 | PetscInitialize(...); | |||
1080 | PetscLogDefaultBegin(); or PetscLogAllBegin(); | |||
1081 | ... code ... | |||
1082 | PetscLogDump(filename); | |||
1083 | PetscFinalize(); | |||
1084 | .ve | |||
1085 | ||||
1086 | Notes: | |||
1087 | The default file name is | |||
1088 | $ Log.<rank> | |||
1089 | where <rank> is the processor number. If no name is specified, | |||
1090 | this file will be used. | |||
1091 | ||||
1092 | Level: advanced | |||
1093 | ||||
1094 | .seealso: PetscLogDefaultBegin(), PetscLogAllBegin(), PetscLogView() | |||
1095 | @*/ | |||
1096 | PetscErrorCode PetscLogDump(const char sname[]) | |||
1097 | { | |||
1098 | PetscStageLog stageLog; | |||
1099 | PetscEventPerfInfo *eventInfo; | |||
1100 | FILE *fd; | |||
1101 | char file[PETSC_MAX_PATH_LEN4096], fname[PETSC_MAX_PATH_LEN4096]; | |||
1102 | PetscLogDouble flops, _TotalTime; | |||
1103 | PetscMPIInt rank; | |||
1104 | int action, object, curStage; | |||
1105 | PetscLogEvent event; | |||
1106 | PetscErrorCode ierr; | |||
1107 | ||||
1108 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 1108; petscstack-> petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); | |||
1109 | /* Calculate the total elapsed time */ | |||
1110 | PetscTime(&_TotalTime); | |||
1111 | _TotalTime -= petsc_BaseTime; | |||
1112 | /* Open log file */ | |||
1113 | ierr = MPI_Comm_rank(PETSC_COMM_WORLD, &rank);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1113,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1114 | if (sname && sname[0]) sprintf(file, "%s.%d", sname, rank); | |||
1115 | else sprintf(file, "Log.%d", rank); | |||
1116 | ierr = PetscFixFilename(file, fname);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1116,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1117 | ierr = PetscFOpen(PETSC_COMM_WORLD, fname, "w", &fd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1117,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1118 | if ((!rank) && (!fd)) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_FILE_OPEN, "Cannot open file: %s", fname)return PetscError(((MPI_Comm)0x44000001),1118,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,65,PETSC_ERROR_INITIAL,"Cannot open file: %s",fname); | |||
1119 | /* Output totals */ | |||
1120 | ierr = PetscFPrintf(PETSC_COMM_WORLD, fd, "Total Flop %14e %16.8e\n", petsc_TotalFlops, _TotalTime);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1120,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1121 | ierr = PetscFPrintf(PETSC_COMM_WORLD, fd, "Clock Resolution %g\n", 0.0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1121,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1122 | /* Output actions */ | |||
1123 | if (petsc_logActions) { | |||
1124 | ierr = PetscFPrintf(PETSC_COMM_WORLD, fd, "Actions accomplished %d\n", petsc_numActions);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1124,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1125 | for (action = 0; action < petsc_numActions; action++) { | |||
1126 | ierr = PetscFPrintf(PETSC_COMM_WORLD, fd, "%g %d %d %d %d %d %d %g %g %g\n", | |||
1127 | petsc_actions[action].time, petsc_actions[action].action, (int)petsc_actions[action].event, (int)petsc_actions[action].classid, petsc_actions[action].id1, | |||
1128 | petsc_actions[action].id2, petsc_actions[action].id3, petsc_actions[action].flops, petsc_actions[action].mem, petsc_actions[action].maxmem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1128,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1129 | } | |||
1130 | } | |||
1131 | /* Output objects */ | |||
1132 | if (petsc_logObjects) { | |||
1133 | ierr = PetscFPrintf(PETSC_COMM_WORLD, fd, "Objects created %d destroyed %d\n", petsc_numObjects, petsc_numObjectsDestroyed);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1133,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1134 | for (object = 0; object < petsc_numObjects; object++) { | |||
1135 | ierr = PetscFPrintf(PETSC_COMM_WORLD, fd, "Parent ID: %d Memory: %d\n", petsc_objects[object].parent, (int) petsc_objects[object].mem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1135,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1136 | if (!petsc_objects[object].name[0]) { | |||
1137 | ierr = PetscFPrintf(PETSC_COMM_WORLD, fd,"No Name\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1137,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1138 | } else { | |||
1139 | ierr = PetscFPrintf(PETSC_COMM_WORLD, fd, "Name: %s\n", petsc_objects[object].name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1139,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1140 | } | |||
1141 | if (petsc_objects[object].info[0] != 0) { | |||
1142 | ierr = PetscFPrintf(PETSC_COMM_WORLD, fd, "No Info\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1142,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1143 | } else { | |||
1144 | ierr = PetscFPrintf(PETSC_COMM_WORLD, fd, "Info: %s\n", petsc_objects[object].info);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1144,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1145 | } | |||
1146 | } | |||
1147 | } | |||
1148 | /* Output events */ | |||
1149 | ierr = PetscFPrintf(PETSC_COMM_WORLD, fd, "Event log:\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1149,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1150 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1150,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1151 | ierr = PetscIntStackTop(stageLog->stack, &curStage);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1151,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1152 | eventInfo = stageLog->stageInfo[curStage].eventLog->eventInfo; | |||
1153 | for (event = 0; event < stageLog->stageInfo[curStage].eventLog->numEvents; event++) { | |||
1154 | if (eventInfo[event].time != 0.0) flops = eventInfo[event].flops/eventInfo[event].time; | |||
1155 | else flops = 0.0; | |||
1156 | ierr = PetscFPrintf(PETSC_COMM_WORLD, fd, "%d %16d %16g %16g %16g\n", event, eventInfo[event].count, | |||
1157 | eventInfo[event].flops, eventInfo[event].time, flops);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1157,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1158 | } | |||
1159 | ierr = PetscFClose(PETSC_COMM_WORLD, fd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1159,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1160 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
1161 | } | |||
1162 | ||||
1163 | /* | |||
1164 | PetscLogView_Detailed - Each process prints the times for its own events | |||
1165 | ||||
1166 | */ | |||
1167 | PetscErrorCode PetscLogView_Detailed(PetscViewer viewer) | |||
1168 | { | |||
1169 | PetscStageLog stageLog; | |||
1170 | PetscEventPerfInfo *eventInfo = NULL((void*)0), *stageInfo = NULL((void*)0); | |||
1171 | PetscLogDouble locTotalTime, numRed, maxMem; | |||
1172 | int numStages,numEvents,stage,event; | |||
1173 | MPI_Comm comm = PetscObjectComm((PetscObject) viewer); | |||
1174 | PetscMPIInt rank,size; | |||
1175 | PetscErrorCode ierr; | |||
1176 | ||||
1177 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 1177; petscstack-> petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); | |||
1178 | ierr = MPI_Comm_size(comm, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1178,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1179 | ierr = MPI_Comm_rank(comm, &rank);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1179,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1180 | /* Must preserve reduction count before we go on */ | |||
1181 | numRed = petsc_allreduce_ct + petsc_gather_ct + petsc_scatter_ct; | |||
1182 | /* Get the total elapsed time */ | |||
1183 | PetscTime(&locTotalTime); locTotalTime -= petsc_BaseTime; | |||
1184 | ierr = PetscViewerASCIIPrintf(viewer,"size = %d\n",size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1184,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1185 | ierr = PetscViewerASCIIPrintf(viewer,"LocalTimes = {}\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1185,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1186 | ierr = PetscViewerASCIIPrintf(viewer,"LocalMessages = {}\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1186,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1187 | ierr = PetscViewerASCIIPrintf(viewer,"LocalMessageLens = {}\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1187,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1188 | ierr = PetscViewerASCIIPrintf(viewer,"LocalReductions = {}\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1188,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1189 | ierr = PetscViewerASCIIPrintf(viewer,"LocalFlop = {}\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1189,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1190 | ierr = PetscViewerASCIIPrintf(viewer,"LocalObjects = {}\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1190,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1191 | ierr = PetscViewerASCIIPrintf(viewer,"LocalMemory = {}\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1191,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1192 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1192,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1193 | ierr = MPIU_Allreduce(&stageLog->numStages, &numStages, 1, MPI_INT, MPI_MAX, comm)(PetscAllreduceBarrierCheck(comm,1,1193,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&stageLog->numStages),(&numStages) ,(1),(((MPI_Datatype)0x4c000405)),((MPI_Op)(0x58000001)),(comm ))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1193,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1194 | ierr = PetscViewerASCIIPrintf(viewer,"Stages = {}\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1194,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1195 | for (stage=0; stage<numStages; stage++) { | |||
1196 | ierr = PetscViewerASCIIPrintf(viewer,"Stages[\"%s\"] = {}\n",stageLog->stageInfo[stage].name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1196,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1197 | ierr = PetscViewerASCIIPrintf(viewer,"Stages[\"%s\"][\"summary\"] = {}\n",stageLog->stageInfo[stage].name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1197,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1198 | ierr = MPIU_Allreduce(&stageLog->stageInfo[stage].eventLog->numEvents, &numEvents, 1, MPI_INT, MPI_MAX, comm)(PetscAllreduceBarrierCheck(comm,1,1198,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&stageLog->stageInfo[stage].eventLog-> numEvents),(&numEvents),(1),(((MPI_Datatype)0x4c000405)), ((MPI_Op)(0x58000001)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1198,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1199 | for (event = 0; event < numEvents; event++) { | |||
1200 | ierr = PetscViewerASCIIPrintf(viewer,"Stages[\"%s\"][\"%s\"] = {}\n",stageLog->stageInfo[stage].name,stageLog->eventLog->eventInfo[event].name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1200,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1201 | } | |||
1202 | } | |||
1203 | ierr = PetscMallocGetMaximumUsage(&maxMem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1203,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1204 | ierr = PetscViewerASCIIPushSynchronized(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1204,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1205 | ierr = PetscViewerASCIISynchronizedPrintf(viewer,"LocalTimes[%d] = %g\n",rank,locTotalTime);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1205,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1206 | ierr = PetscViewerASCIISynchronizedPrintf(viewer,"LocalMessages[%d] = %g\n",rank,(petsc_irecv_ct + petsc_isend_ct + petsc_recv_ct + petsc_send_ct));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1206,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1207 | ierr = PetscViewerASCIISynchronizedPrintf(viewer,"LocalMessageLens[%d] = %g\n",rank,(petsc_irecv_len + petsc_isend_len + petsc_recv_len + petsc_send_len));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1207,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1208 | ierr = PetscViewerASCIISynchronizedPrintf(viewer,"LocalReductions[%d] = %g\n",rank,numRed);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1208,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1209 | ierr = PetscViewerASCIISynchronizedPrintf(viewer,"LocalFlop[%d] = %g\n",rank,petsc_TotalFlops);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1209,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1210 | ierr = PetscViewerASCIISynchronizedPrintf(viewer,"LocalObjects[%d] = %d\n",rank,petsc_numObjects);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1210,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1211 | ierr = PetscViewerASCIISynchronizedPrintf(viewer,"LocalMemory[%d] = %g\n",rank,maxMem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1211,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1212 | ierr = PetscViewerFlush(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1212,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1213 | for (stage=0; stage<numStages; stage++) { | |||
1214 | stageInfo = &stageLog->stageInfo[stage].perfInfo; | |||
1215 | ierr = PetscViewerASCIISynchronizedPrintf(viewer,"Stages[\"%s\"][\"summary\"][%d] = {\"time\" : %g, \"numMessages\" : %g, \"messageLength\" : %g, \"numReductions\" : %g, \"flop\" : %g}\n", | |||
1216 | stageLog->stageInfo[stage].name,rank, | |||
1217 | stageInfo->time,stageInfo->numMessages,stageInfo->messageLength,stageInfo->numReductions,stageInfo->flops);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1217,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1218 | ierr = MPIU_Allreduce(&stageLog->stageInfo[stage].eventLog->numEvents, &numEvents, 1, MPI_INT, MPI_MAX, comm)(PetscAllreduceBarrierCheck(comm,1,1218,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&stageLog->stageInfo[stage].eventLog-> numEvents),(&numEvents),(1),(((MPI_Datatype)0x4c000405)), ((MPI_Op)(0x58000001)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1218,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1219 | for (event = 0; event < numEvents; event++) { | |||
1220 | eventInfo = &stageLog->stageInfo[stage].eventLog->eventInfo[event]; | |||
1221 | ierr = PetscViewerASCIISynchronizedPrintf(viewer,"Stages[\"%s\"][\"%s\"][%d] = {\"count\" : %D, \"time\" : %g, \"syncTime\" : %g, \"numMessages\" : %g, \"messageLength\" : %g, \"numReductions\" : %g, \"flop\" : %g", | |||
1222 | stageLog->stageInfo[stage].name,stageLog->eventLog->eventInfo[event].name,rank, | |||
1223 | eventInfo->count,eventInfo->time,eventInfo->syncTime,eventInfo->numMessages,eventInfo->messageLength,eventInfo->numReductions,eventInfo->flops);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1223,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1224 | if (eventInfo->dof[0] >= 0.) { | |||
1225 | PetscInt d, e; | |||
1226 | ||||
1227 | ierr = PetscViewerASCIISynchronizedPrintf(viewer, ", \"dof\" : [");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1227,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1228 | for (d = 0; d < 8; ++d) { | |||
1229 | if (d > 0) {ierr = PetscViewerASCIISynchronizedPrintf(viewer, ", ");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1229,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0);} | |||
1230 | ierr = PetscViewerASCIISynchronizedPrintf(viewer, "%g", eventInfo->dof[d]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1230,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1231 | } | |||
1232 | ierr = PetscViewerASCIISynchronizedPrintf(viewer, "]");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1232,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1233 | ierr = PetscViewerASCIISynchronizedPrintf(viewer, ", \"error\" : [");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1233,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1234 | for (e = 0; e < 8; ++e) { | |||
1235 | if (e > 0) {ierr = PetscViewerASCIISynchronizedPrintf(viewer, ", ");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1235,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0);} | |||
1236 | ierr = PetscViewerASCIISynchronizedPrintf(viewer, "%g", eventInfo->errors[e]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1236,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1237 | } | |||
1238 | ierr = PetscViewerASCIISynchronizedPrintf(viewer, "]");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1238,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1239 | } | |||
1240 | ierr = PetscViewerASCIISynchronizedPrintf(viewer,"}\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1240,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1241 | } | |||
1242 | } | |||
1243 | ierr = PetscViewerFlush(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1243,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1244 | ierr = PetscViewerASCIIPopSynchronized(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1244,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1245 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
1246 | } | |||
1247 | ||||
1248 | /* | |||
1249 | PetscLogView_CSV - Each process prints the times for its own events in Comma-Separated Value Format | |||
1250 | */ | |||
1251 | PetscErrorCode PetscLogView_CSV(PetscViewer viewer) | |||
1252 | { | |||
1253 | PetscStageLog stageLog; | |||
1254 | PetscEventPerfInfo *eventInfo = NULL((void*)0); | |||
1255 | PetscLogDouble locTotalTime, maxMem; | |||
1256 | int numStages,numEvents,stage,event; | |||
1257 | MPI_Comm comm = PetscObjectComm((PetscObject) viewer); | |||
1258 | PetscMPIInt rank,size; | |||
1259 | PetscErrorCode ierr; | |||
1260 | ||||
1261 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 1261; petscstack-> petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); | |||
1262 | ierr = MPI_Comm_size(comm, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1262,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1263 | ierr = MPI_Comm_rank(comm, &rank);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1263,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1264 | /* Must preserve reduction count before we go on */ | |||
1265 | /* Get the total elapsed time */ | |||
1266 | PetscTime(&locTotalTime); locTotalTime -= petsc_BaseTime; | |||
1267 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1267,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1268 | ierr = MPIU_Allreduce(&stageLog->numStages, &numStages, 1, MPI_INT, MPI_MAX, comm)(PetscAllreduceBarrierCheck(comm,1,1268,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&stageLog->numStages),(&numStages) ,(1),(((MPI_Datatype)0x4c000405)),((MPI_Op)(0x58000001)),(comm ))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1268,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1269 | ierr = PetscMallocGetMaximumUsage(&maxMem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1269,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1270 | ierr = PetscViewerASCIIPushSynchronized(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1270,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1271 | ierr = PetscViewerASCIIPrintf(viewer,"Stage Name,Event Name,Rank,Time,Num Messages,Message Length,Num Reductions,FLOP,dof0,dof1,dof2,dof3,dof4,dof5,dof6,dof7,e0,e1,e2,e3,e4,e5,e6,e7,%d\n", size); | |||
1272 | ierr = PetscViewerFlush(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1272,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1273 | for (stage=0; stage<numStages; stage++) { | |||
1274 | PetscEventPerfInfo *stageInfo = &stageLog->stageInfo[stage].perfInfo; | |||
1275 | ||||
1276 | ierr = PetscViewerASCIISynchronizedPrintf(viewer,"%s,summary,%d,%g,%g,%g,%g,%g\n", | |||
1277 | stageLog->stageInfo[stage].name,rank,stageInfo->time,stageInfo->numMessages,stageInfo->messageLength,stageInfo->numReductions,stageInfo->flops);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1277,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1278 | ierr = MPIU_Allreduce(&stageLog->stageInfo[stage].eventLog->numEvents, &numEvents, 1, MPI_INT, MPI_MAX, comm)(PetscAllreduceBarrierCheck(comm,1,1278,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&stageLog->stageInfo[stage].eventLog-> numEvents),(&numEvents),(1),(((MPI_Datatype)0x4c000405)), ((MPI_Op)(0x58000001)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1278,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1279 | for (event = 0; event < numEvents; event++) { | |||
1280 | eventInfo = &stageLog->stageInfo[stage].eventLog->eventInfo[event]; | |||
1281 | ierr = PetscViewerASCIISynchronizedPrintf(viewer,"%s,%s,%d,%g,%g,%g,%g,%g",stageLog->stageInfo[stage].name, | |||
1282 | stageLog->eventLog->eventInfo[event].name,rank,eventInfo->time,eventInfo->numMessages, | |||
1283 | eventInfo->messageLength,eventInfo->numReductions,eventInfo->flops);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1283,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1284 | if (eventInfo->dof[0] >= 0.) { | |||
1285 | PetscInt d, e; | |||
1286 | ||||
1287 | for (d = 0; d < 8; ++d) { | |||
1288 | ierr = PetscViewerASCIISynchronizedPrintf(viewer, ",%g", eventInfo->dof[d]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1288,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1289 | } | |||
1290 | for (e = 0; e < 8; ++e) { | |||
1291 | ierr = PetscViewerASCIISynchronizedPrintf(viewer, ",%g", eventInfo->errors[e]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1291,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1292 | } | |||
1293 | } | |||
1294 | ierr = PetscViewerASCIISynchronizedPrintf(viewer,"\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1294,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1295 | } | |||
1296 | } | |||
1297 | ierr = PetscViewerFlush(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1297,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1298 | ierr = PetscViewerASCIIPopSynchronized(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1298,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1299 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
1300 | } | |||
1301 | ||||
1302 | static PetscErrorCode PetscLogViewWarnSync(MPI_Comm comm,FILE *fd) | |||
1303 | { | |||
1304 | PetscErrorCode ierr; | |||
1305 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 1305; petscstack-> petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); | |||
1306 | if (!PetscLogSyncOn) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
1307 | ierr = PetscFPrintf(comm, fd, "\n\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1307,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1308 | ierr = PetscFPrintf(comm, fd, " ##########################################################\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1308,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1309 | ierr = PetscFPrintf(comm, fd, " # #\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1309,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1310 | ierr = PetscFPrintf(comm, fd, " # WARNING!!! #\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1310,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1311 | ierr = PetscFPrintf(comm, fd, " # #\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1311,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1312 | ierr = PetscFPrintf(comm, fd, " # This program was run with logging synchronization. #\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1312,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1313 | ierr = PetscFPrintf(comm, fd, " # This option provides more meaningful imbalance #\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1313,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1314 | ierr = PetscFPrintf(comm, fd, " # figures at the expense of slowing things down and #\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1314,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1315 | ierr = PetscFPrintf(comm, fd, " # providing a distorted view of the overall runtime. #\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1315,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1316 | ierr = PetscFPrintf(comm, fd, " # #\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1316,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1317 | ierr = PetscFPrintf(comm, fd, " ##########################################################\n\n\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1317,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1318 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
1319 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
1320 | } | |||
1321 | ||||
1322 | static PetscErrorCode PetscLogViewWarnDebugging(MPI_Comm comm,FILE *fd) | |||
1323 | { | |||
1324 | #if defined(PETSC_USE_DEBUG1) | |||
1325 | PetscErrorCode ierr; | |||
1326 | ||||
1327 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 1327; petscstack-> petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); | |||
1328 | ierr = PetscFPrintf(comm, fd, "\n\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1328,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1329 | ierr = PetscFPrintf(comm, fd, " ##########################################################\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1329,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1330 | ierr = PetscFPrintf(comm, fd, " # #\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1330,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1331 | ierr = PetscFPrintf(comm, fd, " # WARNING!!! #\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1331,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1332 | ierr = PetscFPrintf(comm, fd, " # #\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1332,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1333 | ierr = PetscFPrintf(comm, fd, " # This code was compiled with a debugging option. #\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1333,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1334 | ierr = PetscFPrintf(comm, fd, " # To get timing results run ./configure #\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1334,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1335 | ierr = PetscFPrintf(comm, fd, " # using --with-debugging=no, the performance will #\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1335,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1336 | ierr = PetscFPrintf(comm, fd, " # be generally two or three times faster. #\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1336,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1337 | ierr = PetscFPrintf(comm, fd, " # #\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1337,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1338 | ierr = PetscFPrintf(comm, fd, " ##########################################################\n\n\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1338,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1339 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
1340 | #else | |||
1341 | return 0; | |||
1342 | #endif | |||
1343 | } | |||
1344 | ||||
1345 | #if defined(PETSC_HAVE_OPENMP) | |||
1346 | extern PetscInt PetscNumOMPThreads; | |||
1347 | #endif | |||
1348 | ||||
1349 | PetscErrorCode PetscLogView_Default(PetscViewer viewer) | |||
1350 | { | |||
1351 | FILE *fd; | |||
1352 | PetscLogDouble zero = 0.0; | |||
1353 | PetscStageLog stageLog; | |||
1354 | PetscStageInfo *stageInfo = NULL((void*)0); | |||
1355 | PetscEventPerfInfo *eventInfo = NULL((void*)0); | |||
1356 | PetscClassPerfInfo *classInfo; | |||
1357 | char arch[128],hostname[128],username[128],pname[PETSC_MAX_PATH_LEN4096],date[128]; | |||
1358 | const char *name; | |||
1359 | PetscLogDouble locTotalTime, TotalTime, TotalFlops; | |||
1360 | PetscLogDouble numMessages, messageLength, avgMessLen, numReductions; | |||
1361 | PetscLogDouble stageTime, flops, flopr, mem, mess, messLen, red; | |||
1362 | PetscLogDouble fracTime, fracFlops, fracMessages, fracLength, fracReductions, fracMess, fracMessLen, fracRed; | |||
1363 | PetscLogDouble fracStageTime, fracStageFlops, fracStageMess, fracStageMessLen, fracStageRed; | |||
1364 | PetscLogDouble min, max, tot, ratio, avg, x, y; | |||
1365 | PetscLogDouble minf, maxf, totf, ratf, mint, maxt, tott, ratt, ratC, totm, totml, totr, mal, malmax, emalmax; | |||
| ||||
1366 | #if defined(PETSC_HAVE_VIENNACL) || defined(PETSC_HAVE_CUDA) | |||
1367 | PetscLogDouble cct, gct, csz, gsz; | |||
1368 | #endif | |||
1369 | PetscMPIInt minC, maxC; | |||
1370 | PetscMPIInt size, rank; | |||
1371 | PetscBool *localStageUsed, *stageUsed; | |||
1372 | PetscBool *localStageVisible, *stageVisible; | |||
1373 | int numStages, localNumEvents, numEvents; | |||
1374 | int stage, oclass; | |||
1375 | PetscLogEvent event; | |||
1376 | PetscErrorCode ierr; | |||
1377 | char version[256]; | |||
1378 | MPI_Comm comm; | |||
1379 | ||||
1380 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 1380; petscstack-> petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); | |||
1381 | ierr = PetscObjectGetComm((PetscObject)viewer,&comm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1381,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1382 | ierr = PetscViewerASCIIGetPointer(viewer,&fd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1382,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1383 | ierr = MPI_Comm_size(comm, &size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1383,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1384 | ierr = MPI_Comm_rank(comm, &rank);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1384,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1385 | /* Get the total elapsed time */ | |||
1386 | PetscTime(&locTotalTime); locTotalTime -= petsc_BaseTime; | |||
1387 | ||||
1388 | ierr = PetscFPrintf(comm, fd, "************************************************************************************************************************\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1388,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1389 | ierr = PetscFPrintf(comm, fd, "*** WIDEN YOUR WINDOW TO 120 CHARACTERS. Use 'enscript -r -fCourier9' to print this document ***\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1389,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1390 | ierr = PetscFPrintf(comm, fd, "************************************************************************************************************************\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1390,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1391 | ierr = PetscFPrintf(comm, fd, "\n---------------------------------------------- PETSc Performance Summary: ----------------------------------------------\n\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1391,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1392 | ierr = PetscLogViewWarnSync(comm,fd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1392,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1393 | ierr = PetscLogViewWarnDebugging(comm,fd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1393,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1394 | ierr = PetscGetArchType(arch,sizeof(arch));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1394,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1395 | ierr = PetscGetHostName(hostname,sizeof(hostname));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1395,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1396 | ierr = PetscGetUserName(username,sizeof(username));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1396,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1397 | ierr = PetscGetProgramName(pname,sizeof(pname));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1397,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1398 | ierr = PetscGetDate(date,sizeof(date));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1398,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1399 | ierr = PetscGetVersion(version,sizeof(version));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1399,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1400 | if (size == 1) { | |||
1401 | ierr = PetscFPrintf(comm,fd,"%s on a %s named %s with %d processor, by %s %s\n", pname, arch, hostname, size, username, date);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1401,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1402 | } else { | |||
1403 | ierr = PetscFPrintf(comm,fd,"%s on a %s named %s with %d processors, by %s %s\n", pname, arch, hostname, size, username, date);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1403,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1404 | } | |||
1405 | #if defined(PETSC_HAVE_OPENMP) | |||
1406 | ierr = PetscFPrintf(comm,fd,"Using %D OpenMP threads\n", PetscNumOMPThreads);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1406,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1407 | #endif | |||
1408 | ierr = PetscFPrintf(comm, fd, "Using %s\n", version);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1408,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1409 | ||||
1410 | /* Must preserve reduction count before we go on */ | |||
1411 | red = petsc_allreduce_ct + petsc_gather_ct + petsc_scatter_ct; | |||
1412 | ||||
1413 | /* Calculate summary information */ | |||
1414 | ierr = PetscFPrintf(comm, fd, "\n Max Max/Min Avg Total \n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1414,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1415 | /* Time */ | |||
1416 | ierr = MPIU_Allreduce(&locTotalTime, &min, 1, MPIU_PETSCLOGDOUBLE, MPI_MIN, comm)(PetscAllreduceBarrierCheck(comm,1,1416,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&locTotalTime),(&min),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000002)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1416,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1417 | ierr = MPIU_Allreduce(&locTotalTime, &max, 1, MPIU_PETSCLOGDOUBLE, MPI_MAX, comm)(PetscAllreduceBarrierCheck(comm,1,1417,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&locTotalTime),(&max),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000001)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1417,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1418 | ierr = MPIU_Allreduce(&locTotalTime, &tot, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)(PetscAllreduceBarrierCheck(comm,1,1418,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&locTotalTime),(&tot),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000003)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1418,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1419 | avg = tot/((PetscLogDouble) size); | |||
1420 | if (min != 0.0) ratio = max/min; else ratio = 0.0; | |||
1421 | ierr = PetscFPrintf(comm, fd, "Time (sec): %5.3e %7.3f %5.3e\n", max, ratio, avg);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1421,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1422 | TotalTime = tot; | |||
1423 | /* Objects */ | |||
1424 | avg = (PetscLogDouble) petsc_numObjects; | |||
1425 | ierr = MPIU_Allreduce(&avg, &min, 1, MPIU_PETSCLOGDOUBLE, MPI_MIN, comm)(PetscAllreduceBarrierCheck(comm,1,1425,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&avg),(&min),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000002)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1425,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1426 | ierr = MPIU_Allreduce(&avg, &max, 1, MPIU_PETSCLOGDOUBLE, MPI_MAX, comm)(PetscAllreduceBarrierCheck(comm,1,1426,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&avg),(&max),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000001)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1426,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1427 | ierr = MPIU_Allreduce(&avg, &tot, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)(PetscAllreduceBarrierCheck(comm,1,1427,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&avg),(&tot),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000003)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1427,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1428 | avg = tot/((PetscLogDouble) size); | |||
1429 | if (min != 0.0) ratio = max/min; else ratio = 0.0; | |||
1430 | ierr = PetscFPrintf(comm, fd, "Objects: %5.3e %7.3f %5.3e\n", max, ratio, avg);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1430,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1431 | /* Flops */ | |||
1432 | ierr = MPIU_Allreduce(&petsc_TotalFlops, &min, 1, MPIU_PETSCLOGDOUBLE, MPI_MIN, comm)(PetscAllreduceBarrierCheck(comm,1,1432,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&petsc_TotalFlops),(&min),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000002)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1432,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1433 | ierr = MPIU_Allreduce(&petsc_TotalFlops, &max, 1, MPIU_PETSCLOGDOUBLE, MPI_MAX, comm)(PetscAllreduceBarrierCheck(comm,1,1433,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&petsc_TotalFlops),(&max),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000001)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1433,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1434 | ierr = MPIU_Allreduce(&petsc_TotalFlops, &tot, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)(PetscAllreduceBarrierCheck(comm,1,1434,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&petsc_TotalFlops),(&tot),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000003)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1434,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1435 | avg = tot/((PetscLogDouble) size); | |||
1436 | if (min != 0.0) ratio = max/min; else ratio = 0.0; | |||
1437 | ierr = PetscFPrintf(comm, fd, "Flop: %5.3e %7.3f %5.3e %5.3e\n", max, ratio, avg, tot);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1437,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1438 | TotalFlops = tot; | |||
1439 | /* Flops/sec -- Must talk to Barry here */ | |||
1440 | if (locTotalTime != 0.0) flops = petsc_TotalFlops/locTotalTime; else flops = 0.0; | |||
1441 | ierr = MPIU_Allreduce(&flops, &min, 1, MPIU_PETSCLOGDOUBLE, MPI_MIN, comm)(PetscAllreduceBarrierCheck(comm,1,1441,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&flops),(&min),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000002)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1441,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1442 | ierr = MPIU_Allreduce(&flops, &max, 1, MPIU_PETSCLOGDOUBLE, MPI_MAX, comm)(PetscAllreduceBarrierCheck(comm,1,1442,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&flops),(&max),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000001)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1442,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1443 | ierr = MPIU_Allreduce(&flops, &tot, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)(PetscAllreduceBarrierCheck(comm,1,1443,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&flops),(&tot),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000003)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1443,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1444 | avg = tot/((PetscLogDouble) size); | |||
1445 | if (min != 0.0) ratio = max/min; else ratio = 0.0; | |||
1446 | ierr = PetscFPrintf(comm, fd, "Flop/sec: %5.3e %7.3f %5.3e %5.3e\n", max, ratio, avg, tot);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1446,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1447 | /* Memory */ | |||
1448 | ierr = PetscMallocGetMaximumUsage(&mem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1448,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1449 | if (mem > 0.0) { | |||
1450 | ierr = MPIU_Allreduce(&mem, &min, 1, MPIU_PETSCLOGDOUBLE, MPI_MIN, comm)(PetscAllreduceBarrierCheck(comm,1,1450,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&mem),(&min),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000002)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1450,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1451 | ierr = MPIU_Allreduce(&mem, &max, 1, MPIU_PETSCLOGDOUBLE, MPI_MAX, comm)(PetscAllreduceBarrierCheck(comm,1,1451,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&mem),(&max),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000001)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1451,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1452 | ierr = MPIU_Allreduce(&mem, &tot, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)(PetscAllreduceBarrierCheck(comm,1,1452,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&mem),(&tot),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000003)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1452,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1453 | avg = tot/((PetscLogDouble) size); | |||
1454 | if (min != 0.0) ratio = max/min; else ratio = 0.0; | |||
1455 | ierr = PetscFPrintf(comm, fd, "Memory: %5.3e %7.3f %5.3e %5.3e\n", max, ratio, avg, tot);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1455,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1456 | } | |||
1457 | /* Messages */ | |||
1458 | mess = 0.5*(petsc_irecv_ct + petsc_isend_ct + petsc_recv_ct + petsc_send_ct); | |||
1459 | ierr = MPIU_Allreduce(&mess, &min, 1, MPIU_PETSCLOGDOUBLE, MPI_MIN, comm)(PetscAllreduceBarrierCheck(comm,1,1459,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&mess),(&min),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000002)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1459,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1460 | ierr = MPIU_Allreduce(&mess, &max, 1, MPIU_PETSCLOGDOUBLE, MPI_MAX, comm)(PetscAllreduceBarrierCheck(comm,1,1460,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&mess),(&max),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000001)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1460,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1461 | ierr = MPIU_Allreduce(&mess, &tot, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)(PetscAllreduceBarrierCheck(comm,1,1461,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&mess),(&tot),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000003)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1461,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1462 | avg = tot/((PetscLogDouble) size); | |||
1463 | if (min != 0.0) ratio = max/min; else ratio = 0.0; | |||
1464 | ierr = PetscFPrintf(comm, fd, "MPI Messages: %5.3e %7.3f %5.3e %5.3e\n", max, ratio, avg, tot);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1464,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1465 | numMessages = tot; | |||
1466 | /* Message Lengths */ | |||
1467 | mess = 0.5*(petsc_irecv_len + petsc_isend_len + petsc_recv_len + petsc_send_len); | |||
1468 | ierr = MPIU_Allreduce(&mess, &min, 1, MPIU_PETSCLOGDOUBLE, MPI_MIN, comm)(PetscAllreduceBarrierCheck(comm,1,1468,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&mess),(&min),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000002)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1468,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1469 | ierr = MPIU_Allreduce(&mess, &max, 1, MPIU_PETSCLOGDOUBLE, MPI_MAX, comm)(PetscAllreduceBarrierCheck(comm,1,1469,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&mess),(&max),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000001)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1469,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1470 | ierr = MPIU_Allreduce(&mess, &tot, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)(PetscAllreduceBarrierCheck(comm,1,1470,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&mess),(&tot),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000003)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1470,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1471 | if (numMessages != 0) avg = tot/numMessages; else avg = 0.0; | |||
1472 | if (min != 0.0) ratio = max/min; else ratio = 0.0; | |||
1473 | ierr = PetscFPrintf(comm, fd, "MPI Message Lengths: %5.3e %7.3f %5.3e %5.3e\n", max, ratio, avg, tot);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1473,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1474 | messageLength = tot; | |||
1475 | /* Reductions */ | |||
1476 | ierr = MPIU_Allreduce(&red, &min, 1, MPIU_PETSCLOGDOUBLE, MPI_MIN, comm)(PetscAllreduceBarrierCheck(comm,1,1476,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&red),(&min),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000002)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1476,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1477 | ierr = MPIU_Allreduce(&red, &max, 1, MPIU_PETSCLOGDOUBLE, MPI_MAX, comm)(PetscAllreduceBarrierCheck(comm,1,1477,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&red),(&max),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000001)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1477,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1478 | ierr = MPIU_Allreduce(&red, &tot, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)(PetscAllreduceBarrierCheck(comm,1,1478,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&red),(&tot),(1),(((MPI_Datatype)0x4c00080b )),((MPI_Op)(0x58000003)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1478,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1479 | if (min != 0.0) ratio = max/min; else ratio = 0.0; | |||
1480 | ierr = PetscFPrintf(comm, fd, "MPI Reductions: %5.3e %7.3f\n", max, ratio);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1480,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1481 | numReductions = red; /* wrong because uses count from process zero */ | |||
1482 | ierr = PetscFPrintf(comm, fd, "\nFlop counting convention: 1 flop = 1 real number operation of type (multiply/divide/add/subtract)\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1482,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1483 | ierr = PetscFPrintf(comm, fd, " e.g., VecAXPY() for real vectors of length N --> 2N flop\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1483,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1484 | ierr = PetscFPrintf(comm, fd, " and VecAXPY() for complex vectors of length N --> 8N flop\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1484,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1485 | ||||
1486 | /* Get total number of stages -- | |||
1487 | Currently, a single processor can register more stages than another, but stages must all be registered in order. | |||
1488 | We can removed this requirement if necessary by having a global stage numbering and indirection on the stage ID. | |||
1489 | This seems best accomplished by assoicating a communicator with each stage. | |||
1490 | */ | |||
1491 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1491,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1492 | ierr = MPIU_Allreduce(&stageLog->numStages, &numStages, 1, MPI_INT, MPI_MAX, comm)(PetscAllreduceBarrierCheck(comm,1,1492,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&stageLog->numStages),(&numStages) ,(1),(((MPI_Datatype)0x4c000405)),((MPI_Op)(0x58000001)),(comm ))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1492,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1493 | ierr = PetscMalloc1(numStages, &localStageUsed)PetscMallocA(1,PETSC_FALSE,1493,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,(size_t)(numStages)*sizeof(**(&localStageUsed)),(&localStageUsed ));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1493,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1494 | ierr = PetscMalloc1(numStages, &stageUsed)PetscMallocA(1,PETSC_FALSE,1494,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,(size_t)(numStages)*sizeof(**(&stageUsed)),(&stageUsed ));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1494,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1495 | ierr = PetscMalloc1(numStages, &localStageVisible)PetscMallocA(1,PETSC_FALSE,1495,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,(size_t)(numStages)*sizeof(**(&localStageVisible)),(& localStageVisible));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1495,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1496 | ierr = PetscMalloc1(numStages, &stageVisible)PetscMallocA(1,PETSC_FALSE,1496,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,(size_t)(numStages)*sizeof(**(&stageVisible)),(&stageVisible ));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1496,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1497 | if (numStages > 0) { | |||
1498 | stageInfo = stageLog->stageInfo; | |||
1499 | for (stage = 0; stage < numStages; stage++) { | |||
1500 | if (stage < stageLog->numStages) { | |||
1501 | localStageUsed[stage] = stageInfo[stage].used; | |||
1502 | localStageVisible[stage] = stageInfo[stage].perfInfo.visible; | |||
1503 | } else { | |||
1504 | localStageUsed[stage] = PETSC_FALSE; | |||
1505 | localStageVisible[stage] = PETSC_TRUE; | |||
1506 | } | |||
1507 | } | |||
1508 | ierr = MPIU_Allreduce(localStageUsed, stageUsed, numStages, MPIU_BOOL, MPI_LOR, comm)(PetscAllreduceBarrierCheck(comm,numStages,1508,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((localStageUsed),(stageUsed),(numStages),(MPIU_BOOL ),((MPI_Op)(0x58000007)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1508,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1509 | ierr = MPIU_Allreduce(localStageVisible, stageVisible, numStages, MPIU_BOOL, MPI_LAND, comm)(PetscAllreduceBarrierCheck(comm,numStages,1509,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((localStageVisible),(stageVisible),(numStages) ,(MPIU_BOOL),((MPI_Op)(0x58000005)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1509,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1510 | for (stage = 0; stage < numStages; stage++) { | |||
1511 | if (stageUsed[stage]) { | |||
1512 | ierr = PetscFPrintf(comm, fd, "\nSummary of Stages: ----- Time ------ ----- Flop ------ --- Messages --- -- Message Lengths -- -- Reductions --\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1512,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1513 | ierr = PetscFPrintf(comm, fd, " Avg %%Total Avg %%Total Count %%Total Avg %%Total Count %%Total \n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1513,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1514 | break; | |||
1515 | } | |||
1516 | } | |||
1517 | for (stage = 0; stage < numStages; stage++) { | |||
1518 | if (!stageUsed[stage]) continue; | |||
1519 | /* CANNOT use MPIU_Allreduce() since it might fail the line number check */ | |||
1520 | if (localStageUsed[stage]) { | |||
1521 | ierr = MPI_Allreduce(&stageInfo[stage].perfInfo.time, &stageTime, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&stageInfo[stage].perfInfo.time),(&stageTime),(1),( ((MPI_Datatype)0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1521,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1522 | ierr = MPI_Allreduce(&stageInfo[stage].perfInfo.flops, &flops, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&stageInfo[stage].perfInfo.flops),(&flops),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1522,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1523 | ierr = MPI_Allreduce(&stageInfo[stage].perfInfo.numMessages, &mess, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&stageInfo[stage].perfInfo.numMessages),(&mess),(1) ,(((MPI_Datatype)0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1523,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1524 | ierr = MPI_Allreduce(&stageInfo[stage].perfInfo.messageLength, &messLen, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&stageInfo[stage].perfInfo.messageLength),(&messLen ),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op)(0x58000003)),(comm )));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1524,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1525 | ierr = MPI_Allreduce(&stageInfo[stage].perfInfo.numReductions, &red, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&stageInfo[stage].perfInfo.numReductions),(&red),(1 ),(((MPI_Datatype)0x4c00080b)),((MPI_Op)(0x58000003)),(comm)) );CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1525,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1526 | name = stageInfo[stage].name; | |||
1527 | } else { | |||
1528 | ierr = MPI_Allreduce(&zero, &stageTime, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&stageTime),(1),(((MPI_Datatype)0x4c00080b) ),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1528,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1529 | ierr = MPI_Allreduce(&zero, &flops, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&flops),(1),(((MPI_Datatype)0x4c00080b)),(( MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1529,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1530 | ierr = MPI_Allreduce(&zero, &mess, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&mess),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op )(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1530,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1531 | ierr = MPI_Allreduce(&zero, &messLen, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&messLen),(1),(((MPI_Datatype)0x4c00080b)), ((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1531,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1532 | ierr = MPI_Allreduce(&zero, &red, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&red),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op )(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1532,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1533 | name = ""; | |||
1534 | } | |||
1535 | mess *= 0.5; messLen *= 0.5; red /= size; | |||
1536 | if (TotalTime != 0.0) fracTime = stageTime/TotalTime; else fracTime = 0.0; | |||
1537 | if (TotalFlops != 0.0) fracFlops = flops/TotalFlops; else fracFlops = 0.0; | |||
1538 | /* Talk to Barry if (stageTime != 0.0) flops = (size*flops)/stageTime; else flops = 0.0; */ | |||
1539 | if (numMessages != 0.0) fracMessages = mess/numMessages; else fracMessages = 0.0; | |||
1540 | if (mess != 0.0) avgMessLen = messLen/mess; else avgMessLen = 0.0; | |||
1541 | if (messageLength != 0.0) fracLength = messLen/messageLength; else fracLength = 0.0; | |||
1542 | if (numReductions != 0.0) fracReductions = red/numReductions; else fracReductions = 0.0; | |||
1543 | ierr = PetscFPrintf(comm, fd, "%2d: %15s: %6.4e %5.1f%% %6.4e %5.1f%% %5.3e %5.1f%% %5.3e %5.1f%% %5.3e %5.1f%% \n", | |||
1544 | stage, name, stageTime/size, 100.0*fracTime, flops, 100.0*fracFlops, | |||
1545 | mess, 100.0*fracMessages, avgMessLen, 100.0*fracLength, red, 100.0*fracReductions);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1545,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1546 | } | |||
1547 | } | |||
1548 | ||||
1549 | ierr = PetscFPrintf(comm, fd,"\n------------------------------------------------------------------------------------------------------------------------\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1549,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1550 | ierr = PetscFPrintf(comm, fd, "See the 'Profiling' chapter of the users' manual for details on interpreting output.\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1550,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1551 | ierr = PetscFPrintf(comm, fd, "Phase summary info:\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1551,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1552 | ierr = PetscFPrintf(comm, fd, " Count: number of times phase was executed\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1552,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1553 | ierr = PetscFPrintf(comm, fd, " Time and Flop: Max - maximum over all processors\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1553,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1554 | ierr = PetscFPrintf(comm, fd, " Ratio - ratio of maximum to minimum over all processors\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1554,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1555 | ierr = PetscFPrintf(comm, fd, " Mess: number of messages sent\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1555,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1556 | ierr = PetscFPrintf(comm, fd, " AvgLen: average message length (bytes)\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1556,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1557 | ierr = PetscFPrintf(comm, fd, " Reduct: number of global reductions\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1557,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1558 | ierr = PetscFPrintf(comm, fd, " Global: entire computation\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1558,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1559 | ierr = PetscFPrintf(comm, fd, " Stage: stages of a computation. Set stages with PetscLogStagePush() and PetscLogStagePop().\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1559,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1560 | ierr = PetscFPrintf(comm, fd, " %%T - percent time in this phase %%F - percent flop in this phase\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1560,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1561 | ierr = PetscFPrintf(comm, fd, " %%M - percent messages in this phase %%L - percent message lengths in this phase\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1561,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1562 | ierr = PetscFPrintf(comm, fd, " %%R - percent reductions in this phase\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1562,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1563 | ierr = PetscFPrintf(comm, fd, " Total Mflop/s: 10e-6 * (sum of flop over all processors)/(max time over all processors)\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1563,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1564 | if (PetscLogMemory) { | |||
1565 | ierr = PetscFPrintf(comm, fd, " Malloc Mbytes: Memory allocated and kept during event (sum over all calls to event)\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1565,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1566 | ierr = PetscFPrintf(comm, fd, " EMalloc Mbytes: extra memory allocated during event and then freed (maximum over all calls to events)\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1566,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1567 | ierr = PetscFPrintf(comm, fd, " MMalloc Mbytes: Increase in high water mark of allocated memory (sum over all calls to event)\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1567,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1568 | ierr = PetscFPrintf(comm, fd, " RMI Mbytes: Increase in resident memory (sum over all calls to event)\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1568,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1569 | } | |||
1570 | #if defined(PETSC_HAVE_VIENNACL) || defined(PETSC_HAVE_CUDA) | |||
1571 | ierr = PetscFPrintf(comm, fd, " CpuToGpu Count: total number of CPU to GPU copies per processor\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1571,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1572 | ierr = PetscFPrintf(comm, fd, " CpuToGpu Size (Mbytes): 10e-6 * (total size of CPU to GPU copies per processor)\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1572,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1573 | ierr = PetscFPrintf(comm, fd, " GpuToCpu Count: total number of GPU to CPU copies per processor\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1573,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1574 | ierr = PetscFPrintf(comm, fd, " GpuToCpu Size (Mbytes): 10e-6 * (total size of GPU to CPU copies per processor)\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1574,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1575 | #endif | |||
1576 | ierr = PetscFPrintf(comm, fd, "------------------------------------------------------------------------------------------------------------------------\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1576,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1577 | ||||
1578 | ierr = PetscLogViewWarnDebugging(comm,fd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1578,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1579 | ||||
1580 | /* Report events */ | |||
1581 | ierr = PetscFPrintf(comm, fd,"Event Count Time (sec) Flop --- Global --- --- Stage ---- Total");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1581,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1582 | if (PetscLogMemory) { | |||
1583 | ierr = PetscFPrintf(comm, fd," Malloc EMalloc MMalloc RMI");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1583,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1584 | } | |||
1585 | #if defined(PETSC_HAVE_VIENNACL) || defined(PETSC_HAVE_CUDA) | |||
1586 | ierr = PetscFPrintf(comm, fd," - CpuToGpu - - GpuToCpu -");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1586,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1587 | #endif | |||
1588 | ierr = PetscFPrintf(comm, fd,"\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1588,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1589 | ierr = PetscFPrintf(comm, fd," Max Ratio Max Ratio Max Ratio Mess AvgLen Reduct %%T %%F %%M %%L %%R %%T %%F %%M %%L %%R Mflop/s");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1589,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1590 | if (PetscLogMemory) { | |||
1591 | ierr = PetscFPrintf(comm, fd," Mbytes Mbytes Mbytes Mbytes");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1591,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1592 | } | |||
1593 | #if defined(PETSC_HAVE_VIENNACL) || defined(PETSC_HAVE_CUDA) | |||
1594 | ierr = PetscFPrintf(comm, fd," Count Size Count Size");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1594,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1595 | #endif | |||
1596 | ierr = PetscFPrintf(comm, fd,"\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1596,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1597 | ierr = PetscFPrintf(comm, fd,"------------------------------------------------------------------------------------------------------------------------");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1597,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1598 | if (PetscLogMemory) { | |||
1599 | ierr = PetscFPrintf(comm, fd,"-----------------------------");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1599,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1600 | } | |||
1601 | #if defined(PETSC_HAVE_VIENNACL) || defined(PETSC_HAVE_CUDA) | |||
1602 | ierr = PetscFPrintf(comm, fd,"-----------------------------");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1602,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1603 | #endif | |||
1604 | ierr = PetscFPrintf(comm, fd,"\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1604,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1605 | ||||
1606 | /* Problem: The stage name will not show up unless the stage executed on proc 1 */ | |||
1607 | for (stage = 0; stage < numStages; stage++) { | |||
1608 | if (!stageVisible[stage]) continue; | |||
1609 | /* CANNOT use MPIU_Allreduce() since it might fail the line number check */ | |||
1610 | if (localStageUsed[stage]) { | |||
1611 | ierr = PetscFPrintf(comm, fd, "\n--- Event Stage %d: %s\n\n", stage, stageInfo[stage].name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1611,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1612 | ierr = MPI_Allreduce(&stageInfo[stage].perfInfo.time, &stageTime, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&stageInfo[stage].perfInfo.time),(&stageTime),(1),( ((MPI_Datatype)0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1612,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1613 | ierr = MPI_Allreduce(&stageInfo[stage].perfInfo.flops, &flops, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&stageInfo[stage].perfInfo.flops),(&flops),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1613,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1614 | ierr = MPI_Allreduce(&stageInfo[stage].perfInfo.numMessages, &mess, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&stageInfo[stage].perfInfo.numMessages),(&mess),(1) ,(((MPI_Datatype)0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1614,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1615 | ierr = MPI_Allreduce(&stageInfo[stage].perfInfo.messageLength, &messLen, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&stageInfo[stage].perfInfo.messageLength),(&messLen ),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op)(0x58000003)),(comm )));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1615,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1616 | ierr = MPI_Allreduce(&stageInfo[stage].perfInfo.numReductions, &red, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&stageInfo[stage].perfInfo.numReductions),(&red),(1 ),(((MPI_Datatype)0x4c00080b)),((MPI_Op)(0x58000003)),(comm)) );CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1616,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1617 | } else { | |||
1618 | ierr = PetscFPrintf(comm, fd, "\n--- Event Stage %d: Unknown\n\n", stage);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1618,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1619 | ierr = MPI_Allreduce(&zero, &stageTime, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&stageTime),(1),(((MPI_Datatype)0x4c00080b) ),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1619,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1620 | ierr = MPI_Allreduce(&zero, &flops, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&flops),(1),(((MPI_Datatype)0x4c00080b)),(( MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1620,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1621 | ierr = MPI_Allreduce(&zero, &mess, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&mess),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op )(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1621,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1622 | ierr = MPI_Allreduce(&zero, &messLen, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&messLen),(1),(((MPI_Datatype)0x4c00080b)), ((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1622,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1623 | ierr = MPI_Allreduce(&zero, &red, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&red),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op )(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1623,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1624 | } | |||
1625 | mess *= 0.5; messLen *= 0.5; red /= size; | |||
1626 | ||||
1627 | /* Get total number of events in this stage -- | |||
1628 | Currently, a single processor can register more events than another, but events must all be registered in order, | |||
1629 | just like stages. We can removed this requirement if necessary by having a global event numbering and indirection | |||
1630 | on the event ID. This seems best accomplished by associating a communicator with each stage. | |||
1631 | ||||
1632 | Problem: If the event did not happen on proc 1, its name will not be available. | |||
1633 | Problem: Event visibility is not implemented | |||
1634 | */ | |||
1635 | if (localStageUsed[stage]) { | |||
1636 | eventInfo = stageLog->stageInfo[stage].eventLog->eventInfo; | |||
1637 | localNumEvents = stageLog->stageInfo[stage].eventLog->numEvents; | |||
1638 | } else localNumEvents = 0; | |||
1639 | ierr = MPIU_Allreduce(&localNumEvents, &numEvents, 1, MPI_INT, MPI_MAX, comm)(PetscAllreduceBarrierCheck(comm,1,1639,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce((&localNumEvents),(&numEvents),(1),((( MPI_Datatype)0x4c000405)),((MPI_Op)(0x58000001)),(comm))));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1639,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1640 | for (event = 0; event < numEvents; event++) { | |||
1641 | /* CANNOT use MPIU_Allreduce() since it might fail the line number check */ | |||
1642 | if (localStageUsed[stage] && (event < stageLog->stageInfo[stage].eventLog->numEvents) && (eventInfo[event].depth == 0)) { | |||
1643 | if ((eventInfo[event].count > 0) && (eventInfo[event].time > 0.0)) flopr = eventInfo[event].flops; else flopr = 0.0; | |||
1644 | ierr = MPI_Allreduce(&flopr, &minf, 1, MPIU_PETSCLOGDOUBLE, MPI_MIN, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&flopr),(&minf),(1),(((MPI_Datatype)0x4c00080b)),(( MPI_Op)(0x58000002)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1644,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1645 | ierr = MPI_Allreduce(&flopr, &maxf, 1, MPIU_PETSCLOGDOUBLE, MPI_MAX, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&flopr),(&maxf),(1),(((MPI_Datatype)0x4c00080b)),(( MPI_Op)(0x58000001)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1645,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1646 | ierr = MPI_Allreduce(&eventInfo[event].flops, &totf, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].flops),(&totf),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1646,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1647 | ierr = MPI_Allreduce(&eventInfo[event].time, &mint, 1, MPIU_PETSCLOGDOUBLE, MPI_MIN, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].time),(&mint),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000002)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1647,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1648 | ierr = MPI_Allreduce(&eventInfo[event].time, &maxt, 1, MPIU_PETSCLOGDOUBLE, MPI_MAX, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].time),(&maxt),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000001)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1648,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1649 | ierr = MPI_Allreduce(&eventInfo[event].time, &tott, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].time),(&tott),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1649,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1650 | ierr = MPI_Allreduce(&eventInfo[event].numMessages, &totm, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].numMessages),(&totm),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1650,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1651 | ierr = MPI_Allreduce(&eventInfo[event].messageLength, &totml, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].messageLength),(&totml),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1651,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1652 | ierr = MPI_Allreduce(&eventInfo[event].numReductions, &totr, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].numReductions),(&totr),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1652,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1653 | ierr = MPI_Allreduce(&eventInfo[event].count, &minC, 1, MPI_INT, MPI_MIN, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].count),(&minC),(1),(((MPI_Datatype )0x4c000405)),((MPI_Op)(0x58000002)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1653,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1654 | ierr = MPI_Allreduce(&eventInfo[event].count, &maxC, 1, MPI_INT, MPI_MAX, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].count),(&maxC),(1),(((MPI_Datatype )0x4c000405)),((MPI_Op)(0x58000001)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1654,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1655 | if (PetscLogMemory) { | |||
1656 | ierr = MPI_Allreduce(&eventInfo[event].memIncrease, &mem, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].memIncrease),(&mem),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1656,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1657 | ierr = MPI_Allreduce(&eventInfo[event].mallocSpace, &mal, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].mallocSpace),(&mal),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1657,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1658 | ierr = MPI_Allreduce(&eventInfo[event].mallocIncrease, &malmax,1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].mallocIncrease),(&malmax),(1),((( MPI_Datatype)0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1658,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1659 | ierr = MPI_Allreduce(&eventInfo[event].mallocIncreaseEvent, &emalmax,1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].mallocIncreaseEvent),(&emalmax),( 1),(((MPI_Datatype)0x4c00080b)),((MPI_Op)(0x58000003)),(comm) ));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1659,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1660 | } | |||
1661 | #if defined(PETSC_HAVE_VIENNACL) || defined(PETSC_HAVE_CUDA) | |||
1662 | ierr = MPI_Allreduce(&eventInfo[event].CpuToGpuCount, &cct, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].CpuToGpuCount),(&cct),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1662,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1663 | ierr = MPI_Allreduce(&eventInfo[event].GpuToCpuCount, &gct, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].GpuToCpuCount),(&gct),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1663,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1664 | ierr = MPI_Allreduce(&eventInfo[event].CpuToGpuSize, &csz, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].CpuToGpuSize),(&csz),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1664,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1665 | ierr = MPI_Allreduce(&eventInfo[event].GpuToCpuSize, &gsz, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&eventInfo[event].GpuToCpuSize),(&gsz),(1),(((MPI_Datatype )0x4c00080b)),((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1665,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1666 | #endif | |||
1667 | name = stageLog->eventLog->eventInfo[event].name; | |||
1668 | } else { | |||
1669 | flopr = 0.0; | |||
1670 | ierr = MPI_Allreduce(&flopr, &minf, 1, MPIU_PETSCLOGDOUBLE, MPI_MIN, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&flopr),(&minf),(1),(((MPI_Datatype)0x4c00080b)),(( MPI_Op)(0x58000002)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1670,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1671 | ierr = MPI_Allreduce(&flopr, &maxf, 1, MPIU_PETSCLOGDOUBLE, MPI_MAX, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&flopr),(&maxf),(1),(((MPI_Datatype)0x4c00080b)),(( MPI_Op)(0x58000001)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1671,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1672 | ierr = MPI_Allreduce(&zero, &totf, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&totf),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op )(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1672,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1673 | ierr = MPI_Allreduce(&zero, &mint, 1, MPIU_PETSCLOGDOUBLE, MPI_MIN, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&mint),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op )(0x58000002)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1673,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1674 | ierr = MPI_Allreduce(&zero, &maxt, 1, MPIU_PETSCLOGDOUBLE, MPI_MAX, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&maxt),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op )(0x58000001)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1674,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1675 | ierr = MPI_Allreduce(&zero, &tott, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&tott),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op )(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1675,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1676 | ierr = MPI_Allreduce(&zero, &totm, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&totm),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op )(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1676,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1677 | ierr = MPI_Allreduce(&zero, &totml, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&totml),(1),(((MPI_Datatype)0x4c00080b)),(( MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1677,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1678 | ierr = MPI_Allreduce(&zero, &totr, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&totr),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op )(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1678,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1679 | ierr = MPI_Allreduce(&ierr, &minC, 1, MPI_INT, MPI_MIN, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&ierr),(&minC),(1),(((MPI_Datatype)0x4c000405)),((MPI_Op )(0x58000002)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1679,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1680 | ierr = MPI_Allreduce(&ierr, &maxC, 1, MPI_INT, MPI_MAX, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&ierr),(&maxC),(1),(((MPI_Datatype)0x4c000405)),((MPI_Op )(0x58000001)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1680,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1681 | if (PetscLogMemory) { | |||
1682 | ierr = MPI_Allreduce(&zero, &mem, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&mem),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op )(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1682,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1683 | ierr = MPI_Allreduce(&zero, &mal, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&mal),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op )(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1683,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1684 | ierr = MPI_Allreduce(&zero, &malmax, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&malmax),(1),(((MPI_Datatype)0x4c00080b)),( (MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1684,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1685 | ierr = MPI_Allreduce(&zero, &emalmax,1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&emalmax),(1),(((MPI_Datatype)0x4c00080b)), ((MPI_Op)(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1685,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1686 | } | |||
1687 | #if defined(PETSC_HAVE_VIENNACL) || defined(PETSC_HAVE_CUDA) | |||
1688 | ierr = MPI_Allreduce(&zero, &cct, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&cct),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op )(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1688,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1689 | ierr = MPI_Allreduce(&zero, &gct, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&gct),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op )(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1689,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1690 | ierr = MPI_Allreduce(&zero, &csz, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&csz),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op )(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1690,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1691 | ierr = MPI_Allreduce(&zero, &gsz, 1, MPIU_PETSCLOGDOUBLE, MPI_SUM, comm)((petsc_allreduce_ct += PetscMPIParallelComm((comm)),0) || MPI_Allreduce ((&zero),(&gsz),(1),(((MPI_Datatype)0x4c00080b)),((MPI_Op )(0x58000003)),(comm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1691,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1692 | #endif | |||
1693 | name = ""; | |||
1694 | } | |||
1695 | if (mint < 0.0) { | |||
1696 | ierr = PetscFPrintf(comm, fd, "WARNING!!! Minimum time %g over all processors for %s is negative! This happens\n on some machines whose times cannot handle too rapid calls.!\n artificially changing minimum to zero.\n",mint,name); | |||
1697 | mint = 0; | |||
1698 | } | |||
1699 | if (minf < 0.0) SETERRQ2(PETSC_COMM_SELF,PETSC_ERR_PLIB,"Minimum flop %g over all processors for %s is negative! Not possible!",minf,name)return PetscError(((MPI_Comm)0x44000001),1699,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,77,PETSC_ERROR_INITIAL,"Minimum flop %g over all processors for %s is negative! Not possible!" ,minf,name); | |||
1700 | totm *= 0.5; totml *= 0.5; totr /= size; | |||
1701 | ||||
1702 | if (maxC != 0) { | |||
1703 | if (minC != 0) ratC = ((PetscLogDouble)maxC)/minC;else ratC = 0.0; | |||
1704 | if (mint != 0.0) ratt = maxt/mint; else ratt = 0.0; | |||
1705 | if (minf != 0.0) ratf = maxf/minf; else ratf = 0.0; | |||
1706 | if (TotalTime != 0.0) fracTime = tott/TotalTime; else fracTime = 0.0; | |||
1707 | if (TotalFlops != 0.0) fracFlops = totf/TotalFlops; else fracFlops = 0.0; | |||
1708 | if (stageTime != 0.0) fracStageTime = tott/stageTime; else fracStageTime = 0.0; | |||
1709 | if (flops != 0.0) fracStageFlops = totf/flops; else fracStageFlops = 0.0; | |||
1710 | if (numMessages != 0.0) fracMess = totm/numMessages; else fracMess = 0.0; | |||
1711 | if (messageLength != 0.0) fracMessLen = totml/messageLength; else fracMessLen = 0.0; | |||
1712 | if (numReductions != 0.0) fracRed = totr/numReductions; else fracRed = 0.0; | |||
1713 | if (mess != 0.0) fracStageMess = totm/mess; else fracStageMess = 0.0; | |||
1714 | if (messLen != 0.0) fracStageMessLen = totml/messLen; else fracStageMessLen = 0.0; | |||
1715 | if (red != 0.0) fracStageRed = totr/red; else fracStageRed = 0.0; | |||
1716 | if (totm != 0.0) totml /= totm; else totml = 0.0; | |||
1717 | if (maxt != 0.0) flopr = totf/maxt; else flopr = 0.0; | |||
1718 | if (fracStageTime > 1.00) ierr = PetscFPrintf(comm, fd,"Warning -- total time of event greater than time of entire stage -- something is wrong with the timer\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1718,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1719 | ierr = PetscFPrintf(comm, fd, | |||
1720 | "%-16s %7d%4.1f %5.4e%4.1f %3.2e%4.1f %2.1e %2.1e %2.1e%3.0f%3.0f%3.0f%3.0f%3.0f %3.0f%3.0f%3.0f%3.0f%3.0f %5.0f", | |||
1721 | name, maxC, ratC, maxt, ratt, maxf, ratf, totm, totml, totr, | |||
1722 | 100.0*fracTime, 100.0*fracFlops, 100.0*fracMess, 100.0*fracMessLen, 100.0*fracRed, | |||
1723 | 100.0*fracStageTime, 100.0*fracStageFlops, 100.0*fracStageMess, 100.0*fracStageMessLen, 100.0*fracStageRed, | |||
1724 | PetscAbs(flopr)(((flopr) >= 0) ? (flopr) : (-(flopr)))/1.0e6);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1724,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1725 | if (PetscLogMemory) { | |||
1726 | ierr = PetscFPrintf(comm, fd," %5.0f %5.0f %5.0f %5.0f",mal/1.0e6,emalmax/1.0e6,malmax/1.0e6,mem/1.0e6);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1726,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
| ||||
1727 | } | |||
1728 | #if defined(PETSC_HAVE_VIENNACL) || defined(PETSC_HAVE_CUDA) | |||
1729 | ierr = PetscFPrintf(comm, fd," %4.0f %3.2e %4.0f %3.2e",cct/size,csz/(1.0e6*size),gct/size,gsz/(1.0e6*size));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1729,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1730 | #endif | |||
1731 | ierr = PetscFPrintf(comm, fd,"\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1731,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1732 | } | |||
1733 | } | |||
1734 | } | |||
1735 | ||||
1736 | /* Memory usage and object creation */ | |||
1737 | ierr = PetscFPrintf(comm, fd, "------------------------------------------------------------------------------------------------------------------------");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1737,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1738 | if (PetscLogMemory) { | |||
1739 | ierr = PetscFPrintf(comm, fd, "-----------------------------");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1739,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1740 | } | |||
1741 | #if defined(PETSC_HAVE_VIENNACL) || defined(PETSC_HAVE_CUDA) | |||
1742 | ierr = PetscFPrintf(comm, fd, "-----------------------------");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1742,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1743 | #endif | |||
1744 | ierr = PetscFPrintf(comm, fd, "\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1744,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1745 | ierr = PetscFPrintf(comm, fd, "\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1745,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1746 | ierr = PetscFPrintf(comm, fd, "Memory usage is given in bytes:\n\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1746,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1747 | ||||
1748 | /* Right now, only stages on the first processor are reported here, meaning only objects associated with | |||
1749 | the global communicator, or MPI_COMM_SELF for proc 1. We really should report global stats and then | |||
1750 | stats for stages local to processor sets. | |||
1751 | */ | |||
1752 | /* We should figure out the longest object name here (now 20 characters) */ | |||
1753 | ierr = PetscFPrintf(comm, fd, "Object Type Creations Destructions Memory Descendants' Mem.\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1753,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1754 | ierr = PetscFPrintf(comm, fd, "Reports information only for process 0.\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1754,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1755 | for (stage = 0; stage < numStages; stage++) { | |||
1756 | if (localStageUsed[stage]) { | |||
1757 | classInfo = stageLog->stageInfo[stage].classLog->classInfo; | |||
1758 | ierr = PetscFPrintf(comm, fd, "\n--- Event Stage %d: %s\n\n", stage, stageInfo[stage].name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1758,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1759 | for (oclass = 0; oclass < stageLog->stageInfo[stage].classLog->numClasses; oclass++) { | |||
1760 | if ((classInfo[oclass].creations > 0) || (classInfo[oclass].destructions > 0)) { | |||
1761 | ierr = PetscFPrintf(comm, fd, "%20s %5d %5d %11.0f %g\n", stageLog->classLog->classInfo[oclass].name, | |||
1762 | classInfo[oclass].creations, classInfo[oclass].destructions, classInfo[oclass].mem, | |||
1763 | classInfo[oclass].descMem);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1763,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1764 | } | |||
1765 | } | |||
1766 | } else { | |||
1767 | if (!localStageVisible[stage]) continue; | |||
1768 | ierr = PetscFPrintf(comm, fd, "\n--- Event Stage %d: Unknown\n\n", stage);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1768,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1769 | } | |||
1770 | } | |||
1771 | ||||
1772 | ierr = PetscFree(localStageUsed)((*PetscTrFree)((void*)(localStageUsed),1772,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((localStageUsed) = 0,0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1772,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1773 | ierr = PetscFree(stageUsed)((*PetscTrFree)((void*)(stageUsed),1773,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((stageUsed) = 0,0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1773,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1774 | ierr = PetscFree(localStageVisible)((*PetscTrFree)((void*)(localStageVisible),1774,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((localStageVisible) = 0,0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1774,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1775 | ierr = PetscFree(stageVisible)((*PetscTrFree)((void*)(stageVisible),1775,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ) || ((stageVisible) = 0,0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1775,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1776 | ||||
1777 | /* Information unrelated to this particular run */ | |||
1778 | ierr = PetscFPrintf(comm, fd, "========================================================================================================================\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1778,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1779 | PetscTime(&y); | |||
1780 | PetscTime(&x); | |||
1781 | PetscTime(&y); PetscTime(&y); PetscTime(&y); PetscTime(&y); PetscTime(&y); | |||
1782 | PetscTime(&y); PetscTime(&y); PetscTime(&y); PetscTime(&y); PetscTime(&y); | |||
1783 | ierr = PetscFPrintf(comm,fd,"Average time to get PetscTime(): %g\n", (y-x)/10.0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1783,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1784 | /* MPI information */ | |||
1785 | if (size > 1) { | |||
1786 | MPI_Status status; | |||
1787 | PetscMPIInt tag; | |||
1788 | MPI_Comm newcomm; | |||
1789 | ||||
1790 | ierr = MPI_Barrier(comm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1790,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1791 | PetscTime(&x); | |||
1792 | ierr = MPI_Barrier(comm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1792,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1793 | ierr = MPI_Barrier(comm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1793,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1794 | ierr = MPI_Barrier(comm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1794,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1795 | ierr = MPI_Barrier(comm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1795,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1796 | ierr = MPI_Barrier(comm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1796,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1797 | PetscTime(&y); | |||
1798 | ierr = PetscFPrintf(comm, fd, "Average time for MPI_Barrier(): %g\n", (y-x)/5.0);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1798,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1799 | ierr = PetscCommDuplicate(comm,&newcomm, &tag);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1799,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1800 | ierr = MPI_Barrier(comm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1800,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1801 | if (rank) { | |||
1802 | ierr = MPI_Recv(NULL, 0, MPI_INT, rank-1, tag, newcomm, &status)((petsc_recv_ct++,0) || PetscMPITypeSize((&petsc_recv_len ),(0),(((MPI_Datatype)0x4c000405))) || MPI_Recv((((void*)0)), (0),(((MPI_Datatype)0x4c000405)),(rank-1),(tag),(newcomm),(& status)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1802,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1803 | ierr = MPI_Send(NULL, 0, MPI_INT, (rank+1)%size, tag, newcomm)((petsc_send_ct++,0) || PetscMPITypeSize((&petsc_send_len ),(0),(((MPI_Datatype)0x4c000405))) || MPI_Send((((void*)0)), (0),(((MPI_Datatype)0x4c000405)),((rank+1)%size),(tag),(newcomm )));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1803,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1804 | } else { | |||
1805 | PetscTime(&x); | |||
1806 | ierr = MPI_Send(NULL, 0, MPI_INT, 1, tag, newcomm)((petsc_send_ct++,0) || PetscMPITypeSize((&petsc_send_len ),(0),(((MPI_Datatype)0x4c000405))) || MPI_Send((((void*)0)), (0),(((MPI_Datatype)0x4c000405)),(1),(tag),(newcomm)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1806,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1807 | ierr = MPI_Recv(NULL, 0, MPI_INT, size-1, tag, newcomm, &status)((petsc_recv_ct++,0) || PetscMPITypeSize((&petsc_recv_len ),(0),(((MPI_Datatype)0x4c000405))) || MPI_Recv((((void*)0)), (0),(((MPI_Datatype)0x4c000405)),(size-1),(tag),(newcomm),(& status)));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1807,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1808 | PetscTime(&y); | |||
1809 | ierr = PetscFPrintf(comm,fd,"Average time for zero size MPI_Send(): %g\n", (y-x)/size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1809,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1810 | } | |||
1811 | ierr = PetscCommDestroy(&newcomm);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1811,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1812 | } | |||
1813 | ierr = PetscOptionsView(NULL((void*)0),viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1813,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1814 | ||||
1815 | /* Machine and compile information */ | |||
1816 | #if defined(PETSC_USE_FORTRAN_KERNELS) | |||
1817 | ierr = PetscFPrintf(comm, fd, "Compiled with FORTRAN kernels\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1817,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1818 | #else | |||
1819 | ierr = PetscFPrintf(comm, fd, "Compiled without FORTRAN kernels\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1819,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1820 | #endif | |||
1821 | #if defined(PETSC_USE_64BIT_INDICES) | |||
1822 | ierr = PetscFPrintf(comm, fd, "Compiled with 64 bit PetscInt\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1822,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1823 | #elif defined(PETSC_USE___FLOAT128) | |||
1824 | ierr = PetscFPrintf(comm, fd, "Compiled with 32 bit PetscInt\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1824,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1825 | #endif | |||
1826 | #if defined(PETSC_USE_REAL_SINGLE) | |||
1827 | ierr = PetscFPrintf(comm, fd, "Compiled with single precision PetscScalar and PetscReal\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1827,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1828 | #elif defined(PETSC_USE___FLOAT128) | |||
1829 | ierr = PetscFPrintf(comm, fd, "Compiled with 128 bit precision PetscScalar and PetscReal\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1829,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1830 | #endif | |||
1831 | #if defined(PETSC_USE_REAL_MAT_SINGLE) | |||
1832 | ierr = PetscFPrintf(comm, fd, "Compiled with single precision matrices\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1832,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1833 | #else | |||
1834 | ierr = PetscFPrintf(comm, fd, "Compiled with full precision matrices (default)\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1834,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1835 | #endif | |||
1836 | ierr = PetscFPrintf(comm, fd, "sizeof(short) %d sizeof(int) %d sizeof(long) %d sizeof(void*) %d sizeof(PetscScalar) %d sizeof(PetscInt) %d\n", | |||
1837 | (int) sizeof(short), (int) sizeof(int), (int) sizeof(long), (int) sizeof(void*),(int) sizeof(PetscScalar),(int) sizeof(PetscInt));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1837,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1838 | ||||
1839 | ierr = PetscFPrintf(comm, fd, "Configure options: %s",petscconfigureoptions);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1839,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1840 | ierr = PetscFPrintf(comm, fd, "%s", petscmachineinfo);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1840,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1841 | ierr = PetscFPrintf(comm, fd, "%s", petsccompilerinfo);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1841,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1842 | ierr = PetscFPrintf(comm, fd, "%s", petsccompilerflagsinfo);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1842,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1843 | ierr = PetscFPrintf(comm, fd, "%s", petsclinkerinfo);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1843,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1844 | ||||
1845 | /* Cleanup */ | |||
1846 | ierr = PetscFPrintf(comm, fd, "\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1846,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1847 | ierr = PetscLogViewWarnDebugging(comm,fd);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1847,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1848 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
1849 | } | |||
1850 | ||||
1851 | /*@C | |||
1852 | PetscLogView - Prints a summary of the logging. | |||
1853 | ||||
1854 | Collective over MPI_Comm | |||
1855 | ||||
1856 | Input Parameter: | |||
1857 | . viewer - an ASCII viewer | |||
1858 | ||||
1859 | Options Database Keys: | |||
1860 | + -log_view [:filename] - Prints summary of log information | |||
1861 | . -log_view :filename.py:ascii_info_detail - Saves logging information from each process as a Python file | |||
1862 | . -log_view :filename.xml:ascii_xml - Saves a summary of the logging information in a nested format (see below for how to view it) | |||
1863 | . -log_all - Saves a file Log.rank for each MPI process with details of each step of the computation | |||
1864 | - -log_trace [filename] - Displays a trace of what each process is doing | |||
1865 | ||||
1866 | Notes: | |||
1867 | It is possible to control the logging programatically but we recommend using the options database approach whenever possible | |||
1868 | By default the summary is printed to stdout. | |||
1869 | ||||
1870 | Before calling this routine you must have called either PetscLogDefaultBegin() or PetscLogNestedBegin() | |||
1871 | ||||
1872 | If PETSc is configured with --with-logging=0 then this functionality is not available | |||
1873 | ||||
1874 | To view the nested XML format filename.xml first copy ${PETSC_DIR}/share/petsc/xml/performance_xml2html.xsl to the current | |||
1875 | directory then open filename.xml with your browser. Specific notes for certain browsers | |||
1876 | $ Firefox and Internet explorer - simply open the file | |||
1877 | $ Google Chrome - you must start up Chrome with the option --allow-file-access-from-files | |||
1878 | $ Safari - see https://ccm.net/faq/36342-safari-how-to-enable-local-file-access | |||
1879 | or one can use the package http://xmlsoft.org/XSLT/xsltproc2.html to translate the xml file to html and then open it with | |||
1880 | your browser. | |||
1881 | Alternatively, use the script ${PETSC_DIR}/lib/petsc/bin/petsc-performance-view to automatically open a new browser | |||
1882 | window and render the XML log file contents. | |||
1883 | ||||
1884 | The nested XML format was kindly donated by Koos Huijssen and Christiaan M. Klaij MARITIME RESEARCH INSTITUTE NETHERLANDS | |||
1885 | ||||
1886 | Level: beginner | |||
1887 | ||||
1888 | .seealso: PetscLogDefaultBegin(), PetscLogDump() | |||
1889 | @*/ | |||
1890 | PetscErrorCode PetscLogView(PetscViewer viewer) | |||
1891 | { | |||
1892 | PetscErrorCode ierr; | |||
1893 | PetscBool isascii; | |||
1894 | PetscViewerFormat format; | |||
1895 | int stage, lastStage; | |||
1896 | PetscStageLog stageLog; | |||
1897 | ||||
1898 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 1898; petscstack-> petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); | |||
1899 | if (!PetscLogPLB) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP,"Must use -log_view or PetscLogDefaultBegin() before calling this routine")return PetscError(((MPI_Comm)0x44000001),1899,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,56,PETSC_ERROR_INITIAL,"Must use -log_view or PetscLogDefaultBegin() before calling this routine" ); | |||
1900 | /* Pop off any stages the user forgot to remove */ | |||
1901 | lastStage = 0; | |||
1902 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1902,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1903 | ierr = PetscStageLogGetCurrent(stageLog, &stage);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1903,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1904 | while (stage >= 0) { | |||
1905 | lastStage = stage; | |||
1906 | ierr = PetscStageLogPop(stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1906,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1907 | ierr = PetscStageLogGetCurrent(stageLog, &stage);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1907,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1908 | } | |||
1909 | ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERASCII"ascii",&isascii);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1909,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1910 | if (!isascii) SETERRQ(PetscObjectComm((PetscObject)viewer),PETSC_ERR_SUP,"Currently can only view logging to ASCII")return PetscError(PetscObjectComm((PetscObject)viewer),1910,__func__ ,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c",56,PETSC_ERROR_INITIAL ,"Currently can only view logging to ASCII"); | |||
1911 | ierr = PetscViewerGetFormat(viewer,&format);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1911,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1912 | if (format == PETSC_VIEWER_DEFAULT || format == PETSC_VIEWER_ASCII_INFO) { | |||
1913 | ierr = PetscLogView_Default(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1913,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1914 | } else if (format == PETSC_VIEWER_ASCII_INFO_DETAIL) { | |||
1915 | ierr = PetscLogView_Detailed(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1915,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1916 | } else if (format == PETSC_VIEWER_ASCII_CSV) { | |||
1917 | ierr = PetscLogView_CSV(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1917,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1918 | } else if (format == PETSC_VIEWER_ASCII_XML) { | |||
1919 | ierr = PetscLogView_Nested(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1919,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1920 | } | |||
1921 | ierr = PetscStageLogPush(stageLog, lastStage);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1921,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1922 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
1923 | } | |||
1924 | ||||
1925 | /*@C | |||
1926 | PetscLogViewFromOptions - Processes command line options to determine if/how a PetscLog is to be viewed. | |||
1927 | ||||
1928 | Collective on PETSC_COMM_WORLD | |||
1929 | ||||
1930 | Not normally called by user | |||
1931 | ||||
1932 | Level: intermediate | |||
1933 | ||||
1934 | @*/ | |||
1935 | PetscErrorCode PetscLogViewFromOptions(void) | |||
1936 | { | |||
1937 | PetscErrorCode ierr; | |||
1938 | PetscViewer viewer; | |||
1939 | PetscBool flg; | |||
1940 | PetscViewerFormat format; | |||
1941 | ||||
1942 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 1942; petscstack-> petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); | |||
1943 | ierr = PetscOptionsGetViewer(PETSC_COMM_WORLD,NULL((void*)0),NULL((void*)0),"-log_view",&viewer,&format,&flg);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1943,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1944 | if (flg) { | |||
1945 | ierr = PetscViewerPushFormat(viewer,format);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1945,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1946 | ierr = PetscLogView(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1946,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1947 | ierr = PetscViewerPopFormat(viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1947,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1948 | ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1948,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1949 | } | |||
1950 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
1951 | } | |||
1952 | ||||
1953 | ||||
1954 | ||||
1955 | /*----------------------------------------------- Counter Functions -------------------------------------------------*/ | |||
1956 | /*@C | |||
1957 | PetscGetFlops - Returns the number of flops used on this processor | |||
1958 | since the program began. | |||
1959 | ||||
1960 | Not Collective | |||
1961 | ||||
1962 | Output Parameter: | |||
1963 | flops - number of floating point operations | |||
1964 | ||||
1965 | Notes: | |||
1966 | A global counter logs all PETSc flop counts. The user can use | |||
1967 | PetscLogFlops() to increment this counter to include flops for the | |||
1968 | application code. | |||
1969 | ||||
1970 | Level: intermediate | |||
1971 | ||||
1972 | .seealso: PetscTime(), PetscLogFlops() | |||
1973 | @*/ | |||
1974 | PetscErrorCode PetscGetFlops(PetscLogDouble *flops) | |||
1975 | { | |||
1976 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 1976; petscstack-> petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); | |||
1977 | *flops = petsc_TotalFlops; | |||
1978 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
1979 | } | |||
1980 | ||||
1981 | PetscErrorCode PetscLogObjectState(PetscObject obj, const char format[], ...) | |||
1982 | { | |||
1983 | PetscErrorCode ierr; | |||
1984 | size_t fullLength; | |||
1985 | va_list Argp; | |||
1986 | ||||
1987 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 1987; petscstack-> petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); | |||
1988 | if (!petsc_logObjects) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
1989 | va_start(Argp, format)__builtin_va_start(Argp, format); | |||
1990 | ierr = PetscVSNPrintf(petsc_objects[obj->id].info, 64,format,&fullLength, Argp);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),1990,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
1991 | va_end(Argp)__builtin_va_end(Argp); | |||
1992 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
1993 | } | |||
1994 | ||||
1995 | ||||
1996 | /*MC | |||
1997 | PetscLogFlops - Adds floating point operations to the global counter. | |||
1998 | ||||
1999 | Synopsis: | |||
2000 | #include <petsclog.h> | |||
2001 | PetscErrorCode PetscLogFlops(PetscLogDouble f) | |||
2002 | ||||
2003 | Not Collective | |||
2004 | ||||
2005 | Input Parameter: | |||
2006 | . f - flop counter | |||
2007 | ||||
2008 | ||||
2009 | Usage: | |||
2010 | .vb | |||
2011 | PetscLogEvent USER_EVENT; | |||
2012 | PetscLogEventRegister("User event",0,&USER_EVENT); | |||
2013 | PetscLogEventBegin(USER_EVENT,0,0,0,0); | |||
2014 | [code segment to monitor] | |||
2015 | PetscLogFlops(user_flops) | |||
2016 | PetscLogEventEnd(USER_EVENT,0,0,0,0); | |||
2017 | .ve | |||
2018 | ||||
2019 | Notes: | |||
2020 | A global counter logs all PETSc flop counts. The user can use | |||
2021 | PetscLogFlops() to increment this counter to include flops for the | |||
2022 | application code. | |||
2023 | ||||
2024 | Level: intermediate | |||
2025 | ||||
2026 | .seealso: PetscLogEventRegister(), PetscLogEventBegin(), PetscLogEventEnd(), PetscGetFlops() | |||
2027 | ||||
2028 | M*/ | |||
2029 | ||||
2030 | /*MC | |||
2031 | PetscPreLoadBegin - Begin a segment of code that may be preloaded (run twice) | |||
2032 | to get accurate timings | |||
2033 | ||||
2034 | Synopsis: | |||
2035 | #include <petsclog.h> | |||
2036 | void PetscPreLoadBegin(PetscBool flag,char *name); | |||
2037 | ||||
2038 | Not Collective | |||
2039 | ||||
2040 | Input Parameter: | |||
2041 | + flag - PETSC_TRUE to run twice, PETSC_FALSE to run once, may be overridden | |||
2042 | with command line option -preload true or -preload false | |||
2043 | - name - name of first stage (lines of code timed separately with -log_view) to | |||
2044 | be preloaded | |||
2045 | ||||
2046 | Usage: | |||
2047 | .vb | |||
2048 | PetscPreLoadBegin(PETSC_TRUE,"first stage); | |||
2049 | lines of code | |||
2050 | PetscPreLoadStage("second stage"); | |||
2051 | lines of code | |||
2052 | PetscPreLoadEnd(); | |||
2053 | .ve | |||
2054 | ||||
2055 | Notes: | |||
2056 | Only works in C/C++, not Fortran | |||
2057 | ||||
2058 | Flags available within the macro. | |||
2059 | + PetscPreLoadingUsed - true if we are or have done preloading | |||
2060 | . PetscPreLoadingOn - true if it is CURRENTLY doing preload | |||
2061 | . PetscPreLoadIt - 0 for the first computation (with preloading turned off it is only 0) 1 for the second | |||
2062 | - PetscPreLoadMax - number of times it will do the computation, only one when preloading is turned on | |||
2063 | The first two variables are available throughout the program, the second two only between the PetscPreLoadBegin() | |||
2064 | and PetscPreLoadEnd() | |||
2065 | ||||
2066 | Level: intermediate | |||
2067 | ||||
2068 | .seealso: PetscLogEventRegister(), PetscLogEventBegin(), PetscLogEventEnd(), PetscPreLoadEnd(), PetscPreLoadStage() | |||
2069 | ||||
2070 | ||||
2071 | M*/ | |||
2072 | ||||
2073 | /*MC | |||
2074 | PetscPreLoadEnd - End a segment of code that may be preloaded (run twice) | |||
2075 | to get accurate timings | |||
2076 | ||||
2077 | Synopsis: | |||
2078 | #include <petsclog.h> | |||
2079 | void PetscPreLoadEnd(void); | |||
2080 | ||||
2081 | Not Collective | |||
2082 | ||||
2083 | Usage: | |||
2084 | .vb | |||
2085 | PetscPreLoadBegin(PETSC_TRUE,"first stage); | |||
2086 | lines of code | |||
2087 | PetscPreLoadStage("second stage"); | |||
2088 | lines of code | |||
2089 | PetscPreLoadEnd(); | |||
2090 | .ve | |||
2091 | ||||
2092 | Notes: | |||
2093 | only works in C/C++ not fortran | |||
2094 | ||||
2095 | Level: intermediate | |||
2096 | ||||
2097 | .seealso: PetscLogEventRegister(), PetscLogEventBegin(), PetscLogEventEnd(), PetscPreLoadBegin(), PetscPreLoadStage() | |||
2098 | ||||
2099 | M*/ | |||
2100 | ||||
2101 | /*MC | |||
2102 | PetscPreLoadStage - Start a new segment of code to be timed separately. | |||
2103 | to get accurate timings | |||
2104 | ||||
2105 | Synopsis: | |||
2106 | #include <petsclog.h> | |||
2107 | void PetscPreLoadStage(char *name); | |||
2108 | ||||
2109 | Not Collective | |||
2110 | ||||
2111 | Usage: | |||
2112 | .vb | |||
2113 | PetscPreLoadBegin(PETSC_TRUE,"first stage); | |||
2114 | lines of code | |||
2115 | PetscPreLoadStage("second stage"); | |||
2116 | lines of code | |||
2117 | PetscPreLoadEnd(); | |||
2118 | .ve | |||
2119 | ||||
2120 | Notes: | |||
2121 | only works in C/C++ not fortran | |||
2122 | ||||
2123 | Level: intermediate | |||
2124 | ||||
2125 | .seealso: PetscLogEventRegister(), PetscLogEventBegin(), PetscLogEventEnd(), PetscPreLoadBegin(), PetscPreLoadEnd() | |||
2126 | ||||
2127 | M*/ | |||
2128 | ||||
2129 | ||||
2130 | #else /* end of -DPETSC_USE_LOG section */ | |||
2131 | ||||
2132 | PetscErrorCode PetscLogObjectState(PetscObject obj, const char format[], ...) | |||
2133 | { | |||
2134 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 2134; petscstack-> petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); | |||
2135 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
2136 | } | |||
2137 | ||||
2138 | #endif /* PETSC_USE_LOG*/ | |||
2139 | ||||
2140 | ||||
2141 | PetscClassId PETSC_LARGEST_CLASSID = PETSC_SMALLEST_CLASSID1211211; | |||
2142 | PetscClassId PETSC_OBJECT_CLASSID = 0; | |||
2143 | ||||
2144 | /*@C | |||
2145 | PetscClassIdRegister - Registers a new class name for objects and logging operations in an application code. | |||
2146 | ||||
2147 | Not Collective | |||
2148 | ||||
2149 | Input Parameter: | |||
2150 | . name - The class name | |||
2151 | ||||
2152 | Output Parameter: | |||
2153 | . oclass - The class id or classid | |||
2154 | ||||
2155 | Level: developer | |||
2156 | ||||
2157 | @*/ | |||
2158 | PetscErrorCode PetscClassIdRegister(const char name[],PetscClassId *oclass) | |||
2159 | { | |||
2160 | #if defined(PETSC_USE_LOG1) | |||
2161 | PetscStageLog stageLog; | |||
2162 | PetscInt stage; | |||
2163 | PetscErrorCode ierr; | |||
2164 | #endif | |||
2165 | ||||
2166 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 2166; petscstack-> petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); | |||
2167 | *oclass = ++PETSC_LARGEST_CLASSID; | |||
2168 | #if defined(PETSC_USE_LOG1) | |||
2169 | ierr = PetscLogGetStageLog(&stageLog);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),2169,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
2170 | ierr = PetscClassRegLogRegister(stageLog->classLog, name, *oclass);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),2170,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
2171 | for (stage = 0; stage < stageLog->numStages; stage++) { | |||
2172 | ierr = PetscClassPerfLogEnsureSize(stageLog->stageInfo[stage].classLog, stageLog->classLog->numClasses);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),2172,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
2173 | } | |||
2174 | #endif | |||
2175 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
2176 | } | |||
2177 | ||||
2178 | #if defined(PETSC_USE_LOG1) && defined(PETSC_HAVE_MPE) | |||
2179 | #include <mpe.h> | |||
2180 | ||||
2181 | PetscBool PetscBeganMPE = PETSC_FALSE; | |||
2182 | ||||
2183 | PETSC_INTERNextern __attribute__((visibility ("hidden"))) PetscErrorCode PetscLogEventBeginMPE(PetscLogEvent,int,PetscObject,PetscObject,PetscObject,PetscObject); | |||
2184 | PETSC_INTERNextern __attribute__((visibility ("hidden"))) PetscErrorCode PetscLogEventEndMPE(PetscLogEvent,int,PetscObject,PetscObject,PetscObject,PetscObject); | |||
2185 | ||||
2186 | /*@C | |||
2187 | PetscLogMPEBegin - Turns on MPE logging of events. This creates large log files | |||
2188 | and slows the program down. | |||
2189 | ||||
2190 | Collective over PETSC_COMM_WORLD | |||
2191 | ||||
2192 | Options Database Keys: | |||
2193 | . -log_mpe - Prints extensive log information | |||
2194 | ||||
2195 | Notes: | |||
2196 | A related routine is PetscLogDefaultBegin() (with the options key -log_view), which is | |||
2197 | intended for production runs since it logs only flop rates and object | |||
2198 | creation (and should not significantly slow the programs). | |||
2199 | ||||
2200 | Level: advanced | |||
2201 | ||||
2202 | ||||
2203 | .seealso: PetscLogDump(), PetscLogDefaultBegin(), PetscLogAllBegin(), PetscLogEventActivate(), | |||
2204 | PetscLogEventDeactivate() | |||
2205 | @*/ | |||
2206 | PetscErrorCode PetscLogMPEBegin(void) | |||
2207 | { | |||
2208 | PetscErrorCode ierr; | |||
2209 | ||||
2210 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 2210; petscstack-> petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); | |||
2211 | /* Do MPE initialization */ | |||
2212 | if (!MPE_Initialized_logging()) { /* This function exists in mpich 1.1.2 and higher */ | |||
2213 | ierr = PetscInfo(0,"Initializing MPE.\n")PetscInfo_Private(__func__,0,"Initializing MPE.\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),2213,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
2214 | ierr = MPE_Init_log();CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),2214,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
2215 | ||||
2216 | PetscBeganMPE = PETSC_TRUE; | |||
2217 | } else { | |||
2218 | ierr = PetscInfo(0,"MPE already initialized. Not attempting to reinitialize.\n")PetscInfo_Private(__func__,0,"MPE already initialized. Not attempting to reinitialize.\n" );CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),2218,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
2219 | } | |||
2220 | ierr = PetscLogSet(PetscLogEventBeginMPE, PetscLogEventEndMPE);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),2220,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
2221 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
2222 | } | |||
2223 | ||||
2224 | /*@C | |||
2225 | PetscLogMPEDump - Dumps the MPE logging info to file for later use with Jumpshot. | |||
2226 | ||||
2227 | Collective over PETSC_COMM_WORLD | |||
2228 | ||||
2229 | Level: advanced | |||
2230 | ||||
2231 | .seealso: PetscLogDump(), PetscLogAllBegin(), PetscLogMPEBegin() | |||
2232 | @*/ | |||
2233 | PetscErrorCode PetscLogMPEDump(const char sname[]) | |||
2234 | { | |||
2235 | char name[PETSC_MAX_PATH_LEN4096]; | |||
2236 | PetscErrorCode ierr; | |||
2237 | ||||
2238 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 2238; petscstack-> petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); | |||
2239 | if (PetscBeganMPE) { | |||
2240 | ierr = PetscInfo(0,"Finalizing MPE.\n")PetscInfo_Private(__func__,0,"Finalizing MPE.\n");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),2240,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
2241 | if (sname) { | |||
2242 | ierr = PetscStrcpy(name,sname);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),2242,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
2243 | } else { | |||
2244 | ierr = PetscGetProgramName(name,PETSC_MAX_PATH_LEN4096);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),2244,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
2245 | } | |||
2246 | ierr = MPE_Finish_log(name);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),2246,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
2247 | } else { | |||
2248 | ierr = PetscInfo(0,"Not finalizing MPE (not started by PETSc).\n")PetscInfo_Private(__func__,0,"Not finalizing MPE (not started by PETSc).\n" );CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm )0x44000001),2248,__func__,"/sandbox/petsc/petsc.master/src/sys/logging/plog.c" ,ierr,PETSC_ERROR_REPEAT," ");} while (0); | |||
2249 | } | |||
2250 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
2251 | } | |||
2252 | ||||
2253 | #define PETSC_RGB_COLORS_MAX 39 | |||
2254 | static const char *PetscLogMPERGBColors[PETSC_RGB_COLORS_MAX] = { | |||
2255 | "OliveDrab: ", | |||
2256 | "BlueViolet: ", | |||
2257 | "CadetBlue: ", | |||
2258 | "CornflowerBlue: ", | |||
2259 | "DarkGoldenrod: ", | |||
2260 | "DarkGreen: ", | |||
2261 | "DarkKhaki: ", | |||
2262 | "DarkOliveGreen: ", | |||
2263 | "DarkOrange: ", | |||
2264 | "DarkOrchid: ", | |||
2265 | "DarkSeaGreen: ", | |||
2266 | "DarkSlateGray: ", | |||
2267 | "DarkTurquoise: ", | |||
2268 | "DeepPink: ", | |||
2269 | "DarkKhaki: ", | |||
2270 | "DimGray: ", | |||
2271 | "DodgerBlue: ", | |||
2272 | "GreenYellow: ", | |||
2273 | "HotPink: ", | |||
2274 | "IndianRed: ", | |||
2275 | "LavenderBlush: ", | |||
2276 | "LawnGreen: ", | |||
2277 | "LemonChiffon: ", | |||
2278 | "LightCoral: ", | |||
2279 | "LightCyan: ", | |||
2280 | "LightPink: ", | |||
2281 | "LightSalmon: ", | |||
2282 | "LightSlateGray: ", | |||
2283 | "LightYellow: ", | |||
2284 | "LimeGreen: ", | |||
2285 | "MediumPurple: ", | |||
2286 | "MediumSeaGreen: ", | |||
2287 | "MediumSlateBlue:", | |||
2288 | "MidnightBlue: ", | |||
2289 | "MintCream: ", | |||
2290 | "MistyRose: ", | |||
2291 | "NavajoWhite: ", | |||
2292 | "NavyBlue: ", | |||
2293 | "OliveDrab: " | |||
2294 | }; | |||
2295 | ||||
2296 | /*@C | |||
2297 | PetscLogMPEGetRGBColor - This routine returns a rgb color useable with PetscLogEventRegister() | |||
2298 | ||||
2299 | Not collective. Maybe it should be? | |||
2300 | ||||
2301 | Output Parameter | |||
2302 | . str - character string representing the color | |||
2303 | ||||
2304 | Level: developer | |||
2305 | ||||
2306 | .seealso: PetscLogEventRegister | |||
2307 | @*/ | |||
2308 | PetscErrorCode PetscLogMPEGetRGBColor(const char *str[]) | |||
2309 | { | |||
2310 | static int idx = 0; | |||
2311 | ||||
2312 | PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize < 64)) { petscstack->function[petscstack->currentsize ] = __func__; petscstack->file[petscstack->currentsize] = "/sandbox/petsc/petsc.master/src/sys/logging/plog.c"; petscstack ->line[petscstack->currentsize] = 2312; petscstack-> petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack ->currentsize++; } if (petscstack) { petscstack->hotdepth += (PETSC_FALSE || petscstack->hotdepth); } ; } while (0) ; ; } while (0); | |||
2313 | *str = PetscLogMPERGBColors[idx]; | |||
2314 | idx = (idx + 1)% PETSC_RGB_COLORS_MAX; | |||
2315 | PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize > 0) { petscstack->currentsize--; petscstack->function [petscstack->currentsize] = 0; petscstack->file[petscstack ->currentsize] = 0; petscstack->line[petscstack->currentsize ] = 0; petscstack->petscroutine[petscstack->currentsize ] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth = (((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack-> hotdepth-1)); } ; } while (0); return(0);} while (0); | |||
2316 | } | |||
2317 | ||||
2318 | #endif /* PETSC_USE_LOG && PETSC_HAVE_MPE */ |