intro story D-Flow FM

 

D-Flow Flexible Mesh

D-Flow Flexible Mesh (D-Flow FM) is the new software engine for hydrodynamical simulations on unstructured grids in 1D-2D-3D. Together with the familiar curvilinear meshes from Delft3D 4, the unstructured grid can consist of triangles, pentagons (etc.) and 1D channel networks, all in one single mesh. It combines proven technology from the hydrodynamic engines of Delft3D 4 and SOBEK 2 and adds flexible administration, resulting in:

  • Easier 1D-2D-3D model coupling, intuitive setup of boundary conditions and meteorological forcings (amongst others).
  • More flexible 2D gridding in delta regions, river junctions, harbours, intertidal flats and more.
  • High performance by smart use of multicore architectures, and grid computing clusters.
An overview of the current developments can be found here.
 
The D-Flow FM - team would be delighted if you would participate in discussions on the generation of meshes, the specification of boundary conditions, the running of computations, and all kinds of other relevant topics. Feel free to share your smart questions and/or brilliant solutions! 

 

=======================================================
We have launched a new website (still under construction so expect continuous improvements) and a new forum dedicated to Delft3D Flexible Mesh.

Please follow this link to the new forum: 
/web/delft3dfm/forum

Post your questions, issues, suggestions, difficulties related to our Delft3D Flexible Mesh Suite on the new forum.

=======================================================

** PLEASE TAG YOUR POST! **

 

 

Sub groups
D-Flow Flexible Mesh
DELWAQ
Cohesive sediments & muddy systems

 


Message Boards

Error Compiling on 64bit Fedora 17

LL
Luca Liberti, modified 8 Years ago.

Error Compiling on 64bit Fedora 17

Youngling Posts: 9 Join Date: 1/12/12 Recent Posts
Hi,
I am trying to compile Delft3D on a Fedora 17 64bit machine (kernel 3.5.4-2.fc17.x86_64 ) using the latest gcc compiler ( 4.7.2 ) and mpich2.
I get no errors from autogen.sh but I am getting the following error message while running make command:

dfinitmpi.F90:46.8:

use mpi
1
Fatal Error: Can't open module file 'mpi.mod' for reading at (1): No such file or directory

By looking at post reporting a similar a problem on Scientific Linux
http://oss.deltares.nl/web/opendelft3d/general/-/message_boards/view_message/191079#_19_message_191079,
I realized that the locations of mpi.mod and of the mpi bianries and libraries were different from the ones found in build.sh (at line 230)
I manually modified the locations to point to the right ones as reported below but I am still getting the same error

#===============================================================================
# Additional library settings

#---------------------
# mpich2
if [ "$compiler" = 'gnu' ]; then
addpath PATH /usr/lib64/mpich2/bin
export MPI_INCLUDE=/usr/include/mpich2-x86_64
export MPILIBS_ADDITIONAL="-L/usr/lib64/mpich2/lib -lfmpich -lmpich -lmpl"
# export MPILIBS_ADDITIONAL=" "
export MPIFC=/usr/lib64/mpich2/bin/mpif90
# addpath PATH /opt/mpich2-1.4.1-gcc-4.6.2/bin
# export MPI_INCLUDE=/opt/mpich2-1.4.1-gcc-4.6.2/include
# export MPILIBS_ADDITIONAL="-L/opt/mpich2-1.4.1-gcc-4.6.2/lib -lfmpich -lmpich -lmpl"
# export MPILIBS_ADDITIONAL=" "
# export MPIFC=/opt/mpich2-1.4.1-gcc-4.6.2/bin/mpif90


Any advice on what might have gone wrong?

Kind regards
Adri Mourits, modified 8 Years ago.

RE: Error Compiling on 64bit Fedora 17

Yoda Posts: 1221 Join Date: 1/3/11 Recent Posts
Hi Luca,

There are two ways to compile on Linux (see src/README): with build.sh (option emoticon and without build.sh (option A). If you have installed all needed tools in the default locations, option A (without build.sh) should work. Can you give that a try?

If it doesn't work, can you add "src/logs/make.log" to your post?

Regards,

Adri
LL
Luca Liberti, modified 8 Years ago.

Tried option A and B unsuccessfully

Youngling Posts: 9 Join Date: 1/12/12 Recent Posts
Hi Adri,

thank you for your answer. Shame on me for not reading readme files. From what I understand now
./build.sh runs the three steps autogen, configure and make in sequence.
Obviously by only modifying build.sh and running the three steps manually nothing different could happen.

I tried option A and B as found in the README

Option A):
./autogen.sh
./configure --prefix=`pwd`
make ds-install

