CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Segmentation Fault with ParaView After Upgrade (https://www.cfd-online.com/Forums/openfoam-installation/114479-segmentation-fault-paraview-after-upgrade.html)

DavidOuellette March 11, 2013 22:11

Segmentation Fault with ParaView After Upgrade
 
Hi all,

I recently upgraded OF to v2.2.0. However, whenever I run a case and view the results with paraView, I get the following error; whereby paraView just automatically closes.

HTML Code:

Segmentation fault (core dumped)
However, I can view the "partial" results if I type the following into the terminal,

Code:

paraFoam -builtin
This however, as I mentioned, only gives "partial" results as indicated in paraView. And unfortunately, these results are gibberish. The results did work just fine prior to updating OF.

Does anyone have any ideas on how to solve this problem?

Thanks,
David

sudo March 25, 2013 12:40

I ran into the same problem and posted it on a new thread as I haven't seen this one. Here is what I posted:


------------------------------------
So, as suggested by another member here I was trying to run the motorBike example found in
Quote:

$FOAM_TUTORIALS/incompressible/simpleFoam/motorBike
I executed from a Linux (Ubuntu 12.10 64bit) terminal
Quote:

$ ./Allrun -v
and I have got the following

Code:

Running surfaceFeatureExtract on /home/OF_user/OpenFOAM/OF_user-2.2.0/run/tutorials/incompressible/simpleFoam/motorBike
Running blockMesh on /home/OF_user/OpenFOAM/OF_user-2.2.0/run/tutorials/incompressible/simpleFoam/motorBike
Running decomposePar on /home/OF_user/OpenFOAM/OF_user-2.2.0/run/tutorials/incompressible/simpleFoam/motorBike
Running snappyHexMesh in parallel on /home/OF_user/OpenFOAM/OF_user-2.2.0/run/tutorials/incompressible/simpleFoam/motorBike using 6 processes
Segmentation fault (core dumped)
`0.org' -> `./processor0/0'
`0.org/nut' -> `./processor0/0/nut'
`0.org/include' -> `./processor0/0/include'
`0.org/include/initialConditions' -> `./processor0/0/include/initialConditions'
`0.org/include/frontBackUpperPatches' -> `./processor0/0/include/frontBackUpperPatches'
`0.org/include/fixedInlet' -> `./processor0/0/include/fixedInlet'
`0.org/omega' -> `./processor0/0/omega'
`0.org/k' -> `./processor0/0/k'
`0.org/p' -> `./processor0/0/p'
`0.org/U' -> `./processor0/0/U'
`0.org' -> `./processor1/0'
`0.org/nut' -> `./processor1/0/nut'
`0.org/include' -> `./processor1/0/include'
`0.org/include/initialConditions' -> `./processor1/0/include/initialConditions'
`0.org/include/frontBackUpperPatches' -> `./processor1/0/include/frontBackUpperPatches'
`0.org/include/fixedInlet' -> `./processor1/0/include/fixedInlet'
`0.org/omega' -> `./processor1/0/omega'
`0.org/k' -> `./processor1/0/k'
`0.org/p' -> `./processor1/0/p'
`0.org/U' -> `./processor1/0/U'
`0.org' -> `./processor2/0'
`0.org/nut' -> `./processor2/0/nut'
`0.org/include' -> `./processor2/0/include'
`0.org/include/initialConditions' -> `./processor2/0/include/initialConditions'
`0.org/include/frontBackUpperPatches' -> `./processor2/0/include/frontBackUpperPatches'
`0.org/include/fixedInlet' -> `./processor2/0/include/fixedInlet'
`0.org/omega' -> `./processor2/0/omega'
`0.org/k' -> `./processor2/0/k'
`0.org/p' -> `./processor2/0/p'
`0.org/U' -> `./processor2/0/U'
`0.org' -> `./processor3/0'
`0.org/nut' -> `./processor3/0/nut'
`0.org/include' -> `./processor3/0/include'
`0.org/include/initialConditions' -> `./processor3/0/include/initialConditions'
`0.org/include/frontBackUpperPatches' -> `./processor3/0/include/frontBackUpperPatches'
`0.org/include/fixedInlet' -> `./processor3/0/include/fixedInlet'
`0.org/omega' -> `./processor3/0/omega'
`0.org/k' -> `./processor3/0/k'
`0.org/p' -> `./processor3/0/p'
`0.org/U' -> `./processor3/0/U'
`0.org' -> `./processor4/0'
`0.org/nut' -> `./processor4/0/nut'
`0.org/include' -> `./processor4/0/include'
`0.org/include/initialConditions' -> `./processor4/0/include/initialConditions'
`0.org/include/frontBackUpperPatches' -> `./processor4/0/include/frontBackUpperPatches'
`0.org/include/fixedInlet' -> `./processor4/0/include/fixedInlet'
`0.org/omega' -> `./processor4/0/omega'
`0.org/k' -> `./processor4/0/k'
`0.org/p' -> `./processor4/0/p'
`0.org/U' -> `./processor4/0/U'
`0.org' -> `./processor5/0'
`0.org/nut' -> `./processor5/0/nut'
`0.org/include' -> `./processor5/0/include'
`0.org/include/initialConditions' -> `./processor5/0/include/initialConditions'
`0.org/include/frontBackUpperPatches' -> `./processor5/0/include/frontBackUpperPatches'
`0.org/include/fixedInlet' -> `./processor5/0/include/fixedInlet'
`0.org/omega' -> `./processor5/0/omega'
`0.org/k' -> `./processor5/0/k'
`0.org/p' -> `./processor5/0/p'
`0.org/U' -> `./processor5/0/U'
Running patchSummary in parallel on /home/OF_user/OpenFOAM/OF_user-2.2.0/run/tutorials/incompressible/simpleFoam/motorBike using 6 processes
Segmentation fault (core dumped)
Running potentialFoam in parallel on /home/OF_user/OpenFOAM/OF_user-2.2.0/run/tutorials/incompressible/simpleFoam/motorBike using 6 processes
Segmentation fault (core dumped)
Running simpleFoam in parallel on /home/OF_user/OpenFOAM/OF_user-2.2.0/run/tutorials/incompressible/simpleFoam/motorBike using 6 processes
Segmentation fault (core dumped)
Running reconstructParMesh on /home/OF_user/OpenFOAM/OF_user-2.2.0/run/tutorials/incompressible/simpleFoam/motorBike
Running reconstructPar on /home/OF_user/OpenFOAM/OF_user-2.2.0/run/tutorials/incompressible/simpleFoam/motorBike

On my Ubuntu 12.10 64 bit virtualbox on my windows machine, where OpenFoam 2.2.0 was installed from the repository (as a binary, not compiled), the tutorial worked without a hitch.

Any idea what's the cause of this? Thanks.

EDIT: Just wanted to say that the introductory "Cavity" tutorial worked just fine with the compiled OF, so my "newbie" guess is that it has to do with SnappyHexMesh.
--------------------------------------------



Can anyone help?

DavidOuellette March 25, 2013 12:55

Hey sudo,

What I found, in my case, was when I upgraded to OF 2.2.0, OF was still referring some of its files to my 2.1.1 installation, while others were referred to the 2.2.0 installation.

Unfortunately, I'm not familiar enough with Linux to solve this problem, so the approach I took was reformatting my computer; which solved the problem. For me this approach wasn't a big deal since this computer is dedicated for running OF. And I realize that ideally you want to avoid this. So, hopefully someone else who is more familiar with Linux and OF would know how the solve this referencing problem (assuming this is the reason why your installation is not working).

David

sudo March 25, 2013 14:21

Thanks David,
In my case I compiled OF from source, it took like 3 hrs. to do that. I do not have this problem with the installed binary (same version) so I am thinking something went wrong with the compilation. I will give it a few days then recompile.

wyldckat March 25, 2013 16:46

Greetings to all!

What does your "~/.bashrc" file look like?
Do the last few lines look something like the following :confused::
Code:

source /opt/openfoam211/etc/bashrc
source /opt/openfoam220/etc/bashrc

If it does look like the above, then change those lines to this:
Code:

alias of211='source /opt/openfoam211/etc/bashrc'
alias of220='source /opt/openfoam220/etc/bashrc'

Note: no spaces before or after "="!!!

Then whenever you start a new terminal, decide which version you want, by running:
  • For OpenFOAM 2.1.1:
    Code:

    of211
  • For OpenFOAM 2.2.0:
    Code:

    of220
If you want to change version in the same terminal, then run the following for unloading the previous version:
Code:

wmUNSET
Hopefully this is the solution to your problem! Oh, and keep in mind to do the very first instruction on the tutorials of the user guide, once you're on 2.2.0: http://www.openfoam.org/docs/user/tu...s.php#x4-30002 :D

Best regards,
Bruno

sudo March 26, 2013 14:18

Thanks Bruno but I don't think that's what I have wrong, see, since I compiled OF 2.2.0 from source, the last line of my .bashrc file (that I added per the installation instructions) is

Code:

source $HOME/OpenFOAM/OpenFOAM-2.2.0/etc/bashrc
One more thing, I do not have more than one version on the same machine. The installed binary (from a deb package) is installed on a virtual Ubuntu machine on another computer. Besides, it is also version 2.2.0.

The one compiled from source is the one that is giving me the segmentation fault.

wyldckat April 1, 2013 09:14

Hi sudo,

OK, I've managed to take a look into this... could you attach the file "log.snappyHexMesh" that you should have in the "motorBike" folder. Because inside that file should be the whole story as to why it crashed!

Best regards,
Bruno

sudo April 1, 2013 12:50

Easy as pie, here:

File: log.snappyHexMesh
Code:

--------------------------------------------------------------------------
Sorry!  You were supposed to get help about:
    find-available:not-valid
But I couldn't open the help file:
    /home/OF_user/OpenFOAM/ThirdParty-2.2.0/platforms/linux64Gcc/openmpi-1.6.3/share/openmpi/help-mca-base.txt: No such file or directory.  Sorry!
--------------------------------------------------------------------------
[ZeusUbuntu:30295] *** Process received signal ***
[ZeusUbuntu:30295] Signal: Segmentation fault (11)
[ZeusUbuntu:30295] Signal code: Address not mapped (1)
[ZeusUbuntu:30295] Failing at address: 0x28
[ZeusUbuntu:30295] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7fc8dda9dcb0]
[ZeusUbuntu:30295] [ 1] /usr/lib/libopen-pal.so.0(mca_base_select+0x106) [0x7fc8ddccd7b6]
[ZeusUbuntu:30295] [ 2] /usr/lib/libopen-pal.so.0(opal_crs_base_select+0x7e) [0x7fc8ddcdfdae]
[ZeusUbuntu:30295] [ 3] /usr/lib/libopen-pal.so.0(opal_cr_init+0x303) [0x7fc8ddcbe3a3]
[ZeusUbuntu:30295] [ 4] /usr/lib/libopen-pal.so.0(opal_init+0x17b) [0x7fc8ddcbdd0b]
[ZeusUbuntu:30295] [ 5] /usr/lib/libopen-rte.so.0(orte_init+0x4f) [0x7fc8ddf10aff]
[ZeusUbuntu:30295] [ 6] mpirun() [0x40311f]
[ZeusUbuntu:30295] [ 7] mpirun() [0x402c9c]
[ZeusUbuntu:30295] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fc8dd6f076d]
[ZeusUbuntu:30295] [ 9] mpirun() [0x402b99]
[ZeusUbuntu:30295] *** End of error message **


