OpenMP assemble does not work with Real spaces

Bug #860142 reported by Johan Hake
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
DOLFIN
Confirmed
Medium
Unassigned

Bug Description

When Real spaces are used in a form and setting threads to larger than 1 the assemble does not return a correct value.

The following test scripts illustrates the problem:
##############################
from dolfin import *
mesh = UnitCube(10, 10, 10)
V=FunctionSpace(mesh, "CG", 1)*FunctionSpace(mesh, "R", 0)
v0, v1=TestFunctions(V)
formR = (v0+v1)*dx
form = v0*dx
num_threads = 2
parameters.num_threads = num_threads
print "norm with R: %.8f, should be same as"%(assemble(formR).norm("l2"))
parameters.num_threads = 0
print "norm with R no threads: %.8f"%(assemble(formR).norm("l2"))
parameters.num_threads = num_threads
print "norm without R: %.8f, should be same as"%(assemble(form).norm("l2"))
parameters.num_threads = 0
print "norm without R no threads: %.8f"%(assemble(form).norm("l2"))

Johan Hake (johan-hake)
Changed in dolfin:
importance: Undecided → High
Revision history for this message
Johan Hake (johan-hake) wrote :

This is not surprising as the global dofs are not "protected" by the colored mesh, as they are present on each cell... I guess we need to assemble the global dofs independently on each thread, and then add them in a thread safe manner at the end of the assemble.

While complicating the assemble of global dofs it might speed up the insertion of the dofs for the PETsc backend :)

Changed in dolfin:
milestone: none → 1.1.0
importance: High → Medium
status: New → Incomplete
status: Incomplete → Confirmed
Changed in dolfin:
milestone: none → 1.1.0
Changed in dolfin:
milestone: 1.1.0 → trunk
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.