[petsc-users] MatFDColorCreate takes really big portion of the total time
Bao Kai
paeanball at gmail.com
Tue Jun 26 14:22:40 CDT 2012
Hi, all,
I use the SNES in petsc-3.2 to solve my problem. The problem is a 3-D
finite difference problem with structured grid.
I use MatFDColorCreate to generate the Jacobian matrix. I just found
that when the size of problem is big, MatFDColorCreate takes really
long time. The following results is the summary with size of the mesh
to be 1000^3. 90% of the time is costed in MatFDColorCreate.
237 MatGetOrdering 1 1.0 1.3502e-03 1.1 0.00e+00 0.0
0.0e+00 0.0e+00 2.0e+00 0 0 0 0 0 0 0 0 0 0 0
238 MatZeroEntries 39 1.0 9.2822e-02 1.2 0.00e+00 0.0
0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0
239 MatFDColorCreate 10 1.0 3.2863e+03 1.0 0.00e+00 0.0
1.6e+07 5.0e+02 6.8e+02 90 0 0 0 3 90 0 0 0 3 0
240 MatFDColorApply 20 1.0 2.5288e+01 1.0 3.54e+07 1.1
4.6e+08 2.0e+03 8.0e+01 1 0 5 5 0 1 0 5 5 0 42708
241 MatFDColorFunc 560 1.0 9.5386e+00 1.3 0.00e+00 0.0
4.5e+08 2.0e+03 0.0e+00 0 0 5 5 0 0 0 5 5 0 0
And the following the code I use.
262 call DMGetMatrix(solv%da, MATAIJ, solv%jac,ierr)
263 call
DMGetColoring(solv%da,IS_COLORING_GLOBAL,MATAIJ,iscoloring,ierr)
264 call MatFDColoringCreate(solv%jac,iscoloring,matfdcoloring,ierr)
265 call
MatFDColoringSetFunction(matfdcoloring,FormFunction,equ,ierr)
266 call MatFDColoringSetFromOptions(matfdcoloring,ierr)
267 call SNESSetJacobian(solv%snes, solv%jac,
solv%jac,SNESDefaultComputeJacobianColor, matfdcoloring, ierr)
268 call ISColoringDestroy(iscoloring,ierr)
I am wondering if there is anything I can do to improve this problem.
Thank you very much.
Best Regards,
Kai
More information about the petsc-users
mailing list