猿代码 — 科研/AI模型/高性能计算
0

sxamg编译及测试

摘要: https://github.com/huiscliu/sxamg下面的example1)./amgsx: problem size: 236600, 130 x 130 x 14.A: m = 236600, n = 236600, nnz = 1615120 AMG Parameters--------------------------------------------- ...
https://github.com/huiscliu/sxamg
下面的example

1)
./amg

sx: problem size: 236600, 130 x 130 x 14.
A: m = 236600, n = 236600, nnz = 1615120

               AMG Parameters
-----------------------------------------------------------
AMG print level:                   3
AMG max num of iter:               1000
AMG tol:                           1e-06
AMG ctol:                          1e-07
AMG max levels:                    30
AMG cycle type:                    1
AMG smoother type:                 2
AMG smoother order:                1
AMG num of presmoothing:           2
AMG num of postsmoothing:          2
AMG coarsening type:               2
AMG interpolation type:            2
AMG dof on coarsest grid:          10
AMG strong threshold:              0.3000
AMG truncation threshold:          0.2000
AMG max row sum:                   0.9000
AMG coarest solver:                1
-----------------------------------------------------------
### WARNING: Coarse matrix is too dense!
### WARNING: m = n = 191, nnz = 8083!
-----------------------------------------------------------
  Level   Num of rows   Num of nonzeros   Avg. NNZ / row
-----------------------------------------------------------
    0        236600           1615120           6.83
    1        118300           2125008          17.96
    2         19724            616548          31.26
    3          2583            118463          45.86
    4           617             31635          51.27
    5           191              8083          42.32
-----------------------------------------------------------
  Grid complexity = 1.598  |  Operator complexity = 2.795
-----------------------------------------------------------
AMG setup time: 2.08698 s
AMG setup time: 2.08708 s
-----------------------------------------------------------
It Num |   ||r||/||b||   |     ||r||      |  Conv. Factor
-----------------------------------------------------------
     0 |  1.000000e+00   |  4.864155e+02  |     -.--
     1 |  5.509402e-02   |  2.679858e+01  |     0.0551
     2 |  2.312168e-03   |  1.124674e+00  |     0.0420
     3 |  9.514382e-05   |  4.627943e-02  |     0.0411
     4 |  3.903498e-06   |  1.898722e-03  |     0.0410
     5 |  1.604449e-07   |  7.804290e-05  |     0.0411
AMG solve time: 0.969601 s
AMG totally time: 3.06794 s
AMG residual: 7.80429e-05
AMG relative residual: 1.60445e-07
AMG iterations: 5

2)
./amg-low-level
sx: problem size: 88560, 123 x 30 x 24.

A: m = 88560, n = 88560, nnz = 605196

               AMG Parameters
-----------------------------------------------------------
AMG print level:                   2
AMG max num of iter:               1000
AMG tol:                           1e-06
AMG ctol:                          1e-07
AMG max levels:                    30
AMG cycle type:                    1
AMG smoother type:                 2
AMG smoother order:                1
AMG num of presmoothing:           2
AMG num of postsmoothing:          2
AMG coarsening type:               2
AMG interpolation type:            2
AMG dof on coarsest grid:          10
AMG strong threshold:              0.3000
AMG truncation threshold:          0.2000
AMG max row sum:                   0.9000
AMG coarest solver:                1
-----------------------------------------------------------
### WARNING: Coarse matrix is too dense!
### WARNING: m = n = 263, nnz = 17397!
-----------------------------------------------------------
  Level   Num of rows   Num of nonzeros   Avg. NNZ / row
-----------------------------------------------------------
    0         88560            605196           6.83
    1         44280            797502          18.01
    2          7383            233449          31.62
    3          1025             52525          51.24
    4           263             17397          66.15
-----------------------------------------------------------
  Grid complexity = 1.598  |  Operator complexity = 2.819
-----------------------------------------------------------
AMG setup time: 0.707301 s
-----------------------------------------------------------
It Num |   ||r||/||b||   |     ||r||      |  Conv. Factor
-----------------------------------------------------------
     0 |  1.000000e+00   |  2.975903e+02  |     -.--
     1 |  6.597986e-02   |  1.963497e+01  |     0.0660
     2 |  3.432394e-03   |  1.021447e+00  |     0.0520
     3 |  1.781948e-04   |  5.302905e-02  |     0.0519
     4 |  9.220834e-06   |  2.744031e-03  |     0.0517
     5 |  4.756874e-07   |  1.415600e-04  |     0.0516
AMG solve time: 0.295148 s
AMG residual: 0.00014156
AMG relative residual: 4.75687e-07
AMG iterations: 5

3)
./cg-amg
sx: problem size: 178596, 123 x 33 x 44.
A: m = 178596, n = 178596, nnz = 1228326

sx: solver: CG, preconditioner: AMG
Convergence settings: relative residual: 1.000000e-06, maximal iterations: 2000

Initial residual: 4.226062e+02

itr:      1,     residual: 3.076031e+01, relative error: 7.278717e-02
itr:      2,     residual: 1.372795e+00, relative error: 3.248403e-03
itr:      3,     residual: 3.617905e-02, relative error: 8.560937e-05
itr:      4,     residual: 4.572409e-04, relative error: 1.081955e-06
itr:      5,     residual: 3.411769e-05, relative error: 8.073163e-08

cg converged: absolute residual: 3.411769e-05, total iterations: 5, time: 0.909855 s
verify cg residual: absolute residual: 3.411769e-05, total iterations: 4

转化成矩阵,再采用AMG,加速效果应该比比较明显,
YHAMG效果可能会更好。



说点什么...

已有0条评论

最新评论...

本文作者
2024-2-25 02:01
  • 0
    粉丝
  • 235
    阅读
  • 0
    回复
资讯幻灯片
热门评论
热门专题
排行榜
Copyright   ©2015-2023   猿代码-超算人才智造局 高性能计算|并行计算|人工智能      ( 京ICP备2021026424号-2 )