wyldckat April 1, 2013 13:27

Hi sudo,

:eek: Wicked error... but it seems familiar.

OK, let's try and isolate-and-conquer this thing...

1. Right after you've executed Allrun, try this:
Code:

foamJob -s -p snappyHexMesh -overwrite
With this, does it give the same exact error message?

2. If it does, check the first couple of lines after you've executed that command... you should find something like this:
Code:

Executing: /usr/bin/mpirun -np 6 /opt/openfoam220/bin/foamExec -prefix /opt snappyHexMesh -overwrite -parallel | tee log
Is there anything specifically different, aside from the paths?

3. The error given is likely to either be related to something in the path above, such as a reference to a "machines" file, or it is because there is some network card/interface in the way... I have a reference to a solution on my blog post "Notes about running OpenFOAM in parallel", namely "decomposed case to 2-cores (Not working) (more precisely post #21 has valuable info)"... and I quote:
Quote:

Originally Posted by pkr (Post 292700)
I figured out that the problem is because of the way OpneMPI behaves:
"Unless otherwise specified, Open MPI will greedily use all TCP networks that it can find and try to connect to all peers upon demand (i.e., Open MPI does not open sockets to all of its MPI peers during MPI_INIT -- see this FAQ entry for more details). Hence, if you want MPI jobs to not use specific TCP networks -- or not use any TCP networks at all -- then you need to tell Open MPI."

