CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Compilation error with OpenFOAM 2.1.x (https://www.cfd-online.com/Forums/openfoam-installation/99932-compilation-error-openfoam-2-1-x.html)

Martin_ April 16, 2012 09:58

Compilation error with OpenFOAM 2.1.x
 
Hello,

I would like to compile OpenFOAM (from git repository), but I'm getting a compilation error right at the start:

Code:

fileMonitor.C:308:13: warning: use of old-style cast [-Wold-style-cast]
fileMonitor.C:308:13: warning: use of old-style cast [-Wold-style-cast]
fileMonitor.C:308:13: warning: use of old-style cast [-Wold-style-cast]
fileMonitor.C:325:22: warning: use of old-style cast [-Wold-style-cast]
fileMonitor.C:325:22: warning: use of old-style cast [-Wold-style-cast]
fileMonitor.C:325:22: warning: use of old-style cast [-Wold-style-cast]
fileMonitor.C:333:17: error: ‘read’ was not declared in this scope
make: *** [Make/linux64GccDPOpt/fileMonitor.o] Error 1
+ wmake libso OpenFOAM

I guess I need to include a header or qualify the function with namespace name. I tried to search for function 'read' in the C++ documentation on OpenFOAM web, but there is tens of them and I have no clue which one to choose (I'm new to OpenFOAM). Could you please help me?

I updated the sources today. My compiler is gcc 4.7

I have 2 more questions:
- what do I have to set/configure to use a different compiler (clang/intel)?
- it looks like my only friend to search for keywords in the source code is 'grep'. Is there a way of using OpenFOAM from within Qtcreator/KDevelop or some other ide so that the code browsing is easier?

Thank you very much.

Best regards,

Martin Vymazal

wyldckat April 16, 2012 15:25

Greetings Martin and welcome to the forum!

Knowing which operating system you are using also helps. Mainly because we don't know which packages you might need to install.
And AFAIK gcc 4.7 is currently untested with OpenFOAM. Every major release of gcc has needed some sort of adjustment, sometimes due to gcc, others to the linking system.

For a full log of the list of errors, the usual recommendation made is to run like this:
Code:

./Allwmake > make.log 2>&1
This way the whole build process is logged into "make.log". And the first error is usually the one to be blamed.
As for the compiling error, that might not be the main reason for the failed compilation. This is why I mention that the first error is usually the one to be blamed.

As for changing compiler, see "OpenFOAM-2.1.x/etc/bashrc" the variable "WM_COMPILER".

As for IDE: http://openfoamwiki.net/index.php/Ho...M_with_Eclipse

Best regards,
Bruno

Martin_ April 16, 2012 15:45

Hello Bruno,

thank you for your reply. I redirected the error output in a log file in a similar fashion as you mentioned. The error I posted previously is the very first error in that log file. I can post the whole log, but there's really nothing more to see.

My system is Archlinux. I agree that the new gcc can be a problem, but I don't really see why an error regarding an undeclared function 'read' would be related to a missing package in my linux distribution. Do you have an idea where is this function 'read' supposed to come from (i.e. do you know where is it declared)?

Best regards,

Martin Vymazal

wyldckat April 16, 2012 16:07

According to the source code of the file where the error occurs, that function should be defined somewhere in these included files:
Code:

#  include <sys/inotify.h>
#  include <sys/ioctl.h>
#  include <errno.h>

Knowing the Linux version usually helps us (well, mostly me) to try and reproduce the same error, but I've had bad experiences trying to install ArchLinux... More easily I could test Fedora 17, but it's still alpha... which can also lead to bad experiences :rolleyes:

AlmostSurelyRob April 17, 2012 08:26

@wyldcat_: Thank you for redirecting me here. This is to confirm that I have exactly the same problem.

@Martin_: Have you managed to solve this issue perhaps? There's an OpenFOAM package in AUR. Have you tried it?

wyldckat April 19, 2012 18:47

2 Attachment(s)
Greetings to all!

I got curious about Arch Linux and Gcc 4.7.0 that is has and I managed to install the latest stable 2011.08.19 x86_64. I used the net install ISO and installed all of the essential tools needed for building OpenFOAM 2.1.x, without the need to do any changes to the code.

Attached are two lists:
  • "list.txt", which has the output of the command:
    Code:

    pacman -Q
  • "list_e.txt", which has the output of the command:
    Code:

    pacman -Qe
I suggest that you guys compare to your own "installed packages" lists and figure out what packages you're missing ;)

By the way, I didn't try building ParaView, simply because I didn't bother installing X.org ;)

Best regards,
Bruno

AlmostSurelyRob April 21, 2012 08:54

Thanks for doing the cross-check and providing your pacman output.

I can confirm that I have all the relevant packages. The only differences from out pacman -Q commands were dash and xinetd. I also thought that it might be something with my environmental variables because I am sourcing university profile that allows me to run some other applications, but removed that temporarily and I am currently recompiling and I am still seeing the same errors: 'read' was not declared. It's really frustrating.

Also, I can confirm that so far the libOSSpecific.o fix didn't show any negative behaviour. My other compilation seems to be working fine.

wyldckat April 21, 2012 10:35

Hi Robert,

Mmm... OK, there are only a few things that come to my mind:
  • Perhaps it's the installed Arch Linux architecture that is different from the one I used, namely x86_64. What does this output on your command line:
    Code:

    uname -m
  • Try building "OSspecific" manually:
    Code:

    cd src
    cd OSspecific/POSIX
    wclean libo
    wmake libo

    This should rebuild it (1st clean, then make).
  • If your system was upgraded to the latest release of Arch Linux, perhaps something has been left behind...
Best regards,
Bruno

AlmostSurelyRob April 21, 2012 12:01

Hello!

I am happy to report that it works. In the end, it was missing dependencies. What I did was to vimdiff the file and I was actually installing the few missing packages as I was scanning the file comparison. I was missing some gcc packages so compared with your file I was missing

gc
gcc-ada
gcc-go
gcc-objc

The errors were appearing on the first compilation but my comment above was a bit precipitate because they vanished on the second compilation.

It's all fine. Thank you for your help.

Martin_ April 22, 2012 19:06

Hello Robert & Bruno,

I managed to compile OF 2.1.x following these steps:

1) run ./Allwmake in OpenFOAM root directory
2) when the error message about undefined 'read' function appears, stop compilation and do as Bruno said:

