[petsc-users] Some routines are very expensive, such as DMPlexGetSupport and DMPlexPointLocalRef.

Matthew Knepley knepley at gmail.com
Sun Dec 4 07:34:49 CST 2016


On Sun, Dec 4, 2016 at 1:58 AM, leejearl <leejearl at 126.com> wrote:

> Hi, all PETSc developer:
>     Thank you for your great works. I have deploy my fvm code based on the
> PETSc.
> It works well, and the results are beautiful. But I found a problem that
> some of the
> functions, such as DMPlexGetSupport and DMPlexPointLocalRef, are very
> expensive.
> <http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMPlexPointLocalRef.html>
>

I can believe that some parts are expensive, but I think it is probably
something other than
GetSupport() and PointLocalRef(). Lets look at the code. First support is
just two pointer lookups


https://bitbucket.org/petsc/petsc/src/8191f1e31285033beeebf70760bc9786361aefca/src/dm/impls/plex/plex.c?at=master&fileviewer=file-view-default#plex.c-1502

and for Point LocalRef() its one lookup and arithmetic


https://bitbucket.org/petsc/petsc/src/8191f1e31285033beeebf70760bc9786361aefca/src/dm/impls/plex/plexpoint.c?at=master&fileviewer=file-view-default#plexpoint.c-105

I have benchmark code that runs these, and they should definitely take <
1e-7s, and maybe
10-100 times less. You can look at Plex test ex9 to see some of it.

What is taking a lot of time?

  Thanks,

     Matt

It costs a lot of times if such routines are involved. Is there any method
> one can use to reduce
> the time costs and improve the efficiency of the executable applications?
>      Thanks
> leejearl
>
-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20161204/bb3a9d82/attachment.html>


More information about the petsc-users mailing list