The problem
I use a script to convert PointData to CellData in the programmable filter (the netCDFreader returns PointData). Cory once wrote it and it works fine on my Windows Laptop with the normal Paraview Installation (v5.4.1). However, on my OSMesa compiled version on Linux (Paraview 5.4.1, Mesa 17.2.8), it seizes to work. For some reason my Programmable Filter does not seem to do anything, even though no error is thrown, but no data is passed. When I remove the Programmable Filter, to just plot PointData, everything renders fine again.
I’m interested in your thoughts as to the cause of this problem.
The things I tried
I first thought it was a python path error only in the programmable filter. But it does not throw any import errors and when I print my sys.path in the filter script, it is identical to sys.path in my pvbatch script, which has no trouble with processing data.
Furthermore, when I define the following function to print the variable names in a dataset (and to distuingish cell data or point data).
def get_arraynames(Property):
names = {}
cd = servermanager.Fetch(Property).GetCellData()
names["cd"] = [cd.GetArrayName(i) for i in range(cd.GetNumberOfArrays())]
pd = servermanager.Fetch(Property).GetPointData()
names["pd"] = [pd.GetArrayName(i) for i in range(pd.GetNumberOfArrays())]
return(names)
All Properties in the pipeline after my programmable filter on the Windows version get a list under “cd”, however this list is empty on the Linux version I compiled. (“pd” is also empty for the filter in that version. Before the programmable filter, “pd” contains the names both on Linux as Windows, as expected)
The filter script is hardcoded in my pvbatch script as a 1 line string with “\n” (as traced by Paraview on Windows), so I think it should not be a carriage return Windows-Linux conversion thing.
The filter script
dims = inputs[0].GetDimensions()
ext = inputs[0].GetExtent()
output.SetDimensions(dims[0]+1, dims[1]+1, dims[2]+1)
output.SetExtent(ext[0], ext[1]+1, ext[2], ext[3]+1, ext[4], ext[5]+1)
inputPd = inputs[0].PointData
outputCd = output.CellData
for array in inputPd:
print(type(array))
outputCd.append(array, array.GetName())
bash script with which I compiled Paraview:
#!/bin/bash
module load cmake
mkdir paraview.bld
cd paraview.bld
MESA_INSTALL_PREFIX=$HOME/visualization/mesa
LLVM_INSTALL_PREFIX=$HOME/visualization/llvm
export PATH=$PATH:$HOME/visualization/llvm/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${MESA_INSTALL_PREFIX}/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${LLVM_INSTALL_PREFIX}/lib
cmake \
-DPARAVIEW_ENABLE_PYTHON=ON \
-DCMAKE_INSTALL_PREFIX=$HOME/visualization/paraview \
-DPYTHON_EXECUTABLE=$HOME/anaconda3/envs/py27/bin/python2.7 \
-DPYTHON_INCLUDE_DIR=$HOME/anaconda3/envs/py27/include/python2.7 \
-DPYTHON_LIBRARY=$HOME/anaconda3/envs/py27/lib/libpython2.7.so.1.0 \
-DPARAVIEW_BUILD_QT_GUI=OFF \
-DVTK_USE_X=OFF \
-DOPENGL_INCLUDE_DIR=IGNORE \
-DOPENGL_xmesa_INCLUDE_DIR=IGNORE \
-DOPENGL_gl_LIBRARY=IGNORE \
-DOSMESA_INCLUDE_DIR=${MESA_INSTALL_PREFIX}/include \
-DOSMESA_LIBRARY=${MESA_INSTALL_PREFIX}/lib/libOSMesa.so \
-DVTK_OPENGL_HAS_OSMESA=ON \
-DVTK_USE_OFFSCREEN=OFF \
../ParaView-v5.4.1
make -j32
make -j32 install