Code:

cd src
cd OSspecific/POSIX
wclean libo
wmake libo

3) run again ./Allwmake in OpenFOAM root as in 1). This time, no errors appeared

I was not able to skip step 1) and directly start with 2). I guess the Allwmake does something (set links, environment variables?) that enables the library in 2) to compile.

In my system, installing/not installing the packages

gc
gcc-ada
gcc-go
gcc-objc

didn't make any difference. The 'read' function error is always present. I tested this on 2 machines with Archlinux (laptop and desktop).

I also tried to compile paraFoam. At one point, I got the following error:
Code:

In file included from
OpenFOAM/ThirdParty-2.1.x/ParaView-3.12.0/Qt/Core/pqAnimationScene.cxx:57:0:

OpenFOAM/ThirdParty-2.1.x/ParaView-3.12.0/Qt/Core/pqServerManagerSelectionModel.h:75:30: error: calls to overloaded operators cannot appear in a constant-expression
make[2]: *** [Qt/Core/CMakeFiles/pqCore.dir/pqAnimationScene.cxx.o] Error 1
make[1]: *** [Qt/Core/CMakeFiles/pqCore.dir/all] Error 2
make: *** [all] Error 2

This can be fixed by editing line 75 of the file

OpenFOAM/ThirdParty-2.1.x/ParaView-3.12.0/Qt/Core/pqServerManagerSelectionModel.h:

and replacing
Code:

ClearAndSelect = Clear | Select
by
Code:

