CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [PyFoam] Prblems with pyFoamPVSnapshot-PATHS in OF-2.0.1 (https://www.cfd-online.com/Forums/openfoam-community-contributions/108162-prblems-pyfoampvsnapshot-paths-2-0-1-a.html)

klio October 16, 2012 06:02

Prblems with pyFoamPVSnapshot-PATHS in OF-2.0.1
 
Hi!!

I'd like to do a snapshot with pyFoamPVSnapshot! I set the paths as its said in README of ThirdParty-2.0.x/ParaView-3.10.1/VTK/Wrapping/Python/README.txt

But it even caused following Error:

pyFoamPVSnapshot.py --state-file=state.pvsm --latest-time state1
Traceback (most recent call last):
File "/usr/local/bin/pyFoamPVSnapshot.py", line 3, in <module>
from PyFoam.Applications.PVSnapshot import PVSnapshot
File "/usr/local/lib/python2.6/dist-packages/PyFoam/Applications/PVSnapshot.py", line 13, in <module>
from PyFoam.Paraview.ServermanagerWrapper import ServermanagerWrapper as SM
File "/usr/local/lib/python2.6/dist-packages/PyFoam/Paraview/__init__.py", line 15, in <module>
from paraview import servermanager
File "/usr/lib/pymodules/python2.6/paraview/servermanager.py", line 43, in <module>
import paraview, re, os, new, sys, vtk
File "/usr/lib/pymodules/python2.6/paraview/vtk/__init__.py", line 4, in <module>
from libvtkCommonPython import *
ImportError: No module named libvtkCommonPython

may it is an important information that i have installed OF as discribed on this WebPage:
http://www.tfd.chalmers.se/~hani/kur...OwnLaptop.html

I don't know what to do ....

gschaider October 18, 2012 17:39

Quote:

Originally Posted by klio (Post 386839)
Hi!!

I'd like to do a snapshot with pyFoamPVSnapshot! I set the paths as its said in README of ThirdParty-2.0.x/ParaView-3.10.1/VTK/Wrapping/Python/README.txt

But it even caused following Error:

pyFoamPVSnapshot.py --state-file=state.pvsm --latest-time state1
Traceback (most recent call last):
File "/usr/local/bin/pyFoamPVSnapshot.py", line 3, in <module>
from PyFoam.Applications.PVSnapshot import PVSnapshot
File "/usr/local/lib/python2.6/dist-packages/PyFoam/Applications/PVSnapshot.py", line 13, in <module>
from PyFoam.Paraview.ServermanagerWrapper import ServermanagerWrapper as SM
File "/usr/local/lib/python2.6/dist-packages/PyFoam/Paraview/__init__.py", line 15, in <module>
from paraview import servermanager
File "/usr/lib/pymodules/python2.6/paraview/servermanager.py", line 43, in <module>
import paraview, re, os, new, sys, vtk
File "/usr/lib/pymodules/python2.6/paraview/vtk/__init__.py", line 4, in <module>
from libvtkCommonPython import *
ImportError: No module named libvtkCommonPython

may it is an important information that i have installed OF as discribed on this WebPage:
http://www.tfd.chalmers.se/~hani/kur...OwnLaptop.html

I don't know what to do ....

The problem seems to be that python can't find the dynamic library libvtkCommonPython.so which implements the python-module libvtkCommonPython. pyFoamPVSnapshot.py uses pvpython as an interpreter. pvpython is a special python version that should set the paths appropriately so that these module is found. So it seems that there is a problem with the paraview-installation.

On the OS-shell type

pvpython

A python-shell should appear. There you type

import paraview

Should one of these steps fail then the installation of paraview is the problem

klio October 19, 2012 02:51

Thank you!

But it didn't work! (I was able to folow your setps without failures but NO)

I also tried to add the path where the libvtk... .so File is to the PYTHONPATH!
I have installed python-vtk.

Nothing worked!

gschaider October 19, 2012 05:47

Quote:

Originally Posted by klio (Post 387446)
Thank you!

But it didn't work! (I was able to folow your setps without failures but NO)

I don't quite get what didn't work. Please remember: it is your problem. So what "it" means is clear to you but not necessarily to anyone else (and not many people care about it as much as you do). So try to be short, but precise. "But NO" is what I say to putting further effort into this problem if I have to ask for clarification what "but NO" means

Quote:

Originally Posted by klio (Post 387446)
I also tried to add the path where the libvtk... .so File is to the PYTHONPATH!
I have installed python-vtk.

As I understand it the VTK that comes with Paraview is not exactly compatible to the "normal" VTK. So maybe your problem is that they're mixed.

If "normal" pvpython works (but you're terribly unclear there) try calling the script with

pvpython <fullPathToScript>/pyFoamPVSnapShot.py <your parameters>

klio October 23, 2012 02:32

Hello!
Thanks for your efforts!

I ment it as you understood it. pvpython is working. I seemed like pvpython has imported the paraview library but when I type in the pyFoamPVSnapshot command with or without pvpython I get the same error again.

Maybe paraview python support is not enabled and that is the problem ... !

Greatings klio

gschaider October 23, 2012 17:38

Quote:

Originally Posted by klio (Post 388027)
Hello!
Thanks for your efforts!

I ment it as you understood it. pvpython is working. I seemed like pvpython has imported the paraview library but when I type in the pyFoamPVSnapshot command with or without pvpython I get the same error again.

Maybe paraview python support is not enabled and that is the problem ... !

I think in that case pvpython shouldn't even exist (and should be unable to import paraview). But check that: the Tools-menu in Paraview should have an entry "Python Shell". If not then it seems like your paraview is without Python-support (the "official" OF-Paraview usually is without Python)

klio October 24, 2012 04:11

I have no PythonSell and with the command paraview --script=sript.py it opens paraview but says "no python support" in the output message.

Also when i type paraview in a schell where pyFoam and OpenFoam is activated It opens another version than in an other shell.

I tried to confugure paraView (which OF uses) with ccmake to enable python. Now in the configfile the PARAVIEW_ENABLE_PYTHON is ON and also in the other files but I stil get the same output message from paraview. (I also compiled it agian but nothing changed).

I think maybe the pvpython command works because of the other paraview which is installed on the system and has nothing to do with the OF and pyFoam installation. but also the config there has the PYTHON variable ON.

gschaider October 24, 2012 09:20

Quote:

Originally Posted by klio (Post 388243)
I have no PythonSell and with the command paraview --script=sript.py it opens paraview but says "no python support" in the output message.

Yes, you have python shell. Just enter "python" and you will end up in a command line where you can enter stuff like

import paraview

BTW: afterwards try

print paraview

to see which library is actually used (same applies for pvpython)

But it seems that you have no python-support in Paraview

Quote:

Originally Posted by klio (Post 388243)
Also when i type paraview in a schell where pyFoam and OpenFoam is activated It opens another version than in an other shell.

I tried to confugure paraView (which OF uses) with ccmake to enable python. Now in the configfile the PARAVIEW_ENABLE_PYTHON is ON and also in the other files but I stil get the same output message from paraview. (I also compiled it agian but nothing changed).

I think maybe the pvpython command works because of the other paraview which is installed on the system and has nothing to do with the OF and pyFoam installation. but also the config there has the PYTHON variable ON.

Sounds like the paraview-variant of DLL-hell: when two versions of paraview are installed (usually one by the package-manager, one by whatever way you installed OF)

Have no idea except to check the environmentvariables PATH, LD_LIBRARY_PATH, PYTHONPATH and make sure that the "pythony" paraview comes first. Also check the environment variable starting with PV and PARA (there may not necessarily be some). The most radical method may be to get rid of one of the Paraview-versions and trying to get the other one to work

unnikrsn November 2, 2012 08:29

Dear gschaider

I am facing the same problems as Klio.

I have read and followed all the procedure here and other place for installing/Compiling Paraview with Python.
1. I had able to load a python file from my paraview and get a output.
2. I am not able to use the Python ( pypython ) to create snapshots using pyFoamPVSnapShot.py

atmoun@balder:/mnt/N/_AUTOMATISATION/Unni_save_dir/atmoun/Particle_image_velocimetry/PIV_Modell_Zylinder_perpendicularCylinders$ pvpython
Python 2.6.5 (r265:79063, Oct 1 2012, 22:16:31)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import paraview
>>> pvpython /home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7/build/scripts-2.6/pyFoamPVSnapShot.py --state-file="Measurements.pvsm" --latest-time
File "<stdin>", line 1
pvpython /home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7/build/scripts-2.6/pyFoamPVSnapShot.py --state-file="Measurements.pvsm" --latest-time
^
SyntaxError: invalid syntax
>>> pvpython /home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7/build/scripts-2.6/pyFoamPVSnapShot.py
File "<stdin>", line 1
pvpython /home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7/build/scripts-2.6/pyFoamPVSnapShot.py
^
SyntaxError: invalid syntax
>>> print paraview
<module 'paraview' from '/home/atmoun/OpenFOAM/ThirdParty-2.1.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/site-packages/paraview/__init__.pyc'>
>>>

Kindly help me.

Thanks & Regards
Unnikrishnan.


gschaider November 20, 2012 19:32

Quote:

Originally Posted by unnikrsn (Post 389874)
Dear gschaider

I am facing the same problems as Klio.

I have read and followed all the procedure here and other place for installing/Compiling Paraview with Python.
1. I had able to load a python file from my paraview and get a output.
2. I am not able to use the Python ( pypython ) to create snapshots using pyFoamPVSnapShot.py

atmoun@balder:/mnt/N/_AUTOMATISATION/Unni_save_dir/atmoun/Particle_image_velocimetry/PIV_Modell_Zylinder_perpendicularCylinders$ pvpython
Python 2.6.5 (r265:79063, Oct 1 2012, 22:16:31)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import paraview
>>> pvpython /home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7/build/scripts-2.6/pyFoamPVSnapShot.py --state-file="Measurements.pvsm" --latest-time
File "<stdin>", line 1
pvpython /home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7/build/scripts-2.6/pyFoamPVSnapShot.py --state-file="Measurements.pvsm" --latest-time
^
SyntaxError: invalid syntax
>>> pvpython /home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7/build/scripts-2.6/pyFoamPVSnapShot.py
File "<stdin>", line 1
pvpython /home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7/build/scripts-2.6/pyFoamPVSnapShot.py
^
SyntaxError: invalid syntax
>>> print paraview
<module 'paraview' from '/home/atmoun/OpenFOAM/ThirdParty-2.1.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/site-packages/paraview/__init__.pyc'>
>>>

Kindly help me.

Thanks & Regards
Unnikrishnan.


I don't think it as the same problem as Klios. There the problem is that paraview is not correctly imported. In your case this works. What you do on the next line ("pvpython ...") can not be done on the python-shell. Try it on the regular shell and report what the error message is then

ZKW November 21, 2012 09:07

1 Attachment(s)
Dear gschaider,

Thanks for the reply,


Also I would like to inform, after the previous messages, i changed the OpenFoam version and a installation procedure a couple of times.. Just trying to find a solution by trial and error.


Checking pvpython is not working now.

atmoun@balder:~/Documents/Particle_image_velocimetry/ZKW_Multiregion-simpleFoam_cavity_PIV_Zylinder_Model_1$ pypython
No command 'pypython' found, did you mean:
Command 'pvpython' from package 'paraview' (universe)
Command 'cypython' from package 'cyphesis-cpp-clients' (universe)
pypython: command not found
atmoun@balder:~/Documents/Particle_image_velocimetry/ZKW_Multiregion-simpleFoam_cavity_PIV_Zylinder_Model_1$


Also i wanted to say:

1. Installation of OpenFOAM 2.1.1
as User(Non-root in my home directory)
As I have a version of OpenFOAM 2.0.1 already installed in my system by system admin.

I had to install a version of OpenFOAM 2.1.1 in my home directory.
/home/atmoun/OpenFOAM/OpenFOAM-2.1.x


2. Installation of python 2.7.3
Installed python 2.7.3 in my home directory at the following location.
/home/atmoun/OpenFOAM/Python-2.7.3

atmoun@balder:~/OpenFOAM$cd Python-2.7.3
atmoun@balder:~/OpenFOAM/Python-2.7.3$make clean
atmoun@balder:~/OpenFOAM/Python-2.7.3$./configure --prefix=/home/atmoun/OpenFOAM/Python-2.7.3
atmoun@balder:~/OpenFOAM/Python-2.7.3$make
atmoun@balder:~/OpenFOAM/Python-2.7.3$make install


Then run using:

/home/atmoun/OpenFOAM/Python-2.7.3
/bin/python

3. Compiling Paraview with Python
While Compiling paraview i had a problem

/home/atmoun/OpenFOAM/ThirdParty-2.1.x
./makeParaView
# Python support:
# note: script will try to determine the appropriate python library.
#
If it fails, specify the path using the PYTHON_LIBRARY variable

withPYTHON=true
PYTHON_LIBRARY="/usr/lib64/libpython2.6.so.1.0"
# PYTHON_LIBRARY="/usr/lib64/libpython2.6.so.1.0"

I cannot Find the libpython2.7.so.1.0 in my installation directory or in /opt/ or in /usr/lib*/, I think this is the root cause for all the problem.
But i am not sure. if someone can help me.. where i can find the above file.

I dont want to use
PYTHON_LIBRARY="/usr/lib64/libpython2.6.so.1.0" due to the admin rights. but still i am using the same to compile paraview.

4. Installing pyFoam
(as in http://www.tfd.chalmers.se/~hani/kur...OwnLaptop.html )
/home/atmoun/OpenFOAM/linuxSrc/PyFoam-0.5.7
atmoun@balder:~/OpenFOAM/linuxSrc/PyFoam-0.5.7$ python setup.py install --prefix=$HOME/OpenFOAM/PyFoam-0.5.7

atmoun@balder:~/OpenFOAM/linuxSrc/PyFoam-0.5.7$ echo "alias PF='export PYTHONPATH=/$HOME/OpenFOAM/Python-2.7.3/lib/python2.7/site-packages:$PYTHONPATH; export PATH=$HOME/OpenFOAM/Python-2.7.3/bin:$PATH'" >> $HOME/.bashrc

Also i am really confused in the above 2 lines..
when installing pyFoam
I get the following
Neither numpy nor Numeric python-package installed. Plotting won't work

export pythonpath to /home/atmoun/OpenFOAM/my_python


Results : If you or anyone can check and tell me, if i am doing some thing wrong with the procedure, Kindly please explain in detail.

Attached: Picture of my User directory with Installation location of OpenFOAM-2.1.1, Paraview3.12 in thirdParty


Thanks in advance for the help.

Thanks & Regards
Unnikrishnan.


wouter September 6, 2013 18:37

Dear All,
I experience similar problems with OpenFOAM2.2.x on Ubuntu13.04 (64bit) an I hope someone knows a solution because I want to print a lot of snapshots and I hoped pyFoam could help me.
I folowed this thread and collected all the data asked for. Please feel free to ask for additional information

best regards
wouter

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm
Traceback (most recent call last):
  File "/usr/local/bin/pyFoamPVSnapshot.py", line 3, in <module>
    from PyFoam.Applications.PVSnapshot import PVSnapshot
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Applications/PVSnapshot.py", line 13, in <module>
    from PyFoam.Paraview.ServermanagerWrapper import ServermanagerWrapper as SM
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Paraview/__init__.py", line 15, in <module>
    from paraview import servermanager
ImportError: No module named paraview

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamVersion.py
Machine info: Linux | wouter-desktop | 3.8.0-30-generic | #44-Ubuntu SMP Thu Aug 22 20:52:24 UTC 2013 | x86_64 | x86_64

Python version: 2.7.4 (default, Jul  5 2013, 08:21:57)
[GCC 4.7.3]

PYTHONPATH: /home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/Utilities/VTKPythonWrapping

Location of this utility: /usr/local/bin/pyFoamVersion.py

OpenFOAM (2, 2, 'x') of the installed versions ['2.2.x']

pyFoam-Version: 0.6.0

Path where PyFoam was found (PyFoam.__path__) is ['/usr/local/lib/python2.7/dist-packages/PyFoam']

Configuration search path: [('file', '/etc/pyFoam/pyfoamrc'), ('directory', '/etc/pyFoam/pyfoamrc.d'), ('file', '/home/wouter/.pyFoam/pyfoamrc'), ('directory', '/home/wouter/.pyFoam/pyfoamrc.d')]
Configuration files (used): []

Installed libraries:
Gnuplot              :  No      Not a problem. Version from ThirdParty is used
ply                  :  No      Not a problem. Version from ThirdParty is used
Numeric              :  No      Not supported anymore. No need to install it
numpy                :  Yes      version: 1.7.1
matplotlib          :  No      Only Gnuplot-plotting possible
psyco                :  No      Not a problem. Acceleration not possible
hotshot              :  Yes
profile              :  Yes
cProfile            :  Yes
PyQt4                :  Yes
PyQt4.Qwt5          :  No      Only an alternate plotting back-end
vtk                  :  Yes
Tkinter              :  No      Not a problem. Used for the old version of DisplayBlockmesh and some matplotlib-implementations
mercurial            :  No      Not a problem. Used for experimental case handling
nose                :  No      Only needed for running the unit-tests (developers only)
twisted              :  Yes      version: 12.3.0
pandas              :  No      Not yet used. Maybe handling of timelines will be reimplemented with it
scipy                :  No      Not yet used. Possibly use signal-fitting etc

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ which python
/usr/bin/python
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ which paraview
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/bin/paraview

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ icoFoam -version

Usage: icoFoam [OPTIONS]
options:
  -case <dir>      specify alternate case directory, default is the cwd
  -noFunctionObjects
                    do not execute functionObjects
  -parallel        run in parallel
  -roots <(dir1 .. dirN)>
                    slave root directories for distributed running
  -srcDoc          display source code in browser
  -doc              display application documentation in browser
  -help            print the usage

Using: OpenFOAM-2.2.x (see www.OpenFOAM.org)
Build: 2.2.x-9f309353a479



--> FOAM FATAL ERROR:
Invalid option: -version


FOAM exiting

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pvpython
Python 2.7.4 (default, Jul  5 2013, 08:24:51)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import paraview
>>>

starting ParaFoam->tools-Python Shell
Code:

Python 2.7.4 (default, Jul  5 2013, 08:24:51)
[GCC 4.7.3] on linux2
>>> from paraview.simple import *
paraview version 3.12.0, Date: 2011-07-26

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ python
Python 2.7.4 (default, Jul  5 2013, 08:21:57)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import paraview
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named paraview
>>> print paraview
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'paraview' is not defined
>>>

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ echo $PATH
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/bin:/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/gperftools-svn/bin:/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/bin:/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/openmpi-1.6.3/bin:/home/wouter/OpenFOAM/wouter-2.2.x/platforms/linux64GccDPDebug/bin:/home/wouter/OpenFOAM/site/2.2.x/platforms/linux64GccDPDebug/bin:/home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/bin:/home/wouter/OpenFOAM/OpenFOAM-2.2.x/bin:/home/wouter/OpenFOAM/OpenFOAM-2.2.x/wmake:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ echo $LD_LIBRARY_PATH
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/gperftools-svn/lib:/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12:/home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/openmpi-1.6.3:/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64GccDPDebug/lib/openmpi-1.6.3:/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/openmpi-1.6.3/lib:/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/openmpi-1.6.3/lib64:/home/wouter/OpenFOAM/wouter-2.2.x/platforms/linux64GccDPDebug/lib:/home/wouter/OpenFOAM/site/2.2.x/platforms/linux64GccDPDebug/lib:/home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib:/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64GccDPDebug/lib:/home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/dummy
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ echo $PYTHONPATH
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/Utilities/VTKPythonWrapping
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$


gschaider September 9, 2013 14:14

Quote:

Originally Posted by wouter (Post 450289)
Dear All,
I experience similar problems with OpenFOAM2.2.x on Ubuntu13.04 (64bit) an I hope someone knows a solution because I want to print a lot of snapshots and I hoped pyFoam could help me.
I folowed this thread and collected all the data asked for. Please feel free to ask for additional information

best regards
wouter

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm
Traceback (most recent call last):
  File "/usr/local/bin/pyFoamPVSnapshot.py", line 3, in <module>
    from PyFoam.Applications.PVSnapshot import PVSnapshot
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Applications/PVSnapshot.py", line 13, in <module>
    from PyFoam.Paraview.ServermanagerWrapper import ServermanagerWrapper as SM
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Paraview/__init__.py", line 15, in <module>
    from paraview import servermanager
ImportError: No module named paraview


That's strange because pvpython knew the paraview module (thanks for the diagnosis output BTW). Now I have a big suspicion. Check how the file /usr/local/bin/pyFoamPVSnapshot.py looks like. At my machine it looks like this
Code:

#! /usr/bin/env pvpython


from PyFoam.Applications.PVSnapshot import PVSnapshot

PVSnapshot()

You installed with setup.py right? I think it may be possible that this replaces the pvpython in the first line with python. If that is the case replace it with pvpython and retry. If that fixes it I'd be grateful for a bug-report on the Mantis (so that I get around to fixing it. My problem is that I rarely install with setup.py so I stumbled onto this problem some time ago and forgot to fix it permanently)

wouter September 9, 2013 17:39

Dear gschaider,
Thank you for responding. You were right with your assumption. I changed the header and I got a different error
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=test.pvsm --time=10 .
 Warning in /usr/local/bin/pyFoamPVSnapshot.py : This utilitiy currently does not work with OF>=1.6 because the API in Paraview>=3.6 has changed. But we'll try
ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 324
vtkPVSessionCore (0x152def0): Attempt to assign existing ID 1.
while processing
Message 0 = Assign
  Argument 0 = id_value {1}
  Argument 1 = vtk_object_pointer {vtkPVSessionCoreInterpreterHelper (0x3790960)}


ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 325
vtkPVSessionCore (0x152def0): Aborting execution for debugging purposes.

Aborted (core dumped)

There was no core dump. As far as I know I downloaded the latest version of pyFoam so I have to make two bug reports?
one for the header and one for the older version. I will look up how to make a bugreport.
Thanks again.

Best regards
Wouter

I found that this is already in a bugreport of 2009

gschaider September 9, 2013 18:28

Quote:

Originally Posted by wouter (Post 450785)
Dear gschaider,
Thank you for responding. You were right with your assumption. I changed the header and I got a different error
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=test.pvsm --time=10 .
 Warning in /usr/local/bin/pyFoamPVSnapshot.py : This utilitiy currently does not work with OF>=1.6 because the API in Paraview>=3.6 has changed. But we'll try
ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 324
vtkPVSessionCore (0x152def0): Attempt to assign existing ID 1.
while processing
Message 0 = Assign
  Argument 0 = id_value {1}
  Argument 1 = vtk_object_pointer {vtkPVSessionCoreInterpreterHelper (0x3790960)}


ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 325
vtkPVSessionCore (0x152def0): Aborting execution for debugging purposes.

Aborted (core dumped)

There was no core dump. As far as I know I downloaded the latest version of pyFoam so I have to make two bug reports?
one for the header and one for the older version. I will look up how to make a bugreport.
Thanks again.

... and one for the misspelling of utility in the warning ;)

I just tried PVSnapshot on my machine and it works. I use a Kitware-Binary PV 3.98.1 (so it is unlikely that your 3.12 broke i) with a state-file that has a file for the built-in reader (.foam). Are you by any chance using the PV3Reader (.OpenFOAM)? If yes: could you try a simple state file using a .foam-file?

For a bug report I'll need the state-file and a case (preferably small) to reproduce the error

wouter September 10, 2013 07:49

1 Attachment(s)
Dear gschaider,
Thank you for responding. Attached a casefile for testing. I tried with paraFoam -builtin to make the .pvsm file but this does not change anything.
Is this what you meant with with simple state. I had .Openfoam and I got .foam but after pyFoamPVSnapshot.py I had Openfoam also.
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ paraFoam -builtin
created temporary 'testje.foam'
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ ls testje.*
testje.pvsm
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm --time=5 .
 Warning in /usr/local/bin/pyFoamPVSnapshot.py : This utilitiy currently does not work with OF>=1.6 because the API in Paraview>=3.6 has changed. But we'll try
ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 324
vtkPVSessionCore (0x27a1f60): Attempt to assign existing ID 1.
while processing
Message 0 = Assign
  Argument 0 = id_value {1}
  Argument 1 = vtk_object_pointer {vtkPVSessionCoreInterpreterHelper (0x4817490)}


ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 325
vtkPVSessionCore (0x27a1f60): Aborting execution for debugging purposes.

Aborted (core dumped)
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ ls testje.*
testje.foam  testje.OpenFOAM  testje.pvsm

hope this helps
Regards
Wouter

gschaider September 10, 2013 08:18

1 Attachment(s)
Thanks for the test case and bad news (see below; just building up the suspense):
Quote:

Originally Posted by wouter (Post 450913)
Dear gschaider,
Thank you for responding. Attached a casefile for testing. I tried with paraFoam -builtin to make the .pvsm file but this does not change anything.
Is this what you meant with with simple state. I had .Openfoam and I got .foam but after pyFoamPVSnapshot.py I had Openfoam also.
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ paraFoam -builtin
created temporary 'testje.foam'
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ ls testje.*
testje.pvsm
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm --time=5 .
 Warning in /usr/local/bin/pyFoamPVSnapshot.py : This utilitiy currently does not work with OF>=1.6 because the API in Paraview>=3.6 has changed. But we'll try
ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 324
vtkPVSessionCore (0x27a1f60): Attempt to assign existing ID 1.
while processing
Message 0 = Assign
  Argument 0 = id_value {1}
  Argument 1 = vtk_object_pointer {vtkPVSessionCoreInterpreterHelper (0x4817490)}


ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 325
vtkPVSessionCore (0x27a1f60): Aborting execution for debugging purposes.

Aborted (core dumped)
wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ ls testje.*
testje.foam  testje.OpenFOAM  testje.pvsm

hope this helps
Regards
Wouter

The Bad News is that it works for me without problems (see attached image as proof). The image was done with a precompiled ParaView3.98.1 on a Mac (so that is as different from your configuration as it could get). I'm pretty sure that I didn't change anything to the Paraview-code since the last release of PyFoam (and my logs support me in that)
Attachment 25268
So I'm afraid this is a problem with Paraview. Try the following:
- Try loading the state file with "Load state" from the menue
- Try a different version binary of Paraview from KitWare
and see if you get a similar error message

wouter September 10, 2013 08:35

Dear gschaider,
Thank you for the information. I will try to install paraview but I have some bad experiences with that on an other computer.
It will take a will
I wil get back with the results
Regards
Wouter

gschaider September 10, 2013 17:45

Quote:

Originally Posted by wouter (Post 450928)
Dear gschaider,
Thank you for the information. I will try to install paraview but I have some bad experiences with that on an other computer.
It will take a will
I wil get back with the results

Good. I'm afraid the issue is outside of my control but I'm willing to find a workaround. One last thing: try the "official" way to load a state-file in pvpython http://paraview.org/Wiki/ParaView/Py...anipulating_It
If that fails then there is a problem with your paraview I'd say

wouter September 11, 2013 04:56

Dear gschaider,
Thank you for the persistance. This evening I certainly will try this. I can load the statefile with paraview --state=testje.pvsm. but I did not try it with pvpython. Thanks for the link.

Best regards
Wouter

wouter September 11, 2013 14:03

2 Attachment(s)
Dear gschaider,

Yesterday I tried things and tonight I continued.
first test
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ paraview --state=testje.pvsm
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
.
.
.
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
Inconsistency detected by ld.so: dl-close.c: 765: _dl_close: Assertion `map->l_init_called' failed!

The picture was visible in paraview as it was when making the .pvsm file. So no problem with paraview 3.12 only warnings.

Second test with OF221 debian binary and paraviewopenfoam debian binary
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.1/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm --time=5 .
Traceback (most recent call last):
  File "/usr/local/bin/pyFoamPVSnapshot.py", line 3, in <module>
    from PyFoam.Applications.PVSnapshot import PVSnapshot
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Applications/PVSnapshot.py", line 13, in <module>
    from PyFoam.Paraview.ServermanagerWrapper import ServermanagerWrapper as SM
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Paraview/__init__.py", line 15, in <module>
    from paraview import servermanager
  File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module>
    import paraview, re, os, os.path, new, sys, vtk
  File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module>
    from vtkCommonPython import *
ImportError: No module named vtkCommonPython

not compiled with python support so no go.

Back to OF22x
from paraView see picture (it works)
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pvpython
Python 2.7.4 (default, Jul  5 2013, 08:24:51)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from paraview.simple import *
paraview version 3.12.0, Date: 2011-07-26
>>> servermanager.LoadState("./testje.pvsm")
>>> SetActiveView(GetRenderView())
>>> Render()
<paraview.servermanager.RenderView object at 0x7fae9f56dfd0>

I got a picture Visualization Toolkit OpenGL

The next core dump I missed the cause of and I cannot reproduce it, but maybe it helps
Code:

XIO:  fatal IO error 0 (Success) on X server ":0"
      after 85 requests (85 known processed) with 6 events remaining.
*** Error in `/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/pvpython': double free or corruption (!prev): 0x0000000002d92d10 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x80a46)[0x7fae9d5daa46]
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/libvtkPVServerImplementation.so(_ZN18vtkSIProxyPropertyD1Ev+0x78)[0x7fae9cb86c28]
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/libvtkPVServerImplementation.so(_ZN18vtkSIProxyPropertyD0Ev+0x9)[0x7fae9cb86cc9]
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/libvtkPVServerImplementation.so(_ZNSt8_Rb_treeISsSt4pairIKSs15vtkSmartPointerI13vtkSIPropertyEESt10_Select1stIS5_ESt4lessISsESaIS5_EE8_M_eraseEPSt13_Rb_tree_nodeIS5_E+0x36c)[0x7fae9cb7a48c]
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/libvtkPVServerImplementation.so(_ZN10vtkSIProxyD1Ev+0x3f)[0x7fae9cb778bf]
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/libvtkPVServerImplementation.so(_ZN16vtkSISourceProxyD0Ev+0x9)[0x7fae9cb8cff9]
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/libvtkPVServerImplementation.so(_ZN16vtkPVSessionCoreD1Ev+0x1be)[0x7fae9cb6609e]
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/libvtkPVServerImplementation.so(_ZN16vtkPVSessionCoreD0Ev+0x9)[0x7fae9cb66159]
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/libvtkPVServerImplementation.so(_ZN16vtkPVSessionBaseD1Ev+0x3f)[0x7fae9cb61d4f]
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/libvtkPVServerManager.so(_ZN12vtkSMSessionD0Ev+0x9)[0x7fae9efdaa29]
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/libvtkPVClientServerCore.so(_ZNSt8_Rb_treeIxSt4pairIKx15vtkSmartPointerI10vtkSessionEESt10_Select1stIS5_ESt4lessIxESaIS5_EE8_M_eraseEPSt13_Rb_tree_nodeIS5_E+0x207)[0x7fae9ec41c17]
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/libvtkPVClientServerCore.so(_ZN16vtkProcessModuleD2Ev+0x80)[0x7fae9ec411b0]
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/libvtkPVClientServerCore.so(_ZN16vtkProcessModuleD0Ev+0x9)[0x7fae9ec41219]
/lib/x86_64-linux-gnu/libc.so.6(__cxa_finalize+0x9a)[0x7fae9d59652a]
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/libvtkPVClientServerCore.so(+0x925f3)[0x7fae9ebca5f3]
======= Memory map: ========
00400000-00402000 r-xp 00000000 08:06 10098096                          /home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/pvpython
00602000-00603000 r--p 00002000 08:06 10098096                          /home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/pvpython
00603000-00604000 rw-p 00003000 08:06 10098096                          /home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/pvpython
014a4000-03826000 rw-p 00000000 00:00 0                                  [heap]
7fae77f8e000-7fae77fae000 rw-s 12b42c000 00:05 11642                    /dev/dri/card0
7fae77fae000-7fae789ae000 rwxp 00000000 00:00 0
7fae789ae000-7fae78a2e000 rw-s 1156ea000 00:05 11642                    /dev/dri/card0
7fae78a2e000-7fae78eb4000 rw-p 00000000 00:00 0
7fae78eb4000-7fae78f34000 rw-s 115165000 00:05 11642                    /dev/dri/card0
7fae78f34000-7fae78f66000 r-xp 00000000 08:06 2368350                    /usr/lib/x86_64-linux-gnu/libtxc_dxtn_s2tc.so.0.0.0
7fae78f66000-7fae79165000 ---p 00032000 08:06 2368350                    /usr/lib/x86_64-linux-gnu/libtxc_dxtn_s2tc.so.0.0.0
7fae79165000-7fae79166000 r--p 00031000 08:06 2368350                    /usr/lib/x86_64-linux-gnu/libtxc_dxtn_s2tc.so.0.0.0
7fae79166000-7fae79167000 rw-p 00032000 08:06 2368350                    /usr/lib/x86_64-linux-gnu/libtxc_dxtn_s2tc.so.0.0.0
7fae79167000-7fae7a581000 r-xp 00000000 08:06 2367484                    /usr/lib/x86_64-linux-gnu/libLLVM-3.2.so.1
7fae7a581000-7fae7a780000 ---p 0141a000 08:06 2367484                    /usr/lib/x86_64-linux-gnu/libLLVM-3.2.so.1
7fae7a780000-7fae7a87b000 r--p 01419000 08:06 2367484                    /usr/lib/x86_64-linux-gnu/libLLVM-3.2.so.1
7fae7a87b000-7fae7a881000 rw-p 01514000 08:06 2367484                    /usr/lib/x86_64-linux-gnu/libLLVM-3.2.so.1
7fae7a881000-7fae7a88f000 rw-p 00000000 00:00 0
7fae7a88f000-7fae7a894000 r-xp 00000000 08:06 2367760                    /usr/lib/x86_64-linux-gnu/libdrm_nouveau.so.2.0.0
7fae7a894000-7fae7aa93000 ---p 00005000 08:06 2367760                    /usr/lib/x86_64-linux-gnu/libdrm_nouveau.so.2.0.0
7fae7aa93000-7fae7aa94000 r--p 00004000 08:06 2367760                    /usr/lib/x86_64-linux-gnu/libdrm_nouveau.so.2.0.0
7fae7aa94000-7fae7aa95000 rw-p 00005000 08:06 2367760                    /usr/lib/x86_64-linux-gnu/libdrm_nouveau.so.2.0.0
7fae7aa95000-7fae7ac99000 r-xp 00000000 08:06 2363811                    /usr/lib/x86_64-linux-gnu/libgallium.so.0.0.0
7fae7ac99000-7fae7ae99000 ---p 00204000 08:06 2363811                    /usr/lib/x86_64-linux-gnu/libgallium.so.0.0.0
7fae7ae99000-7fae7aea8000 r--p 00204000 08:06 2363811                    /usr/lib/x86_64-linux-gnu/libgallium.so.0.0.0
7fae7aea8000-7fae7aeac000 rw-p 00213000 08:06 2363811                    /usr/lib/x86_64-linux-gnu/libgallium.so.0.0.0
7fae7aeac000-7fae7b074000 rw-p 00000000 00:00 0
7fae7b074000-7fae7b412000 r-xp 00000000 08:06 2363812                    /usr/lib/x86_64-linux-gnu/libdricore9.1.4.so.1.0.0
7fae7b412000-7fae7b612000 ---p 0039e000 08:06 2363812                    /usr/lib/x86_64-linux-gnu/libdricore9.1.4.so.1.0.0
7fae7b612000-7fae7b623000 r--p 0039e000 08:06 2363812                    /usr/lib/x86_64-linux-gnu/libdricore9.1.4.so.1.0.0
7fae7b623000-7fae7b62d000 rw-p 003af000 08:06 2363812                    /usr/lib/x86_64-linux-gnu/libdricore9.1.4.so.1.0.0
7fae7b62d000-7fae7b644000 rw-p 00000000 00:00 0
7fae7b644000-7fae7b787000 r-xp 00000000 08:06 2622187                    /usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so
7fae7b787000-7fae7b986000 ---p 00143000 08:06 2622187                    /usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so
7fae7b986000-7fae7b989000 r--p 00142000 08:06 2622187                    /usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so
7fae7b989000-7fae7b98c000 rw-p 00145000 08:06 2622187                    /usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so
7fae7b98c000-7fae7b98e000 rw-p 00000000 00:00 0
7fae7b98e000-7fae7b9bd000 r-xp 00000000 08:06 11673993                  /home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/liblagrangian.so
7fae7b9bd000-7fae7bbbc000 ---p 0002f000 08:06 11673993                  /home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/liblagrangian.so
7fae7bbbc000-7fae7bbbe000 r--p 0002e000 08:06 11673993                  /home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/liblagrangian.so
7fae7bbbe000-7fae7bbbf000 rw-p 00030000 08:06 11673993                  /home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/liblagrangian.so
7fae7bbbf000-7fae7bbc0000 rw-p 00000000 00:00 0
7fae7bbc0000-7fae7bcdb000 r-xp 00000000 08:06 11673995                  /home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/libgenericPatchFields.so
7fae7bcdb000-7fae7bedb000 ---p 0011b000 08:06 11673995                  /home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/libgenericPatchFields.so
7fae7bedb000-7fae7bedf000 r--p 0011b000 08:06 11673995                  /home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/libgenericPatchFields.so
7fae7bedf000-7fae7bee4000 rw-p 0011f000 08:06 11673995                  /home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/libgenericPatchFields.so
7fae7bee4000-7fae7c098000 r-xp 00000000 08:06 11672144                  /home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/libvtkPV3Foam.so
7fae7c098000-7fae7c297000 ---p 001b4000 08:06 11672144                  /home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/libvtkPV3Foam.so
7fae7c297000-7fae7c29b000 r--p 001b3000 08:06 11672144                  /home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/libvtkPV3Foam.so
7fae7c29b000-7fae7c2a3000 rw-p 001b7000 08:06 11672144                  /home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/libvtkPV3Foam.so
7fae7c2a3000-7fae7c2ca000 r-xp 00000000 08:06 21239773                  /home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/paraview-3.12/libPV3FoamReader_SM.so
7fae7c2ca000-7fae7c4ca000 ---p 00027000 08:06 21239773                  /home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/paraview-3.12/libPV3FoamReader_SM.so
7fae7c4ca000-7fae7c4cb000 r--p 00027000 08:06 21239773                  /home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/paraview-3.12/libPV3FoamReader_SM.so
7fae7c4cb000-7fae7c4cc000 rw-p 00028000 08:06 21239773                  /home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/paraview-3.12/libPV3FoamReader_SM.so
7fae7c4cc000-7fae7c63e000 r-xp 00000000 08:06 9310148                    /home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/openmpi-1.6.3/lib64/libmpi.so.1.0.6
7fae7c63e000-7fae7c83e000 ---p 00172000 08:06 9310148                    /home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/openmpi-1.6.3/lib64/libmpi.so.1.0.6
7fae7c83e000-7fae7c843000 r--p 00172000 08:06 9310148                    /home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/openmpi-1.6.3/lib64/libmpi.so.1.0.6Aborted (core dumped)

to be sure I tried pyFoamPVSnapshot.py again:
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm --time=1 .
 Warning in /usr/local/bin/pyFoamPVSnapshot.py : This utilitiy currently does not work with OF>=1.6 because the API in Paraview>=3.6 has changed. But we'll try
ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 324
vtkPVSessionCore (0x1944f60): Attempt to assign existing ID 1.
while processing
Message 0 = Assign
  Argument 0 = id_value {1}
  Argument 1 = vtk_object_pointer {vtkPVSessionCoreInterpreterHelper (0x38cf130)}


ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 325
vtkPVSessionCore (0x1944f60): Aborting execution for debugging purposes.

Aborted (core dumped)

maybe this caused the previous coredump, but it is before the command.

Is there an easy way to use the system paraview3.98-python with openfoam 2.2.x? My attempt to build paraview3.98 and use it in openfoam failed because of missing headerfiles or headerfiles in the wrong places.
any help is appreciated.
best regards
wouter

gschaider September 11, 2013 18:08

Quote:

Originally Posted by wouter (Post 451195)
Dear gschaider,

Yesterday I tried things and tonight I continued.
first test
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ paraview --state=testje.pvsm
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
.
.
.
QVariantMap DBusMenuExporterDBus::getProperties(int, const QStringList&) const: Condition failed: action
Inconsistency detected by ld.so: dl-close.c: 765: _dl_close: Assertion `map->l_init_called' failed!

The picture was visible in paraview as it was when making the .pvsm file. So no problem with paraview 3.12 only warnings.

Pitty. That would have solved the problem ... for me
Quote:

Originally Posted by wouter (Post 451195)
Second test with OF221 debian binary and paraviewopenfoam debian binary
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.1/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm --time=5 .
Traceback (most recent call last):
  File "/usr/local/bin/pyFoamPVSnapshot.py", line 3, in <module>
    from PyFoam.Applications.PVSnapshot import PVSnapshot
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Applications/PVSnapshot.py", line 13, in <module>
    from PyFoam.Paraview.ServermanagerWrapper import ServermanagerWrapper as SM
  File "/usr/local/lib/python2.7/dist-packages/PyFoam/Paraview/__init__.py", line 15, in <module>
    from paraview import servermanager
  File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module>
    import paraview, re, os, os.path, new, sys, vtk
  File "/opt/paraviewopenfoam3120/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py", line 1, in <module>
    from vtkCommonPython import *
ImportError: No module named vtkCommonPython

not compiled with python support so no go.

Or the library files in the PYTHONPATH. Only good way to check for Python-support is in the GUI: if no Python-Shell or Programmable-Filter in the menus then there is no Python-support
Quote:

Originally Posted by wouter (Post 451195)
Back to OF22x
from paraView see picture (it works)
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pvpython
Python 2.7.4 (default, Jul  5 2013, 08:24:51)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from paraview.simple import *
paraview version 3.12.0, Date: 2011-07-26
>>> servermanager.LoadState("./testje.pvsm")
>>> SetActiveView(GetRenderView())
>>> Render()
<paraview.servermanager.RenderView object at 0x7fae9f56dfd0>

I got a picture Visualization Toolkit OpenGL

The next core dump I missed the cause of and I cannot reproduce it, but maybe it helps
Code:

XIO:  fatal IO error 0 (Success) on X server ":0"
      after 85 requests (85 known processed) with 6 events remaining.
*** Error in `/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/pvpython': double free or corruption (!prev): 0x0000000002d92d10 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x80a46)[0x7fae9d5daa46]
/home/wouter/OpenFOAM/ThirdParty-2.2.x/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12/libvtkPVServerImplementation.so(_ZN18vtkSIProxyPropertyD1Ev+0x78)[0x7fae9cb86c28]

....


I'm afraid without intimate knowledge of the VTK/Paraview sources this is quite hard to interpret. But would be good to know which command caused it
Quote:

Originally Posted by wouter (Post 451195)
to be sure I tried pyFoamPVSnapshot.py again:
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm --time=1 .
 Warning in /usr/local/bin/pyFoamPVSnapshot.py : This utilitiy currently does not work with OF>=1.6 because the API in Paraview>=3.6 has changed. But we'll try
ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 324
vtkPVSessionCore (0x1944f60): Attempt to assign existing ID 1.
while processing
Message 0 = Assign
  Argument 0 = id_value {1}
  Argument 1 = vtk_object_pointer {vtkPVSessionCoreInterpreterHelper (0x38cf130)}


ERROR: In /home/wouter/OpenFOAM/ThirdParty-2.2.x/ParaView-3.12.0/ParaViewCore/ServerImplementation/vtkPVSessionCore.cxx, line 325
vtkPVSessionCore (0x1944f60): Aborting execution for debugging purposes.

Aborted (core dumped)

maybe this caused the previous coredump, but it is before the command.

Is there an easy way to use the system paraview3.98-python with openfoam 2.2.x? My attempt to build paraview3.98 and use it in openfoam failed because of missing headerfiles or headerfiles in the wrong places.
any help is appreciated.
best regards
wouter

Using it with the built-in reader is always possible. I' only had a quick look at compiling the OF-Reader. I'm afraid fixing it won't be trivial because 3.98 is practically the Beta for 4.0 where parts of the API are changing

If you still want to find the problem in pyFoam then the next thing would be to sprinkle the code with print-statements to see which call breaks everything (as the PV-libraries cause a core-dump there is no stack-trace).

One candidate would be before and after
Code:

sm.LoadState(newState)
in PVSnapshot.py to see if this is the problem

wouter September 12, 2013 07:19

Hello gschaider,
Thanks again for your commitment to pyFoam. I will try to follow the program and see where the interface has problems. It will take a while because my python knowledge is minimal.
Best regards
wouter

gschaider September 12, 2013 10:57

Quote:

Originally Posted by wouter (Post 451333)
Hello gschaider,
Thanks again for your commitment to pyFoam. I will try to follow the program and see where the interface has problems. It will take a while because my python knowledge is minimal.
Best regards
wouter

Just add something like
Code:

print "I'm before ReadState"
before ReadState (and similar after). The only important thing is that the number of spaces before the print has to be the same as the command (indentation is Pyhons {} )

Sorry to offload debugging to you but it'd take me to long to reproduce the environment you have

wouter September 12, 2013 16:58

Hello gschaider,
As I wrote, my knoledge of Python is minimal. Can you tell me where I can find the module PVSnapshot.py that is called, or do I have to "compile" with setup.py
best regards
wouter
edit:
I found it in usr/local/lib/python2.7/dist-packages/PyFoam/Applications.
I also found that it goes wrong at calling SM(PV3FoamReader)

gschaider September 12, 2013 17:44

1 Attachment(s)
Quote:

Originally Posted by wouter (Post 451413)
Hello gschaider,
As I wrote, my knoledge of Python is minimal. Can you tell me where I can find the module PVSnapshot.py that is called, or do I have to "compile" with setup.py
best regards
wouter
edit:
I found it in usr/local/lib/python2.7/dist-packages/PyFoam/Applications.
I also found that it goes wrong at calling SM(PV3FoamReader)

That would be the ServerManagerWrapper.py (that file is used to work around different versions of Paraview. I was hoping that the problem is not there). Anyway. Discovered that in fact I worked on that file recently to make it work with 3.98 (probably I forgot it because I was just fixing it to get the real work done). Anyway. Could you use the uploaded version (had to zip it because the Forum doesn't accept Python-files) and the one you have with it. If that doesn't fix it (and I'm afraid it won't) I'll have to ask you to put in prints again to find out which command triggers the problem

Attachment 25324

wouter September 12, 2013 17:58

Hello gschaider,
what do I do with this file? I cannot find this file on my system and I do know to little of python to know where to put this file.
Regards
Wouter
Edit: found it (typo in find). It is the same as you sent me (diff gave only header difference) so I go on with print and report back, but not tonight anymore.

wouter September 13, 2013 11:32

1 Attachment(s)
Hello gschaider,
succes.
Code:

        print "in __init__ ServermanagerWrapper.py" #added by wouter
        try:
            #removed by wouter self.con=self.module().Connect()
            self.con=None  #added by wouter
        except RuntimeError:
            # 3.98 doesn't seem to need this naymore
            self.con=None

Gives me the nice picture attached.
Thank you for the patience

Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm --time=2 . >log.PVSS
 PyFoam WARNING on line 68 of file /usr/local/lib/python2.7/dist-packages/PyFoam/Paraview/ServermanagerWrapper.py : Could not find libPV3FoamReader.so in ['/home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib', '/home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/paraview-3.12']
Inconsistency detected by ld.so: dl-close.c: 765: _dl_close: Assertion `map->l_init_called' failed!

This is not of consequence? The program generates the picture.

edit2:
in ServermanagerWrapper.py I replaced libPV3FoamReader.so into libvtkPV3Reader.so and the error message disappeared except for the Inconsistency. Still I get the pictures I want. I get the last error or warning also if I use paraview.

Best regards
wouter

gschaider September 16, 2013 15:18

Quote:

Originally Posted by wouter (Post 451571)
Hello gschaider,
succes.
Code:

        print "in __init__ ServermanagerWrapper.py" #added by wouter
        try:
            #removed by wouter self.con=self.module().Connect()
            self.con=None  #added by wouter
        except RuntimeError:
            # 3.98 doesn't seem to need this naymore
            self.con=None

Gives me the nice picture attached.
Thank you for the patience

So the failure happened exactly at the connect line? Which is a bummer. Because that is exactly what the try should work around: "If it fails on Python-level set to None and continue". But if it fails one level deeper it is har to do anything.
Quote:

Originally Posted by wouter (Post 451571)
Code:

wouter@wouter-desktop:~/OpenFOAM/wouter-2.2.x/run/projects/testje$ pyFoamPVSnapshot.py --state=testje.pvsm --time=2 . >log.PVSS
 PyFoam WARNING on line 68 of file /usr/local/lib/python2.7/dist-packages/PyFoam/Paraview/ServermanagerWrapper.py : Could not find libPV3FoamReader.so in ['/home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib', '/home/wouter/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPDebug/lib/paraview-3.12']
Inconsistency detected by ld.so: dl-close.c: 765: _dl_close: Assertion `map->l_init_called' failed!

This is not of consequence? The program generates the picture.

edit2:
in ServermanagerWrapper.py I replaced libPV3FoamReader.so into libvtkPV3Reader.so and the error message disappeared except for the Inconsistency. Still I get the pictures I want. I get the last error or warning also if I use paraview.

But that is still with you fix above (comment out Connect) in place?

wouter September 16, 2013 17:07

Hello gschaider,
The 'fix' was still in place. Because of the fix the program worked but there was still an error. I looked for it and found that the library called was not available and I replaced it with one that was available in PV3FoamReader directory.
The last error has something to do with my Thirdparty paraview, because if I only use paraview this error occures, not with paraFoam and not with /usr/bin/paraview. I tried to rebuild it but the error remained.

Best Regards
Wouter

gschaider September 17, 2013 14:17

Quote:

Originally Posted by wouter (Post 452098)
Hello gschaider,
The 'fix' was still in place. Because of the fix the program worked but there was still an error. I looked for it and found that the library called was not available and I replaced it with one that was available in PV3FoamReader directory.
The last error has something to do with my Thirdparty paraview, because if I only use paraview this error occures, not with paraFoam and not with /usr/bin/paraview. I tried to rebuild it but the error remained.

Best Regards
Wouter

Thanks for the clarification. I'll have to see what to do about he fix. Because leaving out the Connect (or removing the whole try/except-business) will disable old versions of Paraview while it seems to crash new ones.


All times are GMT -4. The time now is 23:30.