UFC

Obtaining local sparsity pattern from form and/or *_integral

Registered by Garth Wells

Obtaining local sparsity pattern from form and/or *_integral. The sparsity pattern of a form can be the combined sparsity patterns of the integrals, i.e. a worst-case-scenario, while letting each integral have its own pattern may yield a more optimized pattern with multiple integrals over subdomains. Possible signatures to add in form and/or *_integral:

      /// Return the number of nonzeros in an element tensor
      virtual uint num_nonzeros() const;

      /// Return the number of nonzeros in an element tensor
      virtual void tabulate_sparsity_pattern(uint ** pattern) const

      // Explanation: Either we define (pattern[0][i], pattern[1][i])
      // to hold the row and col of nonzero number i,
      // or (pattern[i][0], pattern[i][1]). We could also use a single
      // pointer uint*pattern, the choice depends on how it will be
      // natural to use.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Discussion
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

JH:
This Blueprint might be outdated, but I think the ideas presented here can be useful for a Blueprint on reducing the memory footprint in the

  GenericTensor::add

method in DOLFIN during assemble. See corresponding Blueprint in DOLFIN

  https://blueprints.launchpad.net/dolfin/+spec/reduction-of-tabuated-tensor

The important here is to provide a way to know the dofs which are non zero in an integral.

      /// Return the number of nonzeros in an element tensor for a given rank
       virtual uint num_nonzeros(uint rank ) const;

      /// Return the number of nonzeros in an element tensor for a given rank
       virtual void tabulate_sparsity_pattern(uint rank, uint * pattern) const

These values can then be used to reduce the size of the tabulated tensor before

  GenericTensor::add

is called. The cost of copying the values from a tabulated tensor (and from the dofmap) to a reduced version is much less than the extra time it takes to shuffle zeros around to the underlying linear algebra backend. This is a fairly non invasive way (nothing done to dof_map, or tabulate_tensor) of reducing the time spent in GenericTensor::add.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.