ClearAndSelect = static_cast<int>(Clear) | static_cast<int>(Select)
as described here.

After that, paraFOAM compiled and I was able to run a sample test case and visualize results.

Best regards,

Martin Vymazal

AlmostSurelyRob May 1, 2012 12:04

I am sorry. My above post is not valid.

I would like to confirm Martin_'s observation. It is not a dependency issue. The truth is that I have done these things in the same time and compiled successfully. Now I have made a double check and it is the compilation of OSSpecific that is the necessary step for successful compilations not the dependencies that I outlined.

@Martin_: Many thanks for your assiduity.

wyldckat May 2, 2012 06:23

FYI: OpenFOAM 2.1.x has had some additional updates that make things more compatible with Gcc 4.7, so I advise you guys to update!
The updates:
In a nutshell - how to update:
Code:

git pull
./Allwmake


wizzrobe May 3, 2012 15:58

Guys,

Just ran into this error myself on Archlinux. I was responding to a request for help with the AUR package.

The read() function used in src/OSspecific/POSIX/fileManager.C, which throws that error, is defined in the <unistd.h> header file. That file is not in the includes for fileManager.C. All I can imagine is that something else pulls it in somehow when you recompile it get it to work.

For now I'm simply patching that file manually to add "#include <unistd.h>" in the AUR package, along with assorted other fixes, so it builds in one pass.

Obviously some significant changes in gcc 4.7.

EDIT: I haven't tried the latest git clones; looking at the github the same patch I made is in there so Im sure they're fine. This is all based off of the stable 2.1 download. Maybe I have to add an OpenFOAM-git AUR package version.

fisichel October 23, 2012 21:53

Hi,
I tried Bruno's suggestion to
Code:

cd src
cd OSspecific/POSIX
wclean libo
wmake libo

libOSspecific compiled.
I then went back to OpenFOAM-2.1.1/src and requested:
Code:

wmake libso OpenFOAM
It sent back:
Code:

/usr/bin/ld: cannot find -lPstream
Any ideas? I am having trouble compiling OpenFOAM on Debian Linux 6.0.3. So far, I have used apt-get to obtain openMPI, I think I successfully built paraview. I was not successful with scotch, so I decided to move along to openFOAM. Now, I'm stuck. Any help will be appreciated.
Thanks,:)
Chris

wyldckat October 24, 2012 03:32

Greetings Chris and welcome to the forum!

Since you're trying to build OpenFOAM 2.1.1 and using Debian 6.0.3, I believe that the following instructions should work for you: http://openfoamwiki.net/index.php/In...u#Ubuntu_10.04

Best regards,
Bruno

fisichel October 25, 2012 20:34

Stuck on step 3
 
Hi Bruno,

Thanks for the link. The apt-get line was good except for openmpi-bin,

Step 3 is not working too well for me. I'm following the 32 bit instructions since
Code:

uname -m
i686

the next step is to source the OpenFOAM shell file. The error message I get is:

Code:

fisichel@debian:~$ source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc WM_NCOMPPROCS=2 WM_MPLIB=SYSTEMOPENMPI WM_ARCH_OPTION=32
Cannot open configuration file /home/fisichel/OpenFOAM/ThirdParty-2.1.1/platforms/linuxGcc/openmpi-1.5.3/share/openmpi/mpicc-wrapper-data.txt
Error parsing data file mpicc: Not found
Cannot open configuration file /home/fisichel/OpenFOAM/ThirdParty-2.1.1/platforms/linuxGcc/openmpi-1.5.3/share/openmpi/mpicc-wrapper-data.txt
Error parsing data file mpicc: Not found
fisichel@debian:~$

I noticed I have mpicc-wrapper-data.txt at:
Code:

fisichel@debian:~$ find . -name mpicc-wrapper-data.txt -print
./121023_OpenFOAM/ThirdParty-2.1.1/openmpi-1.5.3/ompi/tools/wrappers/mpicc-wrapper-data.txt

