[petsc-users] DMSetLabelValue takes a lot of time for large domain

Matthew Knepley knepley at gmail.com
Wed Apr 25 05:16:16 CDT 2018


On Tue, Apr 24, 2018 at 11:57 PM, Danyang Su <danyang.su at gmail.com> wrote:

> Hi All,
>
> I use DMPlex in unstructured grid code and recently found DMSetLabelValue
> takes a lot of time for large problem, e.g., num. of cells > 1 million. In
> my code, I use
>

I read your code wrong. For large loop, you should not use the convenience
function. You should use


> DMPlexCreateFromCellList ()


DMGetLabel(dm, name, &label)


>


> Loop over all cells/nodes{
>
> DMSetLabelValue
>

Replace this by DMLabelSetValue(label, point, val)


> }
>
> DMPlexDistribute
>
> The code works fine except DMSetLabelValue takes a lot of time for large
> problem. I use DMSetLabelValue to set material id for all the nodes or
> cells so that each subdomain has a copy of material id. Is there any other
> functions that can be used more efficient, e.g. set labels by array, not 1
> by 1?
>

That should take much less time.

  Thanks,

     Matt


> Thanks,
>
> Danyang
>
>


-- 
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

https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180425/7d61b575/attachment.html>


More information about the petsc-users mailing list