./autogen -> Automatically preparing build ... done
./configure --prefix=`pwd` returns error message expected an absolute directory name for --prefix: pwd

so I tried option B with the manually modified build.sh mentioned in my initial post however I got an error again
during the excution of make, find log attached.

Also looking at the readme file I noticed two lines at the bottom of the "Compiling on Linux" section

4) 64 bit version:
This is a beta version
Be careful with compilers having a different revision or build number; this will lead to different paths
Be careful with tools located in different directories (e.q. /opt/mpich2)
Check both "common.am" and "build.sh"
Check http://oss.deltares.nl/web/opendelft3d/general/-/message_boards/view_message/46284
Check http://oss.deltares.nl/web/opendelft3d/faq-compiling-code#How do I create a 64-bit executable?

I am not sure how to handle the information in the first of the two links

The last link suggests to modify Makefile.am in
/src/engines_gpl/flow2d3d/packages/flow2d3d/src
and remove line
-L$(top_srcdir)/third_party_open/DelftOnline/lib -lDelftOnline -lDelftOnlineJNI -lJavaLaunch \
which I did not find in Makefile.am


Kind regards

Luca

Attachments:

Adri Mourits, modified 8 Years ago.

RE: Tried option A and B unsuccessfully

Yoda Posts: 1221 Join Date: 1/3/11 Recent Posts
Hi Luca,

About your compilation problem:
Looking at the make.log, not all code is rebuild. It seems that during linking, some libraries are used, build during a previous build attempt, while they should be rebuild.
What happens if you first execute ./clean.sh" (or start all over in an empty directory)?

I'm sorry for the confusing information about 64-bit. I updated both the README file (revision 1911) and the FAQ on the site:
On Linux, 64-bit is not beta functionality anymore
Don't bother about the DelftOnline library lines. They are indeed removed.

Thank you for this feedback.

Regards,

Adri
LL
Luca Liberti, modified 8 Years ago.

Partial success on Option B

Youngling Posts: 9 Join Date: 1/12/12 Recent Posts
Hi Adri,

sorry for the late answer but I was out of the office. I tried doing ./clean.sh (btw I had to chmod clean.sh to give execution permission) and then
./build.sh -gnu -64bit
Using GNU compilers in /usr/bin
Current settings:
export ACLOCAL=""
export AUTOMAKE=""
export AUTOHEADER=""
export AUTOCONF=""
export AUTORECONF_FLAGS=""
export FCLIBS_ADDITIONAL=" "
export LIBTOOLIZE=""
export LDFLAGS=""
export LDFLAGSMT_ADDITIONAL=" "
export LD_LIBRARY_PATH=""
export MPIFC="/usr/lib64/mpich2/bin/mpif90"
export MPI_INCLUDE="/usr/include/mpich2-x86_64"
export MPILIBS_ADDITIONAL="-L/usr/lib64/mpich2/lib -lfmpich -lmpich -lmpl"
export PKG_CONFIG_PATH=""
export PATH="/usr/lib64/mpich2/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/luca/.local/bin:/home/luca/bin"

20121031.151042 :: Running ./autogen.sh --verbose &> logs/autogen.log
20121031.151119 :: Running CFLAGS='-O2 -fPIC -m64 ' CXXFLAGS='-O2 -fPIC -m64 ' FFLAGS='-O2 -fPIC -m64 ' FCFLAGS='-O2 -fPIC -m64 ' ./configure --prefix=/home/luca/Work/D3D/last/src &> logs/configure.log
20121031.151206 :: Running make ds-install &> logs/make.log
20121031.152617 :: Build finished

which apparently worked. When I tried to run run_flow2d3d.sh found in examples/01_standard directory nothing happened. I tried following the advice found in post
http://oss.deltares.nl/web/opendelft3d/general/-/message_boards/view_message/200601.
Downloaded run_flow2d3d_xml.sh and config_flow2d3d.xml from trunk (rev 1928) but got this error message:
./run_flow2d3d_xml.sh
d_hydro ABORT: Cannot load component library "libflow2d3d.so": libfmpich.so.3: cannot open shared object file: No such file or directory

I noticed that ../../bin/lnx/flow2d3d/lib directory is empty while ../../bin/lnx/flow2d3d/bin contains the following files
datsel esm_info lint
deltares_hydro.exe kubint mormerge.exe
d_hydro.exe libDelftOnline.so plugin_culvert.so
esm_create libflow2d3d_openda.so plugin_delftflow_traform.so
esm_delete libflow2d3d.so

