~ubuntu-branches/ubuntu/karmic/hypre/karmic

« back to all changes in this revision

Viewing changes to src/parcsr_ls/par_stats.c

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV
  • Date: 2009-03-20 11:40:12 UTC
  • mfrom: (4.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090320114012-132h6ok9w2r6o609
Tags: 2.4.0b-2
Rebuild against new openmpi.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*BHEADER**********************************************************************
2
 
 * Copyright (c) 2006   The Regents of the University of California.
 
2
 * Copyright (c) 2008,  Lawrence Livermore National Security, LLC.
3
3
 * Produced at the Lawrence Livermore National Laboratory.
4
 
 * Written by the HYPRE team. UCRL-CODE-222953.
5
 
 * All rights reserved.
6
 
 *
7
 
 * This file is part of HYPRE (see http://www.llnl.gov/CASC/hypre/).
8
 
 * Please see the COPYRIGHT_and_LICENSE file for the copyright notice, 
9
 
 * disclaimer, contact information and the GNU Lesser General Public License.
10
 
 *
11
 
 * HYPRE is free software; you can redistribute it and/or modify it under the 
12
 
 * terms of the GNU General Public License (as published by the Free Software
13
 
 * Foundation) version 2.1 dated February 1999.
14
 
 *
15
 
 * HYPRE is distributed in the hope that it will be useful, but WITHOUT ANY 
16
 
 * WARRANTY; without even the IMPLIED WARRANTY OF MERCHANTABILITY or FITNESS 
17
 
 * FOR A PARTICULAR PURPOSE.  See the terms and conditions of the GNU General
18
 
 * Public License for more details.
19
 
 *
20
 
 * You should have received a copy of the GNU Lesser General Public License
21
 
 * along with this program; if not, write to the Free Software Foundation,
22
 
 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
 
 *
24
 
 * $Revision: 2.20 $
 
4
 * This file is part of HYPRE.  See file COPYRIGHT for details.
 
5
 *
 
6
 * HYPRE is free software; you can redistribute it and/or modify it under the
 
7
 * terms of the GNU Lesser General Public License (as published by the Free
 
8
 * Software Foundation) version 2.1 dated February 1999.
 
9
 *
 
10
 * $Revision: 2.28 $
25
11
 ***********************************************************************EHEADER*/
26
12
 
27
13
 
28
14
 
29
15
 
 
16
 
30
17
#include "headers.h"
31
18
#include "par_amg.h"
32
19
 
34
21
 *
35
22
 * Routine for getting matrix statistics from setup
36
23
 *
 
24
 *
 
25
 * AHB - using block norm 6 (sum of all elements) instead of 1 (frobenius)
 
26
 *
37
27
 *****************************************************************************/
38
28
 
39
29
 
259
249
      {
260
250
        printf(" Coarsening Type = CLJP, fixed random \n");
261
251
      }
 
252
      else if (abs(coarsen_type) == 21) /* BM Aug 29, 2006 */
 
253
      {
 
254
        printf(" Coarsening Type = CGC \n");
 
255
      }
 
256
      else if (abs(coarsen_type) == 22) /* BM Aug 29, 2006 */
 
257
      {
 
258
        printf(" Coarsening Type = CGC-E \n");
 
259
      }
262
260
      /*if (coarsen_type > 0) 
263
261
      {
264
262
        printf(" Hybrid Coarsening (switch to CLJP when coarsening slows)\n");
335
333
        printf(" Interpolation = block classical interpolation with diagonal blocks\n");
336
334
        printf("                 for nodal systems AMG\n");
337
335
      }
 
336
      else if (interp_type == 24) 
 
337
      {
 
338
        printf(" Interpolation = block direct interpolation \n");
 
339
        printf("                 for nodal systems AMG\n");
 
340
      }
 
341
 
 
342
 
338
343
 
339
344
      if (block_mode)
340
345
      {
341
 
         printf( "\nBlock Operator Matrix Information:\n\n");
 
346
         printf( "\nBlock Operator Matrix Information:\n");
 
347
           printf( "(Row sums and weights use sum of all elements in the block -keeping signs)\n\n");
342
348
      }
343
349
      else 
344
350
      {
397
403
            min_entries = (A_diag_i[1]-A_diag_i[0])+(A_offd_i[1]-A_offd_i[0]);
398
404
            for (j = A_diag_i[0]; j < A_diag_i[1]; j++)
399
405
            {
400
 
               hypre_CSRBlockMatrixBlockNorm(1, &A_diag_data[j*bnnz], &tmp_norm, block_size);
 
406
               hypre_CSRBlockMatrixBlockNorm(6, &A_diag_data[j*bnnz], &tmp_norm, block_size);
401
407
               min_rowsum += tmp_norm;
402
408
            }
403
409
            
404
410
            for (j = A_offd_i[0]; j < A_offd_i[1]; j++)
405
411
            {
406
 
               hypre_CSRBlockMatrixBlockNorm(1, &A_offd_data[j*bnnz], &tmp_norm, block_size);
 
412
               hypre_CSRBlockMatrixBlockNorm(6, &A_offd_data[j*bnnz], &tmp_norm, block_size);
407
413
               min_rowsum += tmp_norm;
408
414
            }
409
415
            
418
424
               rowsum = 0.0;
419
425
               for (i = A_diag_i[j]; i < A_diag_i[j+1]; i++)
420
426
               {
421
 
                  hypre_CSRBlockMatrixBlockNorm(1, &A_diag_data[i*bnnz], &tmp_norm, block_size);
 
427
                  hypre_CSRBlockMatrixBlockNorm(6, &A_diag_data[i*bnnz], &tmp_norm, block_size);
422
428
                  rowsum += tmp_norm;
423
429
               }
424
430
               for (i = A_offd_i[j]; i < A_offd_i[j+1]; i++)
425
431
               {
426
 
                  hypre_CSRBlockMatrixBlockNorm(1, &A_offd_data[i*bnnz], &tmp_norm, block_size);
 
432
                  hypre_CSRBlockMatrixBlockNorm(6, &A_offd_data[i*bnnz], &tmp_norm, block_size);
427
433
                  rowsum += tmp_norm;
428
434
               }
429
435
               min_rowsum = hypre_min(rowsum, min_rowsum);
562
568
      if (block_mode)
563
569
      {
564
570
         printf( "\n\nBlock Interpolation Matrix Information:\n\n");
 
571
         printf( "(Row sums and weights use sum of all elements in the block - keeping signs)\n\n");
565
572
      }
566
573
      else 
567
574
      {
568
 
         printf( "\n\nInterpolation Matrix Information:\n\n");
 
575
         printf( "\n\nInterpolation Matrix Information:\n");
 
576
        
569
577
      }
570
578
      
571
579
      printf("                 entries/row    min     max");
611
619
         {
612
620
            if (hypre_CSRBlockMatrixNumCols(P_block_diag)) 
613
621
            {
614
 
               hypre_CSRBlockMatrixBlockNorm(1, &P_diag_data[0], &tmp_norm, block_size);
 
622
               hypre_CSRBlockMatrixBlockNorm(6, &P_diag_data[0], &tmp_norm, block_size);
615
623
               min_weight = tmp_norm;
616
624
            }
617
625
            
618
626
 
619
627
            for (j = P_diag_i[0]; j < P_diag_i[1]; j++)
620
628
            {
621
 
               hypre_CSRBlockMatrixBlockNorm(1, &P_diag_data[j*bnnz], &tmp_norm, block_size);
 
629
               hypre_CSRBlockMatrixBlockNorm(6, &P_diag_data[j*bnnz], &tmp_norm, block_size);
622
630
               min_weight = hypre_min(min_weight, tmp_norm);
623
631
 
624
632
               if (tmp_norm != 1.0)
630
638
            }
631
639
            for (j = P_offd_i[0]; j < P_offd_i[1]; j++)
632
640
            {        
633
 
               hypre_CSRBlockMatrixBlockNorm(1, &P_offd_data[j*bnnz], &tmp_norm, block_size);
 
641
               hypre_CSRBlockMatrixBlockNorm(6, &P_offd_data[j*bnnz], &tmp_norm, block_size);
634
642
               min_weight = hypre_min(min_weight, tmp_norm); 
635
643
 
636
644
              if (tmp_norm != 1.0)
653
661
               rowsum = 0.0;
654
662
               for (i = P_diag_i[j]; i < P_diag_i[j+1]; i++)
655
663
               {
656
 
                  hypre_CSRBlockMatrixBlockNorm(1, &P_diag_data[i*bnnz], &tmp_norm, block_size);
 
664
                  hypre_CSRBlockMatrixBlockNorm(6, &P_diag_data[i*bnnz], &tmp_norm, block_size);
657
665
                  min_weight = hypre_min(min_weight, tmp_norm);
658
666
 
659
667
                  if (tmp_norm != 1.0)
664
672
               
665
673
               for (i = P_offd_i[j]; i < P_offd_i[j+1]; i++)
666
674
               {
667
 
                  hypre_CSRBlockMatrixBlockNorm(1, &P_offd_data[i*bnnz], &tmp_norm, block_size);
 
675
                  hypre_CSRBlockMatrixBlockNorm(6, &P_offd_data[i*bnnz], &tmp_norm, block_size);
668
676
                  min_weight = hypre_min(min_weight, tmp_norm);
669
677
 
670
678
                  if (tmp_norm != 1.0) 
867
875
      printf( "  Cycle type (1 = V, 2 = W, etc.):  %d\n\n", cycle_type);
868
876
      printf( "  Relaxation Parameters:\n");
869
877
      printf( "   Visiting Grid:                     down   up  coarse\n");
870
 
      printf( "            Number of partial sweeps: %4d   %2d  %4d \n",
 
878
      printf( "            Number of sweeps:         %4d   %2d  %4d \n",
871
879
              num_grid_sweeps[1],
872
880
              num_grid_sweeps[2],num_grid_sweeps[3]);
873
881
      printf( "   Type 0=Jac, 3=hGS, 6=hSGS, 9=GE:   %4d   %2d  %4d \n",
1006
1014
      printf( "  Cycle type (1 = V, 2 = W, etc.):  %d\n\n", cycle_type);
1007
1015
      printf( "  Relaxation Parameters:\n");
1008
1016
      printf( "   Visiting Grid:                     down   up  coarse\n");
1009
 
      printf( "   Visiting Grid:                     down   up  coarse\n");
1010
 
      printf( "            Number of partial sweeps: %4d   %2d  %4d \n",
 
1017
      printf( "            Number of sweeps:         %4d   %2d  %4d \n",
1011
1018
              num_grid_sweeps[1],
1012
1019
              num_grid_sweeps[2],num_grid_sweeps[3]);
1013
1020
      printf( "   Type 0=Jac, 3=hGS, 6=hSGS, 9=GE:   %4d   %2d  %4d \n",