# Cannot import GhostCellsGenerator into Catalyst V2 pipeline

**URL:** https://discourse.paraview.org/t/cannot-import-ghostcellsgenerator-into-catalyst-v2-pipeline/7061
**Category:** In Situ Support
**Created:** [April 23, 2021, 12:12pm UTC](https://discourse.paraview.org/t/cannot-import-ghostcellsgenerator-into-catalyst-v2-pipeline/7061 "2021-04-23T12:12:54Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![robertsawko](https://discourse.paraview.org/user_avatar/discourse.paraview.org/robertsawko/32/6283_2.png) [@robertsawko](https://discourse.paraview.org/u/robertsawko)
#### Post date: [April 23, 2021, 12:12pm UTC](https://discourse.paraview.org/t/cannot-import-ghostcellsgenerator-into-catalyst-v2-pipeline/7061/1 "2021-04-23T12:12:54Z")

</div>

Is it possible to import ghost cells generator into catalyst V2 scripts currently? I have a [tentative solution](https://discourse.paraview.org/t/how-to-compute-contours-in-parallel/7046/3) for a parallel pipeline, that I’d like to run, but when I plug my script to Catalyst it breaks with the following message:

```auto
Traceback (most recent call last):                                                                                                                             
  File "/home/rsa/projects/sources/paraview/build-5.9.0/lib/python3.9/site-packages/paraview/ __init__.py", line 161, in <module>                               
    from .modules import vtkRemotingCore                                                                                                                       
ImportError: cannot import name 'vtkRemotingCore' from 'paraview.modules' (/home/rsa/projects/sources/paraview/build-5.9.0/lib/python3.9/site-packages/paraview/modules/ __init__.py) 

```

I reproduce this with a minimal script that only imports `GhostCellsGenerator`.

It looks like a fairly low-level error so I wanted to ask before I dive into this. Please advise.

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [April 23, 2021, 12:28pm UTC](https://discourse.paraview.org/t/cannot-import-ghostcellsgenerator-into-catalyst-v2-pipeline/7061/2 "2021-04-23T12:28:27Z")

</div>

That error is a red herring, often indicating ParaView’s Python compiled modules have not been found correctly. Trying printing sys.path , LD\_LIBRARY\_PATH etc. to ensure they are setup to find ParaView/VTK compiled/wrapping Python modules.

---

<div class="post-metadata">

### Author: ![robertsawko](https://discourse.paraview.org/user_avatar/discourse.paraview.org/robertsawko/32/6283_2.png) [@robertsawko](https://discourse.paraview.org/u/robertsawko)
#### Post date: [April 23, 2021, 3:04pm UTC](https://discourse.paraview.org/t/cannot-import-ghostcellsgenerator-into-catalyst-v2-pipeline/7061/3 "2021-04-23T15:04:31Z")

</div>

> [@utkarsh.ayachit](#):
>
> That error is a red herring…

Gosh you’re right. It seems that my installation somehow depended on the build files which I have since deleted and actually no Catalyst script now works. I have updated the paths, and recompiled catalyst function object, but now I am stuck with

```bash
malloc(): invalid size (unsorted)
Loguru caught a signal: SIGABRT

```

when calling `catalyst_execute(conduit::c_node...)`. I can’t even print `sys.path`. I am recompiling ParaView as I think maybe python upgrade from 3.9.2 to 3.9.3 may have broken it.

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [April 23, 2021, 3:20pm UTC](https://discourse.paraview.org/t/cannot-import-ghostcellsgenerator-into-catalyst-v2-pipeline/7061/4 "2021-04-23T15:20:47Z")

</div>

uff, this seems to have gone awry :). Try `LD_DEBUG=libs` environment variable and see what libraries are getting loaded. That may illuminate the issues.

---

<div class="post-metadata">

### Author: ![robertsawko](https://discourse.paraview.org/user_avatar/discourse.paraview.org/robertsawko/32/6283_2.png) [@robertsawko](https://discourse.paraview.org/u/robertsawko)
#### Post date: [April 23, 2021, 5:50pm UTC](https://discourse.paraview.org/t/cannot-import-ghostcellsgenerator-into-catalyst-v2-pipeline/7061/5 "2021-04-23T17:50:35Z")

</div>

Thanks. That’s a very useful tip with `LD_DEBUG`. I am going to review this now. After recompiling ParaView it’s all back and the example from `pvserver` is working as expected.

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [April 24, 2021, 1:39pm UTC](https://discourse.paraview.org/t/cannot-import-ghostcellsgenerator-into-catalyst-v2-pipeline/7061/6 "2021-04-24T13:39:26Z")

</div>

I love `LD_DEBUG`. There’s `DYLD_DEBUG` on macOS which has the same effect. Very useful tools especially when debugging cryptic issues in dependency-heavy softwares.

---

<div class="post-metadata">

### Author: ![robertsawko](https://discourse.paraview.org/user_avatar/discourse.paraview.org/robertsawko/32/6283_2.png) [@robertsawko](https://discourse.paraview.org/u/robertsawko)
#### Post date: [April 26, 2021, 2:36pm UTC](https://discourse.paraview.org/t/cannot-import-ghostcellsgenerator-into-catalyst-v2-pipeline/7061/7 "2021-04-26T14:36:15Z")

</div>

Thanks for the tip. This is awesome.

I debugged a little and I still have a dependency on my build directory. When `catalyst_execute` is called, I am seeing the following:

```bash
    240848:	calling init: /home/rsa/projects/sources/paraview/build-5.9.0/lib/python3.9/site-packages/paraview/modules/vtkRemotingCore.so
    240848:	
    240848:	
    240848:	calling init: /home/rsa/projects/sources/paraview/build-5.9.0/lib/python3.9/site-packages/paraview/modules/vtkRemotingClientServerStream.so
...
    240848:	calling init: /home/rsa/projects/sources/paraview/build-5.9.0/lib/python3.9/site-packages/paraview/modules/vtkRemotingLive.so

```

I am a great fan of Lmod and care about my environment dearly so I have added those paths to my `LD_LIBRARY_PATH` of the `paraview/5.9.0` module and a _similarly named_ so is being found when the catalyst armed simulation starts.

```bash
    240848:	find library=libvtkRemotingCore-pv5.9.so.1 [0]; searching
    240848: search path=/home/rsa/apps/compiler/gcc/10.2/openmpi/4.0.5/lib:/home/rsa/apps/mpi/gcc/10.2/openmpi/4.0/paraview/5.9.0/lib (LD_LIBRARY_PATH)
    240848: trying file=/home/rsa/apps/compiler/gcc/10.2/openmpi/4.0.5/lib/libvtkRemotingCore-pv5.9.so.1
    240848: trying file=/home/rsa/apps/mpi/gcc/10.2/openmpi/4.0/paraview/5.9.0/lib/libvtkRemotingCore-pv5.9.so.1

```

I tried to link create a symbolic link to `libvtkRemotingCore-pv5.9.so.1`, but it still reverts to the build directory.

Maybe my `CMakeListst.txt` is incorrect?

```auto
if (${ParaView_VERSION} VERSION_GREATER_EQUAL 5.7)
    find_package(ParaView REQUIRED
        COMPONENTS PythonCatalyst
        OPTIONAL_COMPONENTS VTK::ParallelMPI)
else()
    find_package(ParaView REQUIRED
        COMPONENTS vtkPVPythonCatalyst
        OPTIONAL_COMPONENTS vtkParallelMPI)
endif()

```

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [April 26, 2021, 3:22pm UTC](https://discourse.paraview.org/t/cannot-import-ghostcellsgenerator-into-catalyst-v2-pipeline/7061/8 "2021-04-26T15:22:05Z")

</div>

Can you attach the complete output? The first `find library` that ends up find a library from the build dir would be the one to focus one. Once you load library from there, rpaths etc. would cause others from there to be loaded too.

---

<div class="post-metadata">

### Author: ![robertsawko](https://discourse.paraview.org/user_avatar/discourse.paraview.org/robertsawko/32/6283_2.png) [@robertsawko](https://discourse.paraview.org/u/robertsawko)
#### Post date: [April 27, 2021, 8:26am UTC](https://discourse.paraview.org/t/cannot-import-ghostcellsgenerator-into-catalyst-v2-pipeline/7061/9 "2021-04-27T08:26:28Z")

</div>

Thanks @utkarsh.ayachit, I would really appreciate advice on this. Here’s my [log.interIsoFoam](https://discourse.paraview.org/uploads/short-url/eE2ipSpfqdm8nYA7YP4fikHD19W.interIsoFo) (994.5 KB). If you search for `sources` or `build` you should see the first entry related to my build directory.

What is a bit strange is that find library is never invoked for `vtkRemotingCore.so`, but for `vtkRemotingCore-pv5.9.so`. The reference to `vtkRemotingCore.so` in my build dir appears after `callinig init` which makes me think there’s something wrong in my cmake invocation for OpenFOAM adaptor or for ParaView itself.

I normally compile ParaView with something like this:

```bash
cmake \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    ...
    -DCMAKE_INSTALL_PREFIX=/path/to/installation \
    ...
    && make \
    && make install

```
