sieve-dev memory cost for the globalOrder

Matthew Knepley knepley at gmail.com
Tue Sep 16 12:51:19 CDT 2008


On Tue, Sep 16, 2008 at 12:41 PM, Shi Jin <jinzishuai at gmail.com> wrote:
> Hi there,
>
> I am profiling the memory usage of my code and I am surprised to find out
> that the call to getGlobalOrder() cost a lot of memory. For example, the
> following two calls
> const Obj<PETSC_MESH_TYPE::order_type>& velGlobalOrder =
> m->getFactory()->getGlobalOrder(m, vel[0]->getName(), vel[0]);
> const Obj<PETSC_MESH_TYPE::order_type>& preGlobalOrder =
> m->getFactory()->getGlobalOrder(m, p->getName(), p);
> cost about the the same amount of memory as the isieve mesh itself. Is this
> normal?
> I normally think this is simply a fetch of existing data structure which
> should not incur any extra memory allocation.

1) It is only a fetch if the order has been created before. If not, it
is created,
    which costs money.

> The globalOrder is used to do a number of things, such as creating the
> indices visitors. So I would really love to know if there is any improvement
> to be made. Thank you very much.

2) The orders and labels are still old-style set-based data structures. These
    could be optimized for specific uses, but I do not have the time right now.
    The real problem is that every use would have to be modified to allocate
    beforehand.

  Matt

> --
> Sincerely,
> Shi Jin, Ph.D.
> http://www.ualberta.ca/~sjin1/
-- 
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




More information about the sieve-dev mailing list