When using MPI_reduce, the OpenMPI was trying to establish TCP through a different interface. The problem is solved if the following command is used:
mpirun --mca btl_tcp_if_exclude lo,virbr0 -hostfile machines -np 2 /home/rphull/OpenFOAM/OpenFOAM-1.6/bin/foamExec interFoam -parallel

The above command will restrict MPI to use certain networks (lo, vibro in this case).

Best regards,
Bruno

sudo April 1, 2013 13:45

So I did:
Code:

$ ./Allrun
in the motorbike folder, and I got the same error, then did:
Code:

$ foamJob -s -p snappyHexMesh -overwrite
and got an error, only difference, you have an /opt that I don't have before snappyHexMesh, here:
Code:

Parallel processing using OPENMPI with 6 processors
Executing: /usr/bin/mpirun -np 6 /home/OF_user/OpenFOAM/OpenFOAM-2.2.0/bin/foamExec -prefix /home/OF_user/OpenFOAM snappyHexMesh -overwrite -parallel | tee log
--------------------------------------------------------------------------
Sorry!  You were supposed to get help about:
    find-available:not-valid
But I couldn't open the help file:
    /home/OF_user/OpenFOAM/ThirdParty-2.2.0/platforms/linux64Gcc/openmpi-1.6.3/share/openmpi/help-mca-base.txt: No such file or directory.  Sorry!
