- changed milestone to 1.6
Loading domains from a mesh file fails when run in parallel
Loading a mesh file that also contains domain data fails to correctly load the domain data when running with MPI. The following test script creates and reloads both the mesh and the meshfunction perfectly when running it without MPI. However, when loading the mesh domains in parallel, it fails (Note, that mesh.domains().num_marked() shows that in fact not all cells are marked in parallel, hence the error occurs during loading, not when converting it into a MeshFunction).
Loading a MeshFunction directly from a file works in parallel as expected.
import os
from dolfin import *
meshfile = 'mesh.xml.gz'
subfile = 'sub.xml.gz'
if not (os.path.exists(meshfile) and
os.path.exists(subfile)):
mesh = UnitSquareMesh(10, 10)
AutoSubDomain(lambda _: True).mark_cells(mesh, 1)
AutoSubDomain(lambda x: x[0] >= 0.5).mark_cells(mesh, 2)
subdomains = MeshFunction('size_t', mesh, 2, mesh.domains())
File(meshfile) << mesh
File(subfile) << subdomains
mesh = Mesh(meshfile)
sub_from_mesh = MeshFunction('size_t', mesh, 2, mesh.domains())
sub_from_file = MeshFunction('size_t', mesh, subfile)
plot(sub_from_mesh)
plot(sub_from_file)
interactive()
The bug occurs both 1.4, as well as in the master branch.
Comments (7)
-
-
- changed component to io
-
-
assigned issue to
-
assigned issue to
-
- changed milestone to 1.7
Bumping this to 1.7. My preferred fix is to not allow XML with domain data to be read in parallel, and use XDMF/HDF5 instead.
It's too much work and too error prone to support two file formats in parallel.
-
- removed milestone
Removing milestone: 1.7 (automated comment)
-
Shall we mark this as 'won't fix'?
-
I'd agree with that.
- Log in to comment