Message Boards

RE: Compiling Delft3D with OpenMPI

Kai Rasmus, modified 9 Years ago.

Compiling Delft3D with OpenMPI

Youngling Post: 1 Join Date: 2/20/13 Recent Posts
I am using a 12 core Xeon machine with a 64bit Ubuntu 12.04.1 LTS. To compile Delft3D for this system I installed Mpich2 on it but for some reason (which is related to ubuntu and debian linux) the compilation of Delft3D failed. Therefore I decided to try compiling it with OpenMPI. Programs compiled with openmpi have worked in parallel before on this machine. However, the installatation of Mpich2 seemed to break something in the operating system resulting in a non-working mixture of openmpi and mpich2 headers and libraries. Even uninstalling both mpich2 and openmpi and then reinstalling openmpi did not resolve these conflicts. I ended up compiling openmpi from source to a non-default location and pointing all the paths in the scripts to that location. Even this did not resolve all of the conflicts.

To try to fix this I set up a virtual machine with a clean install of ubuntu (14.04 LTS) on my desktop Windows 7 Core i7 computer. This used a desktop version of the operating system so the following packages had to be installed: subversion, openmpi-bin, libopenmpi-dev, automake, gcc, g++, gfortran, flex, byacc, libexpatl-dev. By using apt-get to install these packages, all their dependencies are resolved automatically and the dependencies are installed as well.

Then I downloaded the latest tagged release of Delft3D (revision 3574 in this case) using subversion. A few changes were required to the build.sh script: Everything was installed in their default locations.

This part needed to be changed:

1
case $compiler in
2
    gnu)
3
        ifortInit=""
4
        iccInit=""
5
        addpath PATH /usr/bin
6
        addpath LD_LIBRARY_PATH /usr/lib /usr/lib64
7
        echo "Using GNU compilers in `witch gfortran`"

;;

and this part:

1
if [ "$compiler" = 'gnu' ]; then
2
    addpath PATH /opt/mpich2-1.4.1-gcc-4.6.2/bin
3
    export MPI_INCLUDE=/usr/lib/openmpi/include
4
    export MPILIBS_ADDITIONAL="-L/usr/lb/openmpi/lib -lmpi_f90 -lmpi_f77 -lmpi_-lmpi_cxx”
5
    # export MPILIBS_ADDITIONAL=" "
6
    export MPIFC=/usr/bin/mpif90
7
        export MPICC=/usr/bin/mpic++


This worked even though the path pointing to mpich2 was left in. It was necessary to remove the reference to the mpl-library (-lmpl) which is not used by openmpi. After this, Delft3D compiled normally with ./build.sh -gnu -64bit.

I then copied the delft3d directory from my virtual machine to my server. I needed to edit the run_flow2d3d_parallel.sh script to reflect my environment and needed to make two symbolic links to libraries that had new names in the openmpi install on my virtual machine. Fortunately the old libraries on my server still worked with the new delft3d binary compiled on the virtual machine. The two libraries in question are libmpi_f77.so.1 and libmpi_cxx.so.1 which existed as libmpi_f77.so and libmpi_cxx.so on my server. After this, delft3d ran perfectly in parallel on my server.

Some conclusions:
1. It is easy to compile delft3d with openmpi and it requires only a few changes to the build.sh script,
2. It is easy to mix up mpich2 and openmpi headers and libraries resulting in a mixture that does not work properly.
Kaylin Griham, modified 1 Year ago.

RE: Compiling Delft3D with OpenMPI

Youngling Posts: 2 Join Date: 3/21/22 Recent Posts
You may use the shell files in the examples as a template. Copy and modify it to run your own cases.geometry dash