Blame view

fvn_sparse/UMFPACK/MATLAB/umfpack_report.m 15.6 KB
422234dc3   daniau   git-svn-id: https...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
  function umfpack_report (Control, Info)
  %UMFPACK_REPORT prints optional control settings and statistics
  %
  %   Example:
  %       umfpack_report (Control, Info) ;
  %
  % Prints the current Control settings for umfpack2, and the statistical
  % information returned by umfpack2 in the Info array.  If Control is
  % an empty matrix, then the default control settings are printed.
  %
  % Control is 20-by-1, and Info is 90-by-1.  Not all entries are used.
  %
  % Alternative usages:
  %
  %       umfpack_report ([ ], Info) ;    print the default control parameters
  %                                       and the Info array.
  %       umfpack_report (Control) ;      print the control parameters only.
  %       umfpack_report ;                print the default control parameters
  %                                       and an empty Info array.
  %
  % See also umfpack, umfpack2, umfpack_make, umfpack_details,
  % umfpack_demo, and umfpack_simple.
  
  % Copyright 1995-2007 by Timothy A. Davis.
  
  %-------------------------------------------------------------------------------
  % get inputs, use defaults if input arguments not present
  %-------------------------------------------------------------------------------
  
  % The contents of Control and Info are defined in umfpack.h
  if (nargin < 1)
      Control = [] ;
  end
  if (nargin < 2)
      Info = [] ;
  end
  if (isempty (Control))
      Control = umfpack2 ;
  end
  if (isempty (Info))
      Info = [ 0 (-ones (1, 89)) ] ;
  end
  
  %-------------------------------------------------------------------------------
  % control settings
  %-------------------------------------------------------------------------------
  
  fprintf ('
  UMFPACK:  Control settings:
  
  ') ;
  fprintf ('    Control (1): print level: %d
  ', Control (1)) ;
  fprintf ('    Control (2): dense row parameter:    %g
  ', Control (2)) ;
  fprintf ('       "dense" rows have    > max (16, (%g)*16*sqrt(n_col)) entries
  ', Control (2)) ;
  fprintf ('    Control (3): dense column parameter: %g
  ', Control (3)) ;
  fprintf ('       "dense" columns have > max (16, (%g)*16*sqrt(n_row)) entries
  ', Control (3)) ;
  fprintf ('    Control (4): pivot tolerance: %g
  ', Control (4)) ;
  fprintf ('    Control (5): max block size for dense matrix kernels: %d
  ', Control (5)) ;
  prstrat ('    Control (6): strategy: %g ', Control (6)) ;
  fprintf ('    Control (7): initial allocation ratio: %g
  ', Control (7)) ;
  fprintf ('    Control (8): max iterative refinement steps: %d
  ', Control (8)) ;
  fprintf ('    Control (13): 2-by-2 pivot tolerance: %g
  ', Control (13)) ;
  fprintf ('    Control (14): Q fixed during numeric factorization: %g ', Control (14)) ;
  if (Control (14) > 0)
      fprintf ('(yes)
  ') ;
  elseif (Control (14) < 0)
      fprintf ('(no)
  ') ;
  else
      fprintf ('(auto)
  ') ;
  end
  fprintf ('    Control (15): AMD dense row/column parameter: %g
  ', Control (15)) ;
  fprintf ('       "dense" rows/columns in A+A'' have > max (16, (%g)*sqrt(n)) entries.
  ', Control (15)) ;
  fprintf ('        Only used if the AMD ordering is used.
  ') ;
  fprintf ('    Control (16): diagonal pivot tolerance: %g
  ', Control (16)) ;
  fprintf ('        Only used if diagonal pivoting is attempted.
  ') ;
  
  fprintf ('    Control (17): scaling option: %g ', Control (17)) ;
  if (Control (17) == 0)
      fprintf ('(none)
  ') ;
  elseif (Control (17) == 2)
      fprintf ('(scale the matrix by
  ') ;
      fprintf ('        dividing each row by max. abs. value in each row)
  ') ;
  else
      fprintf ('(scale the matrix by
  ') ;
      fprintf ('        dividing each row by sum of abs. values in each row)
  ') ;
  end
  
  fprintf ('    Control (18): frontal matrix allocation ratio: %g
  ', Control (18)) ;
  fprintf ('    Control (19): drop tolerance: %g
  ', Control (19)) ;
  fprintf ('    Control (20): AMD and COLAMD aggressive absorption: %g ', Control (20)) ;
  yes_no (Control (20)) ;
  
  % compile-time options:
  
  fprintf ('
    The following options can only be changed at compile-time:
  ') ;
  
  if (Control (9) == 1)
      fprintf ('    Control (9): compiled to use the BLAS
  ') ;
  else
      fprintf ('    Control (9): compiled without the BLAS
  ') ;
      fprintf ('        (you will not get the best possible performance)
  ') ;
  end
  
  if (Control (10) == 1)
      fprintf ('    Control (10): compiled for MATLAB
  ') ;
  elseif (Control (10) == 2)
      fprintf ('    Control (10): compiled for MATLAB
  ') ;
  else
      fprintf ('    Control (10): not compiled for MATLAB
  ') ;
      fprintf ('        Printing will be in terms of 0-based matrix indexing,
  ') ;
      fprintf ('        not 1-based as is expected in MATLAB.  Diary output may
  ') ;
      fprintf ('        not be properly recorded.
  ') ;
  end
  
  if (Control (11) == 2)
      fprintf ('    Control (11): uses POSIX times ( ) to get CPU time and wallclock time.
  ') ;
  elseif (Control (11) == 1)
      fprintf ('    Control (11): uses getrusage to get CPU time.
  ') ;
  else
      fprintf ('    Control (11): uses ANSI C clock to get CPU time.
  ') ;
      fprintf ('        The CPU time may wrap around, type "help cputime".
  ') ;
  end
  
  if (Control (12) == 1)
      fprintf ('    Control (12): compiled with debugging enabled
  ') ;
      fprintf ('        ###########################################
  ') ;
      fprintf ('        ### This will be exceedingly slow! ########
  ') ;
      fprintf ('        ###########################################
  ') ;
  else
      fprintf ('    Control (12): compiled for normal operation (no debugging)
  ') ;
  end
  
  %-------------------------------------------------------------------------------
  % Info:
  %-------------------------------------------------------------------------------
  
  if (nargin == 1)
      return
  end
  
  status = Info (1) ;
  fprintf ('
  UMFPACK status:  Info (1): %d, ', status) ;
  
  if (status == 0)
      fprintf ('OK
  ') ;
  elseif (status == 1)
      fprintf ('WARNING  matrix is singular
  ') ;
  elseif (status == -1)
      fprintf ('ERROR    out of memory
  ') ;
  elseif (status == -3)
      fprintf ('ERROR    numeric LU factorization is invalid
  ') ;
  elseif (status == -4)
      fprintf ('ERROR    symbolic LU factorization is invalid
  ') ;
  elseif (status == -5)
      fprintf ('ERROR    required argument is missing
  ') ;
  elseif (status == -6)
      fprintf ('ERROR    n <= 0
  ') ;
  elseif (status <= -7 & status >= -12 | status == -14)			    %#ok
      fprintf ('ERROR    matrix A is corrupted
  ') ;
  elseif (status == -13)
      fprintf ('ERROR    invalid system
  ') ;
  elseif (status == -15)
      fprintf ('ERROR    invalid permutation
  ') ;
  elseif (status == -911)
      fprintf ('ERROR    internal error!
  ') ;
      fprintf ('Please report this error to Tim Davis (davis@cise.ufl.edu)
  ') ;
  else
      fprintf ('ERROR    unrecognized error.  Info array corrupted
  ') ;
  end
  
  fprintf ('    (a -1 means the entry has not been computed):
  ') ;
  
  fprintf ('
    Basic statistics:
  ') ;
  fprintf ('    Info (2):  %d, # of rows of A
  ', Info (2)) ;
  fprintf ('    Info (17): %d, # of columns of A
  ', Info (17)) ;
  fprintf ('    Info (3): %d, nnz (A)
  ', Info (3)) ;
  fprintf ('    Info (4): %d, Unit size, in bytes, for memory usage reported below
  ', Info (4)) ;
  fprintf ('    Info (5): %d, size of int (in bytes)
  ', Info (5)) ;
  fprintf ('    Info (6): %d, size of UF_long (in bytes)
  ', Info (6)) ;
  fprintf ('    Info (7): %d, size of pointer (in bytes)
  ', Info (7)) ;
  fprintf ('    Info (8): %d, size of numerical entry (in bytes)
  ', Info (8)) ;
  
  fprintf ('
    Pivots with zero Markowitz cost removed to obtain submatrix S:
  ') ;
  fprintf ('    Info (57): %d, # of pivots with one entry in pivot column
  ', Info (57)) ;
  fprintf ('    Info (58): %d, # of pivots with one entry in pivot row
  ', Info (58)) ;
  fprintf ('    Info (59): %d, # of rows/columns in submatrix S (if square)
  ', Info (59)) ;
  fprintf ('    Info (60): ') ;
  if (Info (60) > 0)
      fprintf ('submatrix S square and diagonal preserved
  ') ;
  elseif (Info  (60) == 0)
      fprintf ('submatrix S not square or diagonal not preserved
  ') ;
  else
      fprintf ('
  ') ;
  end
  fprintf ('    Info (9):  %d, # of "dense" rows in S
  ', Info (9)) ;
  fprintf ('    Info (10): %d, # of empty rows in S
  ', Info (10)) ;
  fprintf ('    Info (11): %d, # of "dense" columns in S
  ', Info (11)) ;
  fprintf ('    Info (12): %d, # of empty columns in S
  ', Info (12)) ;
  fprintf ('    Info (34): %g, symmetry of pattern of S
  ', Info (34)) ;
  fprintf ('    Info (35): %d, # of off-diagonal nonzeros in S+S''
  ', Info (35)) ;
  fprintf ('    Info (36): %d, nnz (diag (S))
  ', Info (36)) ;
  
  fprintf ('
    2-by-2 pivoting to place large entries on diagonal:
  ') ;
  fprintf ('    Info (52): %d, # of small diagonal entries of S
  ', Info (52)) ;
  fprintf ('    Info (53): %d, # of unmatched small diagonal entries
  ', Info (53)) ;
  fprintf ('    Info (54): %g, symmetry of P2*S
  ', Info (54)) ;
  fprintf ('    Info (55): %d, # of off-diagonal entries in (P2*S)+(P2*S)''
  ', Info (55)) ;
  fprintf ('    Info (56): %d, nnz (diag (P2*S))
  ', Info (56)) ;
  
  fprintf ('
    AMD results, for strict diagonal pivoting:
  ') ;
  fprintf ('    Info (37): %d, est. nz in L and U
  ', Info (37)) ;
  fprintf ('    Info (38): %g, est. flop count
  ', Info (38)) ;
  fprintf ('    Info (39): %g, # of "dense" rows in S+S''
  ', Info (39)) ;
  fprintf ('    Info (40): %g, est. max. nz in any column of L
  ', Info (40)) ;
  
  fprintf ('
    Final strategy selection, based on the analysis above:
  ') ;
  prstrat ('    Info (19): %d, strategy used ', Info (19)) ;
  fprintf ('    Info (20): %d, ordering used ', Info (20)) ;
  if (Info (20) == 0)
      fprintf ('(COLAMD on A)
  ') ;
  elseif (Info (20) == 1)
      fprintf ('(AMD on A+A'')
  ') ;
  elseif (Info (20) == 2)
      fprintf ('(provided by user)
  ') ;
  else
      fprintf ('(undefined ordering option)
  ') ;
  end
  fprintf ('    Info (32): %d, Q fixed during numeric factorization: ', Info (32)) ;
  yes_no (Info (32)) ;
  fprintf ('    Info (33): %d, prefer diagonal pivoting: ', Info (33)) ;
  yes_no (Info (33)) ;
  
  fprintf ('
    symbolic analysis time and memory usage:
  ') ;
  fprintf ('    Info (13): %d, defragmentations during symbolic analysis
  ', Info (13)) ;
  fprintf ('    Info (14): %d, memory used during symbolic analysis (Units)
  ', Info (14)) ;
  fprintf ('    Info (15): %d, final size of symbolic factors (Units)
  ', Info (15)) ;
  fprintf ('    Info (16): %.2f, symbolic analysis CPU time (seconds)
  ', Info (16)) ;
  fprintf ('    Info (18): %.2f, symbolic analysis wall clock time (seconds)
  ', Info (18)) ;
  
  fprintf ('
    Estimates computed in the symbolic analysis:
  ') ;
  fprintf ('    Info (21): %d, est. size of LU factors (Units)
  ', Info (21)) ;
  fprintf ('    Info (22): %d, est. total peak memory usage (Units)
  ', Info (22)) ;
  fprintf ('    Info (23): %d, est. factorization flop count
  ', Info (23)) ;
  fprintf ('    Info (24): %d, est. nnz (L)
  ', Info (24)) ;
  fprintf ('    Info (25): %d, est. nnz (U)
  ', Info (25)) ;
  fprintf ('    Info (26): %d, est. initial size, variable-part of LU (Units)
  ', Info (26)) ;
  fprintf ('    Info (27): %d, est. peak size, of variable-part of LU (Units)
  ', Info (27)) ;
  fprintf ('    Info (28): %d, est. final size, of variable-part of LU (Units)
  ', Info (28)) ;
  fprintf ('    Info (29): %d, est. max frontal matrix size (# of entries)
  ', Info (29)) ;
  fprintf ('    Info (30): %d, est. max # of rows in frontal matrix
  ', Info (30)) ;
  fprintf ('    Info (31): %d, est. max # of columns in frontal matrix
  ', Info (31)) ;
  
  fprintf ('
    Computed in the numeric factorization (estimates shown above):
  ') ;
  fprintf ('    Info (41): %d, size of LU factors (Units)
  ', Info (41)) ;
  fprintf ('    Info (42): %d, total peak memory usage (Units)
  ', Info (42)) ;
  fprintf ('    Info (43): %d, factorization flop count
  ', Info (43)) ;
  fprintf ('    Info (44): %d, nnz (L)
  ', Info (44)) ;
  fprintf ('    Info (45): %d, nnz (U)
  ', Info (45)) ;
  fprintf ('    Info (46): %d, initial size of variable-part of LU (Units)
  ', Info (46)) ;
  fprintf ('    Info (47): %d, peak size of variable-part of LU (Units)
  ', Info (47)) ;
  fprintf ('    Info (48): %d, final size of variable-part of LU (Units)
  ', Info (48)) ;
  fprintf ('    Info (49): %d, max frontal matrix size (# of numerical entries)
  ', Info (49)) ;
  fprintf ('    Info (50): %d, max # of rows in frontal matrix
  ', Info (50)) ;
  fprintf ('    Info (51): %d, max # of columns in frontal matrix
  ', Info (51)) ;
  
  fprintf ('
    Computed in the numeric factorization (no estimates computed a priori):
  ') ;
  fprintf ('    Info (61): %d, defragmentations during numeric factorization
  ', Info (61)) ;
  fprintf ('    Info (62): %d, reallocations during numeric factorization
  ', Info (62)) ;
  fprintf ('    Info (63): %d, costly reallocations during numeric factorization
  ', Info (63)) ;
  fprintf ('    Info (64): %d, integer indices in compressed pattern of L and U
  ', Info (64)) ;
  fprintf ('    Info (65): %d, numerical values stored in L and U
  ', Info (65)) ;
  fprintf ('    Info (66): %.2f, numeric factorization CPU time (seconds)
  ', Info (66)) ;
  fprintf ('    Info (76): %.2f, numeric factorization wall clock time (seconds)
  ', Info (76)) ;
  if (Info (66) > 0.05 & Info (43) > 0)					    %#ok
  fprintf ('    mflops in numeric factorization phase: %.2f
  ', 1e-6 * Info (43) / Info (66)) ;
  end
  fprintf ('    Info (67): %d, nnz (diag (U))
  ', Info (67)) ;
  fprintf ('    Info (68): %g, reciprocal condition number estimate
  ', Info (68)) ;
  fprintf ('    Info (69): %g, matrix was ', Info (69)) ;
  if (Info (69) == 0)
      fprintf ('not scaled
  ') ;
  elseif (Info (69) == 2)
      fprintf ('scaled (row max)
  ') ;
  else
      fprintf ('scaled (row sum)
  ') ;
  end
  fprintf ('    Info (70): %g, min. scale factor of rows of A
  ', Info (70)) ;
  fprintf ('    Info (71): %g, max. scale factor of rows of A
  ', Info (71)) ;
  fprintf ('    Info (72): %g, min. abs. on diagonal of U
  ', Info (72)) ;
  fprintf ('    Info (73): %g, max. abs. on diagonal of U
  ', Info (73)) ;
  fprintf ('    Info (74): %g, initial allocation parameter used
  ', Info (74)) ;
  fprintf ('    Info (75): %g, # of forced updates due to frontal growth
  ', Info (75)) ;
  fprintf ('    Info (77): %d, # of off-diaogonal pivots
  ', Info (77)) ;
  fprintf ('    Info (78): %d, nnz (L), if no small entries dropped
  ', Info (78)) ;
  fprintf ('    Info (79): %d, nnz (U), if no small entries dropped
  ', Info (79)) ;
  fprintf ('    Info (80): %d, # of small entries dropped
  ', Info (80)) ;
  
  fprintf ('
    Computed in the solve step:
  ') ;
  fprintf ('    Info (81): %d, iterative refinement steps taken
  ', Info (81)) ;
  fprintf ('    Info (82): %d, iterative refinement steps attempted
  ', Info (82)) ;
  fprintf ('    Info (83): %g, omega(1), sparse-backward error estimate
  ', Info (83)) ;
  fprintf ('    Info (84): %g, omega(2), sparse-backward error estimate
  ', Info (84)) ;
  fprintf ('    Info (85): %d, solve flop count
  ', Info (85)) ;
  fprintf ('    Info (86): %.2f, solve CPU time (seconds)
  ', Info (86)) ;
  fprintf ('    Info (87): %.2f, solve wall clock time (seconds)
  ', Info (87)) ;
  
  fprintf ('
      Info (88:90): unused
  
  ') ;
  
  %-------------------------------------------------------------------------------
  
  function prstrat (fmt, strategy)
  % prstrat print the ordering strategy
  fprintf (fmt, strategy) ;
  if (strategy == 1)
      fprintf ('(unsymmetric)
  ') ;
      fprintf ('        Q = COLAMD (A), Q refined during numerical
  ') ;
      fprintf ('        factorization, and no attempt at diagonal pivoting.
  ') ;
  elseif (strategy == 2)
      fprintf ('(symmetric, with 2-by-2 pivoting)
  ') ;
      fprintf ('        P2 = row permutation to place large values on the diagonal
  ') ;
      fprintf ('        Q = AMD (P2*A+(P2*A)''), Q not refined during numeric factorization,
  ') ;
      fprintf ('        and diagonal pivoting attempted.
  ') ;
  elseif (strategy == 3)
      fprintf ('(symmetric)
  ') ;
      fprintf ('        Q = AMD (A+A''), Q not refined during numeric factorization,
  ') ;
      fprintf ('        and diagonal pivoting (P=Q'') attempted.
  ') ;
  else
      % strategy = 0 ;
      fprintf ('(auto)
  ') ;
  end
  
  %-------------------------------------------------------------------------------
  
  function yes_no (s)
  % yes_no print yes or no
  if (s == 0)
      fprintf ('(no)
  ') ;
  else
      fprintf ('(yes)
  ') ;
  end