- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
并行软件库介绍
赵永华
中国科学院计算机网络信息中心
超级计算中心
yhzhao@
;主要内容 ;;概述;应用领域;HPSEPS功能;软件包架构;软件包涉及到的主要算法;软件包功能模块接口 ;;;稀疏对称特征问题;;;使用HPSEPS编程的方法;;;软件包概述;Hypre:数据结构、求解器和网格接口关系 ;网格接口;迭代法与预条件子;;网格接口与求解器的关系 ;多重网格MG;;Hypre 使用方法;HYPRE_StructVectorSetBoxValues(x, ilower, iupper, xvalues); ... HYPRE_StructVectorAssemble(x);
/* Set up the solver */
HYPRE_StructPFMGCreate(MPI_COMM_WORLD, solver); HYPRE_StructPFMGSetMaxIter(solver, 50); /* optional */ HYPRE_StructPFMGSetTol(solver, 1.0e-06); /* optional */ HYPRE_StructPFMGSetup(solver, A, b, x); %创建求解器(PFMG)
/* Solve the linear system */
HYPRE_StructPFMGSolve(solver, A, b, x); %求解线性方程组
/* Get solution info and free up memory */ %返回结果并释放内存
HYPRE_StructVectorGetBoxValues(x, ilower, iupper, xvalues);
HYPRE_StructPFMGDestroy(solver); HYPRE_StructGridDestroy(grid);
HYPRE_StructStencilDestroy(stencil); HYPRE_StructMatrixDestroy(A);
HYPRE_StructVectorDestroy(b); HYPRE_StructVectorDestroy(x);;算例;Struct和IJ两种界面下, 各求解器的迭代次数和运行时间(256×256,Np=4 )
;;MUMPS概述;主要功能;输入矩阵 ;主要计算步;主要特性;MUMPS应用; ;MUMPS使用方法及实例 ;C Define problem on the host (processor 0)
IF ( id%MYID .eq. 0 ) THEN
READ(5,*) id%N
READ(5,*) id%NZ
ALLOCATE( id%IRN ( id%NZ ) )
ALLOCATE( id%JCN ( id%NZ ) )
ALLOCATE( id%A( id%NZ ) )
ALLOCATE( id%RHS ( id%N ) )
READ(5,*) ( id%IRN(I) ,I=1, id%NZ )
READ(5,*) ( id%JCN(I) ,I=1, id%NZ )
READ(5,*) ( id%A(I),I=1, id%NZ )
READ(5,*) ( id%RHS(I) ,I=1, id%N )
END IF
C Call package for solution
id%JOB = 6
CALL DMUMPS(id)
C Solution has been assembled on the host
IF ( id%MYID .eq. 0 ) THEN
WRITE( 6, * ) ’ Solution is ’,(id%RHS(I),I=1,id%N)
END IF
C Deallocate user data
IF ( id%MYID .eq. 0 )THEN
DEALLOCATE( id%IRN )
DEALLOCATE( id%JCN )
DEALLOCATE( id%A )
DEALLOCATE( id%RHS )
END IF
C Destroy the instance (deallocate internal data structures)
id%JOB = -2
CALL DMUMPS(id)
CALL MPI_FINALIZE(IERR)
STOP
END
;;ParMET
原创力文档


文档评论(0)