- edited description
Excessive/insfficient use of Function::update() throughout the library
Function::update()
is used redundantly by assemblers. This may ruin scalability.
On the other hand, DirichletBC::compute_bc*
lack these calls, see pull request #117.
So far suggested solutions:
- (Garth) update lately only when necessary; vector is flagged for ghost_consistence.
- (Martin) update early; user takes care of an update when fiddling with vector entries.
Comments (17)
-
reporter -
reporter - edited description
-
reporter Here is actual MWE (run on two processes):
from dolfin import * mesh = UnitSquareMesh(4, 5) V = FunctionSpace(mesh, 'CG', 1) class F(Expression): def eval(self, y, x): y[0] = 10.0 f = project(F(), V) #f.update() # Uncomment to fix the problem u = Function(V) bc = DirichletBC(V, f, lambda x,onb:True) bc.apply(u.vector()) plot(u, interactive=True)
-
reporter -
assigned issue to
-
assigned issue to
-
reporter Fix in pull request #117.
-
I think the best solution is that we add a state flag to vectors to track whether or not the ghost values are up-to-date. This way we can sprinkle
Function::update()
without a performance hit. -
reporter - changed title to Excessive/insfficient use of Function::update() throughout the library
- removed responsible
- edited description
-
I like Garths solution, is it feasible?
See also David Hams comment on the list: With Garths suggestion of dirty flags to vectors, access to the vector entries can mark the vector as dirty so the next time someone calls update it does the job.
-
@martinal It should be easy - we can set a flag to true after update() is called, and invalidate the flag when Generic::vector::set/get, etc is called.
We can add a boolean argument to
update()
so that it can be automatic (according to the internal state flag) or forced. -
reporter @garth-wells User could also have a possibility to reset a flag for the case he did not touch any ghost.
-
@blechta Yes, for fancier/advanced use we could let the user modify the flag.
-
- changed status to resolved
Fix Issue
#263.Move calls to update vector ghost values to apply(), and after linear solves.
Epetra implementation is flaky, but Epetra interface needs an overhaul for parallel objects.
→ <<cset 756e630ada78>>
-
Fix Issue
#263.Move calls to update vector ghost values to apply(), and after linear solves.
Epetra implementation is flaky, but Epetra interface needs an overhaul for parallel objects.
→ <<cset 5c29b06be35d>>
-
reporter @garth-wells Is it wise to remove
GenericVector::update_ghost_values()
which may be useful for special purpose? User would now need to downcast toPETScVector
orEpetraVector
. -
@blechta I thought about keeping
GenericVector::update_ghost_values()
, but was swayed by not needing it in the code. I don't have a strong view either way. -
reporter @garth-wells Me neither. User probably finishes every fiddling with DOFs with
GenericVector::apply
. -
- removed milestone
Removing milestone: 1.4 (automated comment)
- Log in to comment