I think I am getting there even if something is still missing.

I attached the various log files for reference

PS is there a way to make my previous post public, somehow I must have set it to private.

Best regards

Luca
Adri Mourits, modified 8 Years ago.

RE: Partial success on Option B

Yoda Posts: 1221 Join Date: 1/3/11 Recent Posts
Hi Luca,

During installation, a script is executed that detects what shared objects (dlls) are needed and copies them to the ../../bin/lnx/flow2d3d/lib directory. This script is written in the language called "Ruby". The interpreter for this script language is installed by default on most Linux platforms. But apparently not on your system: your "make.log", line 7285 and following reports:
/usr/bin/ruby: bad interpreter: No such file or directory.

Installing Ruby will solve this problem.

I made your previous post public. There was indeed a checkbox not marked under permissions (I'm not sure whether this link is active for all users...).

Regards,

Adri
LL
Luca Liberti, modified 8 Years ago.

RE: Partial success on Option B

Youngling Posts: 9 Join Date: 1/12/12 Recent Posts
Hi Adrian,
thank you for your help. I installed ruby as you suggested, then ran ./clean.sh and
./build.sh -gnu -64bit
Using GNU compilers in /usr/bin
Current settings:
export ACLOCAL=""
export AUTOMAKE=""
export AUTOHEADER=""
export AUTOCONF=""
export AUTORECONF_FLAGS=""
export FCLIBS_ADDITIONAL=" "
export LIBTOOLIZE=""
export LDFLAGS=""
export LDFLAGSMT_ADDITIONAL=" "
export LD_LIBRARY_PATH=""
export MPIFC="/usr/lib64/mpich2/bin/mpif90"
export MPI_INCLUDE="/usr/include/mpich2-x86_64"
export MPILIBS_ADDITIONAL="-L/usr/lib64/mpich2/lib -lfmpich -lmpich -lmpl"
export PKG_CONFIG_PATH=""
export PATH="/usr/lib64/mpich2/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin: /usr/sbin:/home/luca/.local/bin:/home/luca/bin"

20121105.143937 :: Running ./autogen.sh --verbose &> logs/autogen.log
20121105.144014 :: Running CFLAGS='-O2 -fPIC -m64 ' CXXFLAGS='-O2 -fPIC -m64 ' F FLAGS='-O2 -fPIC -m64 ' FCFLAGS='-O2 -fPIC -m64 ' ./configure --prefix=/home/luc a/Work/D3D/last/src &> logs/configure.log
20121105.144101 :: Running make ds-install &> logs/make.log
20121105.145519 :: Build finished
still when I try to run the first example I get the error message
./run_flow2d3d_xml.sh
d_hydro ABORT: Cannot load component library "libflow2d3d.so": libfmpich.so.3: cannot open shared object file: No such file or directory
and again lib directory ../../bin/lnx/flow2d3d/lib is empty
although ../../src/lib seems to contain the symbolic link
../../src/lib/libflow2d3d.so -> libflow2d3d.so.0.0.0
pointing to a physical file.
I tried to change
pointing to this one by changing libdir=$D3D_HOME/flow2d3d/lib to libdir=../../src/lib in /run_flow2d3d_xml.sh but got the same error message.

I attach again the logs.

By the way is there something I should look for in the make.log as a telltale of something major going wrong besides the obvious "Error"

Best regards

Luca
Adri Mourits, modified 8 Years ago.

RE: Partial success on Option B

Yoda Posts: 1221 Join Date: 1/3/11 Recent Posts
Hi Luca,

You are a bit further: the Ruby script is executed but, according to your make.log file produces the error
loader cannot load itself
ldd: exited with unknown exit code (127)

I cannot reproduce this problem on my system. After some Googling: It may be caused by executing "ldd /lib64/ld-linux-x86-64.so.2" (or some analogue library) inside the Ruby script on your system.

Attached to this post is a version of "gatherlibraries.rb" that may avoid this problem. Can you put this in directory ".../src/scripts_lgpl/linux", replacing the original version and try again?

Please post your findings here.

Thanks.

Regards,

Adri
LL
Luca Liberti, modified 8 Years ago.

RE: Partial success on Option B

Youngling Posts: 9 Join Date: 1/12/12 Recent Posts
Hi Adri,

thank you for your valuable help. The installation process is slowly starting to make some sense now.
What I understand is that the binaries and libs are probably built correctly but something is going wrong in the installation
step which requires copying binaries and libs around the filesystem.

I downloaded the ruby script you provided and placed in the scripts_lgpl/linux/ dir
and went through ./clean.-sh and ./build.sh
near the end of make.log now I have the error message:

Target directory: ../bin
Source : all engines
installing all open source projects . . .
installing d_hydro . . .
Gathering libraries for d_hydro...
cp: missing destination file operand after `../bin/lnx/flow2d3d/lib'
Try `cp --help' for more information.
... Finished gathering libraries

and several similar afterwards

I understand the installation process requires the execution of /src/scripts_lgpl/linux/oss-install.sh
the error message above refers to the execution of cp command in function d_hydro

# =======================
# === INSTALL_D_HYDRO ===
# =======================
oss-install.sh
function d_hydro () {
echo "installing d_hydro . . ."

dest_bin="$dest_main/lnx/flow2d3d/bin"
dest_lib="$dest_main/lnx/flow2d3d/lib"

mkdir -p $dest_bin
mkdir -p $dest_lib

copyFile "bin/d_hydro.exe" $dest_bin
copyFile "third_party_open/tclkit/bin/intel/deltares_hydro.exe" $dest_bin

echo "Gathering libraries for d_hydro..."
cp -u `$gatherScript bin/d_hydro.exe | eval grep -v $gatherFilter` $dest_lib
echo "... Finished gathering libraries"
return
}

I tried to echo the values of $gatherScript and $gatherFilter to execute the command in the shell
$gatherScript correctly points to scripts_lgpl/linux/gatherlibraries.rb
for $gatherFilter I get '^/lib/' -e '^/lib64/' -e 'flow2d3d' -e 'DelftOnline'
If I try to execute the ruby script alone as scripts_lgpl/linux/gatherlibraries.rb bin/d_hydro.exe
I get
/lib64/libc.so.6
/lib64/libdl.so.2
/lib64/libexpat.so.1
/lib64/libgcc_s.so.1
/lib64/libm.so.6
/lib64/libpthread.so.0
/lib64/libstdc++.so.6

then if add the pipe to grep withj onlyt first opton -v I get
scripts_lgpl/linux/gatherlibraries.rb bin/d_hydro.exe | eval grep -v '^/lib/'
/lib64/libc.so.6
/lib64/libdl.so.2
/lib64/libexpat.so.1
/lib64/libgcc_s.so.1
/lib64/libm.so.6
/lib64/libpthread.so.0
/lib64/libstdc++.so.6

but if add the second option -e
scripts_lgpl/linux/gatherlibraries.rb bin/d_hydro.exe | eval grep -v '^/lib/' -e '^/lib64/'
I get the error message
grep: ^/lib/: No such file or directory

It seems my grep does not like multiple options although I have seen examples online with multiple -e option specified
Hope this info might help solving the problem

Thanks

Luca
Adri Mourits, modified 8 Years ago.

RE: Partial success on Option B

Yoda Posts: 1221 Join Date: 1/3/11 Recent Posts
Hi Luca,

Looking at the extensive information you gave (thank you!), I think these problems are consequentail damage. See information below. The real error happened during configuration and/or compilation. It seems that the mpich libraries are not used at all. Can you check your config output on mpich and also your latest make output when linking (or post them)?

About the cp error:
All so's shown by your ldd are in directory "/lib64". mpich libraries are missing. The "GatherFilter"-trick filters "system"-so's out. It removes all so's located in directory "/lib64". In your case, the list of files to be copied is empty. When calling the "cp"-command with an empty sourcelist, you will get an error message like "missing destination file operand".

About the grep -v '^/lib/' -e '^/lib64/' error:
There is a -e flag missing:
grep -v '-e ^/lib/' -e '^/lib64/'

Regards,

Adri
LL
Luca Liberti, modified 8 Years ago.

RE: Partial success on Option B

Youngling Posts: 9 Join Date: 1/12/12 Recent Posts
Hi Adri,

I attached the two logs. From what I can see I have the mpich libs in /usr/lib64/mpich2/ but I was not able to understand the messages regarding mpich in the logs.

Thanks again
Luca
Adri Mourits, modified 8 Years ago.

RE: Partial success on Option B

Yoda Posts: 1221 Join Date: 1/3/11 Recent Posts
Hi Luca,

Everything looks fine. It seems that the mpich libraries are used during linking.

The best way to proceed is as follows:
Copy the missing so files manually to the right directory. The error message was:
d_hydro ABORT: Cannot load component library "libflow2d3d.so": libfmpich.so.3: cannot open shared object file: No such file or directory

"libfmpich.so.3" is probably in directory "/usr/lib64/mpich2/lib". Copy it to directory "/home/luca/Work/D3D/last/bin/lnx/flow2d3d/lib".
Run example 01 again.
It is possible that the same message appears again, now with another missing library. Repeat the steps above.

I expect that you will manage to run example 01 in the end. But I'm very curious what happens when you try to run example 01 in parallel using script "run_flow2d3d_parallel.sh". If that does not work: did you compile (or have it compiled for you) mpich with the same (Gnu Fortran) compiler as you used to compile Delft3D?

Regards,

Adri
LL
Luca Liberti, modified 8 Years ago.

RE: Partial success on Option B

Youngling Posts: 9 Join Date: 1/12/12 Recent Posts
Hi Adri,

following your advice I manually copied the missing library files required to run the example in the ../bin/lnx/flow2d3d/lib directory.
I was then able to run example 1. However, as you predicted, when I tried a parallel run with run_flow2d3d_parallel.sh
I got an error messages regarding missing mpirun, mpd etc.. To be 100% sure about mpich installation I installed a fresh mpich-3.0rc1
on my home directory. The installation was successful and I was able to run the mpich installation tests.
I modified the build.sh to point to the new mpich installation and did the clean.sh and build.sh to rebuild everything with the new mpich libs
In this case however the make fails apparently on linking libmpich.a (as usual I attach the log files)

One additional comment, by looking at the run_flow2d3d_parallel.sh I noticed that the mpd daemon and mpdboot are invoked but
it appears from the mpich documentation that the mpd process manager is now deprecated and, at least in my case, it is not
installed by default by mpich.

It seems that with your help I am slowly reaching the goal. In the meantime I am learning a few things things about compiling on linux.

Best regards

Luca
Adri Mourits, modified 8 Years ago.

RE: Partial success on Option B

Yoda Posts: 1221 Join Date: 1/3/11 Recent Posts
Hi Luca,

Your mpich version is indeed rather new. I never tried with that version. We should migrate....

Looking at the error in make.log: Your mpich library must be recompiled with the flag -fPIC. Be sure to use the same compiler as used for Delft3D.

Regards,

Adri
LL
Luca Liberti, modified 8 Years ago.

RE: Partial success on Option B

Youngling Posts: 9 Join Date: 1/12/12 Recent Posts
Hi Adri,

I recompiled my version of mpich witht the option -fPIC you mentioned. Just for the records the command I needed to issue
to configure mpich compilation compilation was
./configure --prefix=/home/luca/mpich-install MPICHLIB_CFLAGS=-fPIC MPICHLIB_FFLAGS=-fPIC MPICHLIB_CXXFLAGS=-fPIC MPICHLIB_FCFLAGS=-fPIC 2>&1 | tee c.txt
after make and install I was able to correctly build D3D with no errors.

I went back to example 1 to see if I could run the code in parallel and found that mpd and mpdboot were were missing from mpich bin directory.
As I mentioned before mpd is now deprecated as process manager and the utilities are not even compiled by default instead the use of hydra is suggested.
I then recompiled mpich adding the option --with-pm=mpd which enabled the compilation of the mdp utilities.

I made a machinefile in the same directory of the example which is basically a single line (127.0.0.1:16) since I am running on a single node with 16 cpus
I finally tried to run the ./run_flow2d3d_parallel.sh (where I put d_hydro.exe as executable and argfile=config_flow2d3d.xml)
and I got the error message
"unable to find mpd.conf"
since I could not find any info on how to prepare the mdp.conf file I tried experimenting with the hydra process manager and I was able to run on up to 5 cores
by manually issuing the command
mpiexec.hydra -machinefile machinefile -n 5 ../../bin/lnx/flow2d3d/bin/d_hydro.exe config_flow2d3d.xml
after having issued all the export commands for the environment variables that were in the shell script.
Next week I will try to adapt the shell script to run with hydra. I'll share my experience on the forum.

Also I have an abnormal termination when I try to use 6 or more processors but I guess the computational domain of this example is very small.

Thank for you help

Regards,

Luca
Adri Mourits, modified 8 Years ago.

RE: Partial success on Option B

Yoda Posts: 1221 Join Date: 1/3/11 Recent Posts
Hi Luca,

About mpd.conf: I added the following comments in "...\examples\01_standard\run_flow2d3d_parallel.sh" (trunk revision 2028):
# In case the error "unable to find mpd.conf" occurs:
# Your home directory MUST contain file .mpd.conf with contents:
# secretword=bla
# and with file access permissions:
# -r--------
#

You are right: Example 01 is too small to run with 6 or more partitions. An error message is written in the tri-diag files.

Yes, please add your experiences to this forum.

Thanks,

Adri