XDMF write_checkpoint leads to segfault in paraview

Issue #1039 invalid
Chaffra Affouda created an issue

To reproduce,

import dolfin
from dolfin import *

mesh = UnitSquareMesh(10,10)

DG1 = FunctionSpace(mesh,'DG', 1)

class Step(UserExpression):

    def __init__(self, mesh, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.mesh = mesh

    def eval_cell(self, values, x, cell):
        c = Cell(self.mesh, cell.index)
        p = c.midpoint()
        if p[0] <= 0.5:
            values[0] = 0.0
        elif p[0] >= 0.5:
            values[0] = 1.0


step = Step(mesh, domain=mesh, element=DG1.ufl_element())

f = Function(DG1)
f.interpolate(step)

file = XDMFFile("step_DG.xdmf")
file.write_checkpoint(f,"f")

Open xdmf file in paraview leads to segfault. Can @michalhabera look into this?

Comments (9)

  1. Chaffra Affouda reporter

    Error is

    HDF5-DIAG: Error detected in HDF5 (1.10.1) thread 0:
      #000: /home/chaffra/Projects/FEniCS/src/paraview/VTK/ThirdParty/hdf5/vtkhdf5/src/H5F.c line 586 in vtkhdf5_H5Fopen(): unable to open file
        major: File accessibilty
        minor: Unable to open file
      #001: /home/chaffra/Projects/FEniCS/src/paraview/VTK/ThirdParty/hdf5/vtkhdf5/src/H5Fint.c line 1305 in vtkhdf5_H5F_open(): unable to lock the file
        major: File accessibilty
        minor: Unable to open file
      #002: /home/chaffra/Projects/FEniCS/src/paraview/VTK/ThirdParty/hdf5/vtkhdf5/src/H5FD.c line 1839 in vtkhdf5_H5FD_lock(): driver lock request failed
        major: Virtual File Layer
        minor: Can't update object
      #003: /home/chaffra/Projects/FEniCS/src/paraview/VTK/ThirdParty/hdf5/vtkhdf5/src/H5FDsec2.c line 940 in H5FD_sec2_lock(): unable to lock file, errno = 11, error message = 'Resource temporarily unavailable'
        major: File accessibilty
        minor: Bad file ID accessed
    HDF5-DIAG: Error detected in HDF5 (1.10.1) thread 0:
      #000: /home/chaffra/Projects/FEniCS/src/paraview/VTK/ThirdParty/hdf5/vtkhdf5/src/H5D.c line 284 in vtkhdf5_H5Dopen2(): not a location
        major: Invalid arguments to routine
        minor: Inappropriate type
      #001: /home/chaffra/Projects/FEniCS/src/paraview/VTK/ThirdParty/hdf5/vtkhdf5/src/H5Gloc.c line 251 in vtkhdf5_H5G_loc(): invalid object ID
        major: Invalid arguments to routine
        minor: Bad value
    HDF5-DIAG: Error detected in HDF5 (1.10.1) thread 0:
      #000: /home/chaffra/Projects/FEniCS/src/paraview/VTK/ThirdParty/hdf5/vtkhdf5/src/H5D.c line 373 in vtkhdf5_H5Dget_space(): not a dataset
        major: Invalid arguments to routine
        minor: Inappropriate type
    HDF5-DIAG: Error detected in HDF5 (1.10.1) thread 0:
      #000: /home/chaffra/Projects/FEniCS/src/paraview/VTK/ThirdParty/hdf5/vtkhdf5/src/H5S.c line 863 in vtkhdf5_H5Sget_simple_extent_ndims(): not a dataspace
        major: Invalid arguments to routine
        minor: Inappropriate type
    HDF5-DIAG: Error detected in HDF5 (1.10.1) thread 0:
      #000: /home/chaffra/Projects/FEniCS/src/paraview/VTK/ThirdParty/hdf5/vtkhdf5/src/H5Sselect.c line 312 in vtkhdf5_H5Sget_select_npoints(): not a dataspace
        major: Invalid arguments to routine
        minor: Inappropriate type
    Number of dimensions in light data description in Xdmf does not match number of dimensions in hdf5 file.
    
  2. Chaffra Affouda reporter

    Thanks, that was easy. Now it's the fe-filter.py that's not working. The (cell) datasets are not being populated in paraview. Here's my fe_fliter.py script.

    Traceback (most recent call last):
      File "<string>", line 22, in <module>
      File "<string>", line 2, in RequestData
      File "<string>", line 277, in <module>
      File "<string>", line 221, in traverse
    AttributeError: 'NoneType' object has no attribute 'GetNumberOfComponents'
    ds_in =  vtkUnstructuredGrid (0x560309ff9e50)
      Debug: Off
      Modified Time: 9346991
      Reference Count: 2
      Registered Events: (none)
      Information: 0x5603064da7d0
      Data Released: False
      Global Release Data: Off
      UpdateTime: 9346993
      Field Data:
        Debug: Off
        Modified Time: 9346969
        Reference Count: 1
        Registered Events: (none)
        Number Of Arrays: 0
        Number Of Components: 0
        Number Of Tuples: 0
      Number Of Points: 600
      Number Of Cells: 200
      Cell Data:
        Debug: Off
        Modified Time: 9346987
        Reference Count: 1
        Registered Events: 
          Registered Observers:
            vtkObserver (0x5603087ebee0)
              Event: 33
              EventName: ModifiedEvent
              Command: 0x560306fc6f10
              Priority: 0
              Tag: 1
        Number Of Arrays: 0
        Number Of Components: 0
        Number Of Tuples: 0
        Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )
        Interpolate Flags: ( 1 1 1 1 1 0 0 1 )
        Pass Through Flags: ( 1 1 1 1 1 1 1 1 )
        Scalars: (none)
        Vectors: (none)
        Normals: (none)
        TCoords: (none)
        Tensors: (none)
        GlobalIds: (none)
        PedigreeIds: (none)
        EdgeFlag: (none)
      Point Data:
        Debug: Off
        Modified Time: 9346991
        Reference Count: 1
        Registered Events: 
          Registered Observers:
            vtkObserver (0x560308c1cce0)
              Event: 33
              EventName: ModifiedEvent
              Command: 0x560306fc6f10
              Priority: 0
              Tag: 1
        Number Of Arrays: 1
        Array 0 name = f
        Number Of Components: 1
        Number Of Tuples: 600
        Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )
        Interpolate Flags: ( 1 1 1 1 1 0 0 1 )
        Pass Through Flags: ( 1 1 1 1 1 1 1 1 )
        Scalars: 
          Debug: Off
          Modified Time: 9345604
          Reference Count: 3
          Registered Events: (none)
          Name: f
          Data type: double
          Size: 1023
          MaxId: 599
          NumberOfComponents: 1
          Information: 0x560307c67ee0
            Debug: Off
            Modified Time: 9347038
            Reference Count: 1
            Registered Events: (none)
            PER_FINITE_COMPONENT: vtkInformationVector(0x560308cd8910)
            PER_COMPONENT: vtkInformationVector(0x56030cae74b0)
          Name: f
          Number Of Components: 1
          Number Of Tuples: 600
          Size: 1023
          MaxId: 599
          LookupTable: (none)
        Vectors: (none)
        Normals: (none)
        TCoords: (none)
        Tensors: (none)
        GlobalIds: (none)
        PedigreeIds: (none)
        EdgeFlag: (none)
      Bounds: 
        Xmin,Xmax: (0, 1)
        Ymin,Ymax: (0, 1)
        Zmin,Zmax: (0, 0)
      Compute Time: 9460598
      Number Of Points: 600
      Point Coordinates: 0x560318265230
      Locator: 0
      Number Of Pieces: 1
      Piece: 0
      Ghost Level: 0
    
  3. Michal Habera

    That filter is not meant to work. This functionality should work in latest Paraview out of box. Do not use any external filter. Use Paraview 5.5.0+.

  4. Chaffra Affouda reporter

    OK I see. I am using paraview 5.5.2. In this case I am expecting to see a discontinuous step function but it looks like there is interpolation at the step edge. What am I doing wrong here? Paraview is still visualizing cells at the step-edge when you do a WarpByScalar.

  5. Michal Habera

    I see step as should be.

    Sorry, I don't have time to give you support on this. Ask on allanswered. This is not issue.

  6. Log in to comment