hydroshare / hydroshare-jupyterhub

The HydroShare Jupyterhub Notebook Server is an environment designed provide added value to existing HydroShare resources via interactive computational notebooks.
4 stars 6 forks source link

OGR library problem with TauDEM #113

Open dtarb opened 6 years ago

dtarb commented 6 years ago

The resource https://www.hydroshare.org/resource/f186b3fd55fd49e6bb761473e2a49b7f/ contains a JH notebook that illustrates the use of TauDEM in JH. In running through this today I encountered a problem at cell 13 that executed the streamnet function !mpiexec -n 4 streamnet -fel loganfel.tif -p loganp.tif -ad8 loganad8o.tif -src logansrc.tif -ord loganord3.tif -tree logantree.dat -coord logancoord.dat -net logannet.shp -w loganw.tif -o Outlet.shp

Errors received were logannet warning: Layer creation failed. ERROR 10: Name was NULL in OGR_DS_CreateLayer ERROR 10: Pointer 'hLayer' is NULL in 'OGR_L_CreateField'. ERROR 10: Pointer 'hLayer' is NULL in 'OGR_L_CreateField'. ...

The stream network shapefile logannet.shp was not created.

This process did work earlier (September 2017) when JH was deployed at ROGER, but it is failing with the current deployment at RENCI. Thus I suspect the problem is a TauDEM/OGR library installation problem. I am not sufficiently familiar with the TauDEM linux installation process to provide specific help, but suggest that @yanliu-chn may be able to help. Also some community members have recently updated Cmake files for TauDEM at https://github.com/dtarb/TauDEM so looking at the latest Cmake in the develop branch may also help.

yanliu-chn commented 6 years ago

I believe this is due to a bug in TauDEM 5.3.7 on function getLayername(), which is called in createStreamNetShapefile() to set up shp file layer name. The bug was fixed in the development branch of TauDEM, but I bet the TauDEM installed with the JH is 5.3.7.

The bug didn't affect earlier JH install on ROGER because we probably used a gcc version that lines up memory right for the local array "returned" by getLayername(), but the new installation used a newer gcc that is more conformant to C standard.

Please release a new TauDEM as an ultimate solution. Of course, you will need to accept a lot of pull requests there posted by others and us. :)

As a fix, you can change the command line of streamnet by adding one parameter -netlyr to denote the layer name explicitly. This is a workaround solution that has been tested to work.

dtarb commented 6 years ago

@yanliu-chn thanks. Can we work on this together a bit to try get a new release out over next week or so. There are only two PR's outstanding on https://github.com/dtarb/TauDEM. I think the Catch Hydro Geo One from you could be tested and merged. I will see if I can do this on a PC. We also need to add test data for this to https://github.com/dtarb/TauDEM-Test-Data. If you are able to test this all on linux I think we can get a new release (5.3.9) out. The other outstanding PR (related to MS MPI from 2015) may no longer be relevant, but if you are able to assess and inform me on this I would appreciate it.

@Castronova it would be good to add to the protocol of installing TauDEM on JH, running the TauDEM test suite at https://github.com/dtarb/TauDEM-Test-Data. That may have caught the problem. As an immediate fix it may be possible to install TauDEM 5.3.8 which is set as pre-release at https://github.com/dtarb/TauDEM/releases. If you have a development JH machine where you could test this using the testsuite data in the JH configuration that would determine whether version 5.3.8 resolves the problem and take a bit of pressure off on getting out 5.3.9.

yanliu-chn commented 6 years ago

@dtarb I will test the suite on Linux and let you know when I am done. Let's shoot for 5.3.9 first. Then we can discuss other pull requests (e.g., the two flowdir algorithms coded by Kornelijus and used in NFIE CFIM computation) and systematic portability tests on a variety of platforms and compilers.