That 121023_OpenFOAM directory is from my installation before I tried asking on this thread. I tried compiling each module separately after ./Allwmake did not work.

I think there is an easy solution to this, but I don't want to muck up the installation. Have you run into this before? If so, could you offer some advice?
Thanks,
Chris

wyldckat October 27, 2012 11:43

Hi Chris,

Quote:

Originally Posted by fisichel (Post 388586)
The apt-get line was good except for openmpi-bin,

The instructions from that page require that you install this package, otherwise they will not work as intended.

Nonetheless, if you do not wish to use the system's Open-MPI, then you can try and use the custom build of Open-MPI 1.5.3 which you apparently already have. For that, you'll need to remove "WM_MPLIB=SYSTEMOPENMPI" from the source line, which would result in this:
Code:

source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc WM_NCOMPPROCS=2 WM_ARCH_OPTION=32
Keep in mind that you use this line, then you should also change the one that probably has already been placed at the end of the file "$HOME/.bashrc" (notice the dot before "bashrc").

Additionally, to play it safe, it's best to start a new terminal window/tab, so that you'll have a clean shell environment.

Last but not least, I've finished testing today with Debian 6.0.3 x86_64 in a virtual machine and have adapted the instructions here: http://openfoamwiki.net/index.php/In...ian#Debian_6.0

Best regards,
Bruno

fisichel October 28, 2012 19:42

Hi Bruno,

I was not clear. After checking, I realized I did not install openmpi-bin, but then I did make sure I installed it. After, I had problems.

I went back to the OpenFOAM source installation. It worked. I explicitly changed the OpenFOAM-2.1.1/etc/bashrc entry for architecture to 32 bit, so I could have an invocation of ./Allwmake that did not have any extra parameters. I have not run any test problems yet, so I might still not be out of the woods.

There was an error in the build of scotch. It said it was ignoring the error.

I'm going to wipe the drive and try it again just to make sure the process works. I will check out your experiences, too.

Thanks,
Chris

fisichel November 6, 2012 19:08

Hi Bruno,

My compilation ended up not working. I started in with the tutorials and paraview did not work. I reinstalled Debian 6.0.3 (32 bit) on one machine and 6.0.6 (64 bit) on another machine. The instructions provided in the link worked for both installations. Thanks for making that available. I hope others find it as useful as I did.

Thanks,
Chris

fisichel December 23, 2012 04:33

Hi Bruno,

When you have a chance, I would recommend changing the instructions for the Debian build to include building OpenMPI. SYSTEMOPENMPI is not working correctly: "dummy Pstream library. This dummy library cannot be used in parallel mode."

FYI,
Chris

wyldckat December 24, 2012 10:06

Hi Chris,

