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

Link with static libraries only

LP
Lucas Pettey, modified 7 Years ago.

Link with static libraries only

Youngling Posts: 2 Join Date: 10/28/13 Recent Posts
Hello,

I ma trying to compile the code with GNU compilers on a Cray XE6. I have generated a Makefile with the following config command:

CC=cc CXX=CC CFLAGS="-fPIC -static -L/lustre/home1/u/lpettey/delft3d/expat-2.1.0/lib -O3" CXXFLAGS="-fPIC -static -L/lustre/home1/u/lpettey/delft3d/expat-2.1.0/lib -O3" FC=ftn F77=ftn FCFLAGS="-fPIC -static -L/lustre/home1/u/lpettey/delft3d/expat-2.1.0/lib -O3" MPIFC=ftn ./configure LDFLAGS="-static -L/lustre/home1/u/lpettey/delft3d/expat-2.1.0/lib" --enable-shared=no --with-pic --enable-static

I still get errors with dynamic libraries:

libtool: link: cc -std=gnu99 -D_GNU_SOURCE -DSTR_LEN_AT_END -DWITH_DELFTONLINE -fPIC -O3 -o esm_create esm_create.o -L/lustre/home1/u/lpettey/delft3d/expat-2.1.0/lib ../../../../utils_lgpl/esmfsm/packages/esmfsm/src/fsm/.libs/libESMFSM.a -lrt /lustre/home1/u/lpettey/delft3d/expat-2.1.0/lib/libexpat.a /opt/gcc/4.8.0/snos/lib/../lib64/libstdc++.so -lm -Wl,-rpath -Wl,/opt/gcc/4.8.0/snos/lib/../lib64 -Wl,-rpath -Wl,/opt/gcc/4.8.0/snos/lib/../lib64
/usr/bin/ld: attempted static link of dynamic object `/opt/gcc/4.8.0/snos/lib/../lib64/libstdc++.so'
collect2: error: ld returned 1 exit status

Replacing /opt/gcc/4.8.0/snos/lib/../lib64/libstdc++.so with /opt/gcc/4.8.0/snos/lib/../lib64/libstdc++.a links successfully, but it is annoying to have to do that every time it fails. I can't seem to find the right option or Makefile line to change this.

Any help is appreciated.

Thanks
Adri Mourits, modified 7 Years ago.

RE: Link with static libraries only

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

The following "dirty" solution should work on your platform: in file ".../src/configure.ac", replace line 204:
AC_CHECK_LIB([stdc++], [main],, [AC_MSG_ERROR([Compiler can't find libstdc++])])
with:
LIBS="/opt/gcc/4.8.0/snos/lib64/libstdc++.a $LIBS"

Regards,

Adri
LP
Lucas Pettey, modified 7 Years ago.

RE: Link with static libraries only

Youngling Posts: 2 Join Date: 10/28/13 Recent Posts
Hi Adri,

That didn't work. It now has the stdc++ library linking twice:

libtool: link: cc -std=gnu99 -D_GNU_SOURCE -DSTR_LEN_AT_END -DWITH_DELFTONLINE -fPIC -O3 -o esm_create esm_create.o ../../../../utils_lgpl/esmfsm/packages/esmfsm/src/fsm/.libs/libESMFSM.a /opt/gcc/4.8.0/snos/lib/../lib64/libstdc++.so /opt/gcc/4.8.0/snos/lib/../lib64/libgomp.so /opt/gcc/4.8.0/snos/lib/../lib64/libgfortran.so /opt/gcc/4.8.0/snos/lib/../lib64/libquadmath.so -lm -lrt -lexpat /opt/gcc/4.8.0/snos/lib64/libstdc++.a -Wl,-rpath -Wl,/opt/gcc/4.8.0/snos/lib/../lib64 -Wl,-rpath -Wl,/opt/gcc/4.8.0/snos/lib/../lib64
/usr/bin/ld: attempted static link of dynamic object `/opt/gcc/4.8.0/snos/lib/../lib64/libstdc++.so'

It will also have problems with the other *.so libraries if it ever resolves the stdc++ issue.

Thanks
Lucas
Adri Mourits, modified 7 Years ago.

RE: Link with static libraries only

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

I'm surprised that libstdc++.so is still added to the link step. It's probably because a C main routine is being linked.

I'm sorry, I can't help you with this. You need an Automake-expert.

By the way, the LIBS-line in my previous post is not correct. The "-l" at the front is missing. Correct one:
LIBS="-l/opt/gcc/4.8.0/snos/lib64/libstdc++.a $LIBS"

But this won't solve your problem.

Regards,

Adri
SA
Steven Ayres, modified 6 Years ago.

RE: Link with static libraries only

Padawan Posts: 33 Join Date: 4/21/11 Recent Posts
Hi Adri,

We are able to now build the code (Trunk 3049) using Cluster Compatibility Mode on the Cray, which is a more friendly environment for code using dynamic libraries. I can get example 1 to run successfully in serial, however, it is not working when I try to use more than 1 processor, attached is a screenshot of the session. It is giving a fortran runtime error: File 'td-diag.f34' already exists, at line 389 of file iniid.f90. It seems to crash before the MPI subroutines are accessed. We are having trouble tracing the error through the subroutines. Subroutine iniid is called by sysini, which is called by subroutine tdatom or tripoi, which is called by function trisim_init, but these routines do not have any reference to MPI. I tried erasing the td-diag.f34 file before running the simulation but that did not help, it seems to crash when the second processor tries to create the file and it already exists.

I was wondering if you could point us in the right direction or might have a suggestion to resolve this issue.

Thanks,
Steve
Adri Mourits, modified 6 Years ago.

RE: Link with static libraries only (Answer)

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

It seems that more than one partition thinks that they both are the master.

File "td-diag.<runid>" is created inside subroutine tdatmain. File ".../src/engines_gpl/flow2d3d/packages/manager/src/trisim_mod.F90", line 243-245:
    if (.not.parll .or. inode == master) then
       call tdatmain(runid, alone, filmrs, icheck, gdp)
    endif

So only one partition should execute tdatmain.

When executing (on Linux):
mpirun -np $NHOSTS $exedir/d_hydro.exe $argfile

MPI will take care of starting $NHOSTS executables, one for each partition, and will guide each partition with a unique identification number "inode". It seems that this mechanism went wrong on your machine.

You can check this by adding the following line, for example inside trisim_mod.F90, close above the call to tdatmain:
write(*,*) "inode:", inode

I expect that at least two partitions will echo "inode: 1", while each partition should echo a different number.

Hope this helps.

Regards,

Adri
SA
Steven Ayres, modified 6 Years ago.

RE: Link with static libraries only

Padawan Posts: 33 Join Date: 4/21/11 Recent Posts
Hi Adri,

It looks like that is the problem after all. All cores think they are the master and the inode value is not updating properly. Can you point us to the routine where inode is being defined?

Thanks,
Steve
SA
Steven Ayres, modified 6 Years ago.

RE: Link with static libraries only

Padawan Posts: 33 Join Date: 4/21/11 Recent Posts
Parallel is now working, it turns out the PMI_RANK variable was not being initialized on the Cray, so an "export PMI_RANK=1" command in the run batch script did the trick.