--------------------------------------------------------------------------
[ZeusUbuntu:31971] *** Process received signal ***
[ZeusUbuntu:31971] Signal: Segmentation fault (11)
[ZeusUbuntu:31971] Signal code: Address not mapped (1)
[ZeusUbuntu:31971] Failing at address: 0x28
[ZeusUbuntu:31971] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7f8cd2376cb0]
[ZeusUbuntu:31971] [ 1] /usr/lib/libopen-pal.so.0(mca_base_select+0x106) [0x7f8cd25a67b6]
[ZeusUbuntu:31971] [ 2] /usr/lib/libopen-pal.so.0(opal_crs_base_select+0x7e) [0x7f8cd25b8dae]
[ZeusUbuntu:31971] [ 3] /usr/lib/libopen-pal.so.0(opal_cr_init+0x303) [0x7f8cd25973a3]
[ZeusUbuntu:31971] [ 4] /usr/lib/libopen-pal.so.0(opal_init+0x17b) [0x7f8cd2596d0b]
[ZeusUbuntu:31971] [ 5] /usr/lib/libopen-rte.so.0(orte_init+0x4f) [0x7f8cd27e9aff]
[ZeusUbuntu:31971] [ 6] /usr/bin/mpirun() [0x40311f]
[ZeusUbuntu:31971] [ 7] /usr/bin/mpirun() [0x402c9c]
[ZeusUbuntu:31971] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f8cd1fc976d]
[ZeusUbuntu:31971] [ 9] /usr/bin/mpirun() [0x402b99]
[ZeusUbuntu:31971] *** End of error message ***
Segmentation fault (core dumped)

I'll take a look at the blog post later, and report back, at this point I hope there is something wrong with the path :D

wyldckat April 1, 2013 13:48

The last quote in my previous post already has the possible solution, which is to specify which network interfaces to ignore. Said interfaces have to be listed directly using the mpirun line.

To know which network interfaces your system has got, you can run:
Code:

ifconfig -a

sudo April 1, 2013 15:10

Ok, so:
1. I ran
Code:

$ ifconfig -a
and got
Code:

eth0      Link encap:Ethernet  HWaddr 00:24:8c:a7:21:f2 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:16 Memory:fbee0000-fbf00000

eth1      Link encap:Ethernet  HWaddr 00:24:8c:a7:22:5d 
          inet addr:192.168.98.106  Bcast:192.168.98.255  Mask:255.255.255.0
          inet6 addr: fe80::224:8cff:fea7:225d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:357135 errors:0 dropped:0 overruns:0 frame:0
          TX packets:136298 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:358853304 (358.8 MB)  TX bytes:15173962 (15.1 MB)
          Interrupt:17 Memory:fbde0000-fbe00000

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:6858 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6858 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:658163 (658.1 KB)  TX bytes:658163 (658.1 KB)

2. So, following the posts you linked to, I did:
Code:

$ mpirun --mca btl_tcp_if_exclude lo,eth0,eth1
and got
Code:

--------------------------------------------------------------------------
Sorry!  You were supposed to get help about:
    orterun:executable-not-specified
But I couldn't open the help file:
    /home/OF_user/OpenFOAM/ThirdParty-2.2.0/platforms/linux64Gcc/openmpi-1.6.3/share/openmpi/help-orterun.txt: No such file or directory.  Sorry!