Many thanks for the feedback and my apologies for not having tested this properly back then :(.
The fix for you should be to simply run the respective commands in the new step #3: http://openfoamwiki.net/index.php/In...ian#Debian_6.0
By following the new commands, they will write the necessary custom variables into the "etc/prefs.sh" file, therefore making it the standard settings, therefore making it properly read in the remote shells. And don't forget to run them from the base OpenFOAM folder, namely "$HOME/OpenFOAM".

The previous problem is now described here (if you're curious about it ;)): http://www.openfoam.org/mantisbt/view.php?id=231#c1846 - comment #1846

Best regards,
Bruno

fisichel January 6, 2013 00:17

prefs.sh
 
3 Attachment(s)
Hi Bruno,

Thanks for suggesting that fix. I have two machines that use the new instructions. They both have OpenFOAM-2.1.1/etc/prefs.sh. One is a 64 bit machine and the other is a 32 bit machine.

The two machines are referred to as 192.168.1.20 and 192.168.1.21. The .20 machine is the master and the .21 is the slave. Both have two cores.

I can't seem to get this work:

Code:

foamJob -p -s Test-parallel
I set up the damBreak example so that it is closely aligned with your blog: Running OpenFOAM in parallel with different locations for each process. Specifically,

in the laminar directory, I created:
laminar/node0
laminar/node1
laminar/node2
laminar/node3

I modified the damBreak example in the following way:
1. I edited decomposeParDict to request distributed computation. I am attaching that file. I see sometimes after 'root' some documentation says nroots, I noticed you don't have that in yours, but I tried both. I removed a '3' that was previously after roots

2. I copied alpha1.org to alpha1
3. setFields
4. blockMesh
5. decomposePar
6. created a machines file. I'll attach that, too.
7. Each node? directory got a copy of the modified damBreak flle set.
8. I temporarily renamed machines to machines.bak and the following works:

Code:

foamJob -p -s Test-parallel
The output is as you described in this post:
Code:

$ foamJob -p -s Test-parallel
Parallel processing using SYSTEMOPENMPI with 4 processors
Executing: /usr/bin/mpirun -np 4 /home/fisichel/OpenFOAM/OpenFOAM-2.1.1/bin/foamExec -prefix /home/fisichel/OpenFOAM Test-parallel -parallel | tee log
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.1.1-221db2718bbb
Exec  : Test-parallel -parallel
Date  : Jan 05 2013
Time  : 23:04:43
Host  : "debian-6-0-3"
PID    : 9323
Case  : /home/fisichel/OpenFOAM/fisichel-2.1.1/run/tutorials/multiphase/interFoam/laminar/node0/damBreak
nProcs : 4
Slaves :
3
(
"debian-6-0-3.9324"
"debian-6-0-3.9326"
"debian-6-0-3.9330"
)

Roots  :
3
(
"/home/fisichel/OpenFOAM/fisichel-2.1.1/run/tutorials/multiphase/interFoam/laminar/node1"
"/home/fisichel/OpenFOAM/fisichel-2.1.1/run/tutorials/multiphase/interFoam/laminar/node2"
"/home/fisichel/OpenFOAM/fisichel-2.1.1/run/tutorials/multiphase/interFoam/laminar/node3"
)

Pstream initialized with:
    floatTransfer    : 0
    nProcsSimpleSum  : 0
    commsType        : nonBlocking
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

[0] [1]
Starting transfers
[1]
[1] slave sending to master 0
[1] slave receiving from master 0

Starting transfers$ foamJob -p -s Test-parallel
Parallel processing using SYSTEMOPENMPI with 4 processors
Executing: /usr/bin/mpirun -np 4 /home/fisichel/OpenFOAM/OpenFOAM-2.1.1/bin/foamExec -prefix /home/fisichel/OpenFOAM Test-parallel -parallel | tee log
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.1.1-221db2718bbb
Exec  : Test-parallel -parallel
Date  : Jan 05 2013
Time  : 23:04:43
Host  : "debian-6-0-3"
PID    : 9323
Case  : /home/fisichel/OpenFOAM/fisichel-2.1.1/run/tutorials/multiphase/interFoam/laminar/node0/damBreak
nProcs : 4
Slaves :
3
(
"debian-6-0-3.9324"
"debian-6-0-3.9326"
"debian-6-0-3.9330"
)

Roots  :
3
(
"/home/fisichel/OpenFOAM/fisichel-2.1.1/run/tutorials/multiphase/interFoam/laminar/node1"
"/home/fisichel/OpenFOAM/fisichel-2.1.1/run/tutorials/multiphase/interFoam/laminar/node2"
"/home/fisichel/OpenFOAM/fisichel-2.1.1/run/tutorials/multiphase/interFoam/laminar/node3"
)

Pstream initialized with:
    floatTransfer    : 0
    nProcsSimpleSum  : 0
    commsType        : nonBlocking
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

[0] [1]
Starting transfers
[1]
[1] slave sending to master 0
[1] slave receiving from master 0

Starting transfers
[0]
[0] master receiving from slave 1
[0] (0 1 2)
[0] master receiving from slave 2
[2] [3]
Starting transfers
[3]
[3] slave sending to master 0
[3] slave receiving from master 0

Starting transfers
[2]
[2] slave sending to master 0
[2] slave receiving from master 0
[0] (0 1 2)
[0] master receiving from slave 3
[0] (0 1 2)
[0] master sending to slave 1
[0] master sending to slave 2
[0] master sending to slave 3
End

[2] [3] (0 1 2)
Finalising parallel run
[1] ((00  11  22))


[0]
[0] master receiving from slave 1
[0] (0 1 2)
[0] master receiving from slave 2
[2] [3]
Starting transfers
[3]
[3] slave sending to master 0
[3] slave receiving from master 0

Starting transfers
[2]
[2] slave sending to master 0
[2] slave receiving from master 0
[0] (0 1 2)
[0] master receiving from slave 3
[0] (0 1 2)
[0] master sending to slave 1
[0] master sending to slave 2
[0] master sending to slave 3
End

[2] [3] (0 1 2)
Finalising parallel run
[1] ((00  11  22))

Now, to get this to work, I created a global bashrc file. That precipitated changes in .bashrc and /OpenFOAM/OpenFoam-2.1.1./etc/bashrc. I'll attach all the different bashes.

When I rename machines.bak to machines, foamJob picks it up and I get the following error:

Code:

$ foamJob -p -s Test-parallel
Parallel processing using SYSTEMOPENMPI with 4 processors
Executing: /usr/bin/mpirun -np 4 -hostfile machines /home/fisichel/OpenFOAM/OpenFOAM-2.1.1/bin/foamExec -prefix /home/fisichel/OpenFOAM Test-parallel -parallel | tee log
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.1.1-221db2718bbb
Exec  : Test-parallel -parallel
Date  : Jan 05 2013
Time  : 23:56:28
Host  : "debian-6-0-3"
PID    : 10354
[2]
[2]
[2] --> FOAM FATAL IO ERROR:
[2] Expected a ')' or a '}' while reading List, found on line 0 an error
[2]
[2] file: IOstream at line 0.
[2]
[2]    From function Istream::readEndList(const char*)
[2]    in file db/IOstreams/IOstreams/Istream.C at line 159.
[2]
FOAM parallel run exiting
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 2 in communicator MPI_COMM_WORLD
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
[2]
[3]
[3] --------------------------------------------------------------------------
mpirun has exited due to process rank 2 with PID 5792 on
node 192.168.1.21 exiting without calling "finalize". This may
have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).
--------------------------------------------------------------------------

[3] --> FOAM FATAL IO ERROR:
[3] Expected a ')' or a '}' while reading List, found on line 0 an error
[3]
[3] file: IOstream at line 0.
[3]
[3]    From function Istream::readEndList(const char*)
[3]    in file db/IOstreams/IOstreams/Istream.C at line 159.
[3]
FOAM parallel run exiting
[3]
[debian-6-0-3:10350] 1 more process has sent help message help-mpi-api.txt / mpi-abort
[debian-6-0-3:10350] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages

There are a lot of details I'm not including. I'll throw some additional ones out there with the hope someone will know what is going wrong.
a. I open a root terminal on the slave machine via Gnome, and type 'which Test-parallel', and it points to the correct one. I think the environment is there.
b. The node2 and node3 directories were created from the mount command. They actually reside on the slave machine (.21), but I made them part of the master file system to more accurately model your setup. The settings for the mount command were (rw,sync,no_subtree_check)
c.I did have to make changes to etc/bashrc that went beyond what the directions recommends for end users. I need to remove where root was being inserted into the path. I replaced it with my username.
d. I googled the problem and it appears the solution is to go back to openmpi/mpirun 1.4.3. (mantisbt 296) I think I am misapplying that patch, however.

I don't see why I should be getting that error when I introduce a machines file. Any ideas? Your thoughts would be appreciated.

Thanks,
Chris
Attachment 18000

Attachment 18001

Attachment 18002

wyldckat January 6, 2013 14:26

Hi Chris,

:eek: these are a lot of tests and files... I can't figure out from your post if you tested using the two machines with your own user and without using the distributed folders method.

I don't have much time to go into details, so I'll try to summarize the suggestions:
  1. When in doubt, you can check my notes: Notes about running OpenFOAM in parallel - although they are very loose notes :(
  2. The issue about Open-MPI would not occur if the Debian's Open-MPI system version was working. Perhaps it would be a good idea to try it again.
  3. Simplify the test: disable the distributed system and simply make a full copy of the decomposed case to the same path on the second machine.
  4. Ignore multi-user and root: think of your own user first and only. Make sure you can use ssh to the second machine without password, namely by using an ssh key. An example of such a tutorial: http://news.softpedia.com/news/How-t...on-38599.shtml
  5. Also to simplify, make sure OpenFOAM is installed in the same path on both machines and has the same settings files, namely the ones present in "OpenFOAM-2.1.1/etc": "bashrc" and "prefs.sh"
    If these are in the correct place, then "~/.bashrc" on the second machine does not need the "source $HOME/OpenFOAM..." line.
After these steps work, then you can easily start to test doing the gradual changes necessary for the goals you're trying to reach!

Best regards,
Bruno

fisichel January 6, 2013 14:54

Quote:

Originally Posted by wyldckat (Post 400356)
Hi Chris,

:eek: these are a lot of tests and files... I can't figure out from your post if you tested using the two machines with your own user and without using the distributed folders method.

I don't have much time to go into details, so I'll try to summarize the suggestions:
  1. When in doubt, you can check my notes: Notes about running OpenFOAM in parallel - although they are very loose notes :(

I have definitely been reviewing those notes as I have been going along. If I missed something, I apologize.
Quote:

  1. The issue about Open-MPI would not occur if the Debian's Open-MPI system version was working. Perhaps it would be a good idea to try it again.

It sounds like I need to use the compiled openmpi that is distributed with OpenFOAM. I was hoping to stay close to the Debian instructions you provided. By the way, if I get this working, I'll have some useful instructions for that page.

Quote:

  1. Simplify the test: disable the distributed system and simply make a full copy of the decomposed case to the same path on the second machine.

I should have thought of that....thx!
Quote:

  1. Ignore multi-user and root: think of your own user first and only. Make sure you can use ssh to the second machine without password, namely by using an ssh key. An example of such a tutorial: http://news.softpedia.com/news/How-t...on-38599.shtml

I can ssh to the second machine without a password.
Quote:

  1. Also to simplify, make sure OpenFOAM is installed in the same path on both machines and has the same settings files, namely the ones present in "OpenFOAM-2.1.1/etc": "bashrc" and "prefs.sh"
    If these are in the correct place, then "~/.bashrc" on the second machine does not need the "source $HOME/OpenFOAM..." line.

The paths are exactly the same. The prefs.sh files are not, however. The second machine is a 32 bit machine. For this next effort, I'll make the second machine a 64 bit machine so that the prefs.sh files are exactly same. That's interesting I don't need the second machine to "source $HOME/OpenFOAM..." Okay, great!
Quote:

After these steps work, then you can easily start to test doing the gradual changes necessary for the goals you're trying to reach!

Best regards,
Bruno
Thanks for the suggestions. I'll try them all out. It might be a while before you hear from me, but I'll post how it turns out.

wyldckat January 6, 2013 15:26

Hi Chris,

A quick reply:
  • Feel free to update that wiki page! I did the tests on a virtual machine, therefore some things will work differently between virtual and real machines.
  • If one machine is 32bit and the other is 64bit, then you will have to use the common denominator and build the 32bit version on the 64bit machine. Otherwise, you'll be trying to do hybrid computing, which AFAIK isn't currently supported in OpenFOAM.
  • The reason for not needing the "source ..." command on the second machine is because foamJob uses foamExec to jump-start the OpenFOAM environment on the remote machines. You can see it on the first lines after foamJob is called:
    Code:

    Executing: /usr/bin/mpirun ...
  • It's a lot of information collected on those notes about "parallel", so it's very easy to get lost in the lengthy amounts of information referenced there. And I haven't had the time to sort them into a few neat pages on the wiki :rolleyes:
Best regards,
Bruno

fisichel January 6, 2013 15:59

Hi Bruno,

A quick response!

Quote:

Originally Posted by wyldckat (Post 400365)
Hi Chris,

A quick reply:
  • Feel free to update that wiki page! I did the tests on a virtual machine, therefore some things will work differently between virtual and real machines.

I didn't know I could do that...Once I get it working, I'll update it.

Quote:


  • If one machine is 32bit and the other is 64bit, then you will have to use the common denominator and build the 32bit version on the 64bit machine. Otherwise, you'll be trying to do hybrid computing, which AFAIK isn't currently supported in OpenFOAM.

Ohhh....I didn't know that. I'll stick with the 64 bit machines. No problem.


Quote:


  • The reason for not needing the "source ..." command on the second machine is because foamJob uses foamExec to jump-start the OpenFOAM environment on the remote machines. You can see it on the first lines after foamJob is called:
    Code:

    Executing: /usr/bin/mpirun ...
  • It's a lot of information collected on those notes about "parallel", so it's very easy to get lost in the lengthy amounts of information referenced there. And I haven't had the time to sort them into a few neat pages on the wiki :rolleyes:
Best regards,
Bruno
I did see that foamExec, but didn't think much of it. Interesting. Well, I'll give it a shot. I'm getting a game plan together as I write to try your ideas.

Thanks,
Chris

fisichel January 13, 2013 20:42

Hi Bruno,

I tried your ideas. Your notes are very useful. There were a couple of links that were talking about dealing with non-interactive shells, and that was one my problems. For a default Debian installation, I had to go into my .bashrc and comment out the line that exits if it detects a non-interactive shell.

Also, I uninstalled the SYSTEMOPENMPI software, and brought in OpenMPI 1.6.3. That is their latest release and they are claiming application binary interface compatibility with 1.5.3. I went into the OpenFOAM file OpenFOAM-2.1.1/etc/config/settings.sh and changed 1.5.3 to 1.6.3 to make sure I included all of OpenFOAM's requirements for the builds, notably GridEngine. (i.e. I used ./Allwmake) I am hoping GridEngine is supported in 1.6.3 as I noticed it is not working in OpenMPI 1.5.3.

I setup a hosts file for the two machines:
192.168.1.25 debian5
192.168.1.26 debian6

I did not try a heterogeneous calculation, so I did everything on two nearly identical 64 bit machines.

Finally, I copied the folder structure you outline in "Running OpenFOAM in parallel with different locations for each process"

...and it works.

Your debian wiki was instrumental in getting this to work. I propose the following changes:
1. Update the .bashrc file to properly handle non-interactive logins, unless you have a more clever solution.
2. Build openMPI 1.6.3 since the default Debian installation does not have GridEngine support
3. setup a hosts file

If you comfortable with these updates, I will be happy to make them.

Best Regards,
Chris

wyldckat January 14, 2013 03:59

Hi Chris,

Good to learn that you've managed to get things working!

As for changing the wiki page, points 1 and 2 are OK for that Debian page and feel free to go ahead and do the modifications!

Point 3 should be part of a page that is yet to be created, about running OpenFOAM in parallel. If you're willing to kick-start such a page, you can create a tips-n-tricks page: http://openfoamwiki.net/index.php/Main_TipsAndTricks - later on it can be moved to a more global section, when more contributions start coming in!

Best regards,
Bruno

aerothermal January 15, 2013 06:58

The correction in Line 75 of the file

OpenFOAM/ThirdParty-2.1.x/ParaView-3.12.0/Qt/Core/pqServerManagerSelectionModel.h

worked for me!

Thanks Martin_!


All times are GMT -4. The time now is 21:16.