--------------------------------------------------------------------------

And the Segmentation Fault still persists.

3. I even tried to exclude TCP all together
Code:

$ mpirun --mca btl ^tcp
and got
Code:

--------------------------------------------------------------------------
OF_user@ZeusUbuntu:motorBike$ mpirun --mca btl ^tcp
--------------------------------------------------------------------------
Sorry!  You were supposed to get help about:
    orterun:executable-not-specified
But I couldn't open the help file:
    /home/OF_user/OpenFOAM/ThirdParty-2.2.0/platforms/linux64Gcc/openmpi-1.6.3/share/openmpi/help-orterun.txt: No such file or directory.  Sorry!
--------------------------------------------------------------------------

and the error still persists, now what?

wyldckat April 1, 2013 15:22

You forgot the rest of the train ;) namely:
Code:

-np 6 /home/OF_user/OpenFOAM/OpenFOAM-2.2.0/bin/foamExec -prefix /home/OF_user/OpenFOAM snappyHexMesh -overwrite -parallel | tee log
Therefore, you should have executed:
Code:

mpirun --mca btl_tcp_if_exclude lo,eth0,eth1 -np 6 /home/OF_user/OpenFOAM/OpenFOAM-2.2.0/bin/foamExec -prefix  /home/OF_user/OpenFOAM snappyHexMesh -overwrite -parallel | tee  log
and/or:
Code:

mpirun --mca btl ^tcp -np 6 /home/OF_user/OpenFOAM/OpenFOAM-2.2.0/bin/foamExec -prefix  /home/OF_user/OpenFOAM snappyHexMesh -overwrite -parallel | tee  log

sudo April 1, 2013 15:57

Ok, fair enough but it didn't make any difference, and I think I know why :D.

From the annoying error message about the missing file, it seems that OF is set up to use the Openmpi 1.6.3 that shipped with vesion 2.2.0, thing is I never compiled it! The Openmpi I have is version 1.4.5 that I installed from Ubuntu 12.10 repos to compile OF.

So, in short, do I just follow the instructions in the "INSTALL" file and compile Openmpi 1.6.3 via $ configure and $ make all install? So no wmake? And do I have to uninstall the old version? Just wanna be sure.

Thanks a lot Bruno, your help is much appreciated.

wyldckat April 1, 2013 18:37

Hi sudo,

OK, edit the file "$WM_PROJECT_DIR/etc/bashrc"... you can see it's path by running:
Code:

echo "$WM_PROJECT_DIR/etc/bashrc"
Find the line that says:
Code:

export WM_MPLIB=OPENMPI
Change it to:
Code:

export WM_MPLIB=SYSTEMOPENMPI
Start a new terminal and try again running the application in parallel.
If it still has problems, go to OpenFOAM's folder and run Allwmake once again:
Code:

cd $WM_PROJECT_DIR
./Allwmake > make.log 2>&1

You can check the log "make.log" when it's complete, just to check if something went wrong.

Then try once again running in parallel... hopefully it will now work, ot at least give a proper error message :rolleyes:

Best regards,
Bruno

sudo April 1, 2013 18:59

AWESOME!!! There is at least something to celebrate, the previous error (segmentation fault) is gone. In more details:

1. I did these, just as Bruno suggested.

Code:

echo "$WM_PROJECT_DIR/etc/bashrc"
Then edited the file by replacing
Code:

export WM_MPLIB=OPENMPI
by
Code:

export WM_MPLIB=SYSTEMOPENMPI
2. Running ./Allrun from the motorBike folder, no Segmentation Fault this time, but I got the following in the log.snappyHexMesh, repeated 6 times (once per processor used :D)

Code:

--> FOAM FATAL ERROR:
Trying to use the dummy Pstream library.
This dummy library cannot be used in parallel mode

    From function UPstream::init(int& argc, char**& argv)
    in file UPstream.C at line 37.

FOAM exiting

So I'll try to re wmake OF and see how it goes. But now at least there is something different LOL

sudo April 2, 2013 18:24

I finally did this:
Code:

cd $WM_PROJECT_DIR
./Allwmake > make.log 2>&1

...and SUCCESS!!! snappyHexMesh used 6 processors (confirmed w/ htop) to mesh the motorbike example. So, thanks Bruno for the help, I owe you a round of beer, or a cup of coffee :D


All times are GMT -4. The time now is 22:11.