Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.

Re: [netcdf-java] JNA Based NetCDF Access

Wow, this is great, thanks Tisham!

On the web site http://forum.worldwindcentral.com/showpost.php?p=97182&postcount=6 <http://forum.worldwindcentral.com/showpost.php?p=97182&postcount=6>, I dont see the comparisons to the pure Java.
Also, you have to be careful with OS and disk cache effects. Running the 
comparisions and switching the order can tell you if thats happening. If 
so, the timings will be order dependent.
Regards,

John

On 9/12/2011 6:07 PM, Tisham.Dhar@xxxxxxxx wrote:
Hi All,

I have successfully activated the JNA based C-library bridge by including
package: ucar.nc2.jni.netcdf , particularly these files: JniIosp.java,
NCLibrary.java . Thanks for the head start John. I have also tested on
Linux and Mac since the current code only loads DLL's by adding load calls
for .so and .dylibs as below.

             String osName = System.getProperty("os.name");
             boolean isWin = osName != null
                     &&  osName.toLowerCase().contains("win");
             boolean isMacOS = osName != null
                     &&  osName.toLowerCase().contains("mac");
             boolean isLinux = osName != null
                     &&  osName.toLowerCase().contains("linux");
             if(isWin)
             {
                 String dir = "C:/dev/tds/thredds/lib/binary/win32/";
                 System.setProperty("jna.library.path", dir);

                 System.load(dir + "zlib1.dll");
                 System.load(dir + "szlibdll.dll");
                 System.load(dir + "hdf5dll.dll");
                 System.load(dir + "hdf5_hldll.dll");
             }
             else if(isMacOS)
             {
                 String dir = "/opt/local/lib/";
                 System.setProperty("jna.library.path", dir);
                 System.load(dir + "libz.dylib");
                 System.load(dir + "libsz.dylib");
                 System.load(dir + "libhdf5.dylib");
                 System.load(dir + "libhdf5_hl.dylib");
             }
             else if(isLinux)
             {
                 String dir = "/usr/lib/";
                 System.setProperty("jna.library.path", dir);
                 System.load(dir + "x86_64-linux-gnu/libz.so");
             }

The timing benchmarks indicate that the access is faster across the board
than pure Java for sub 1GB files, you can read details of the benchmark
here: http://forum.worldwindcentral.com/showpost.php?p=97182&postcount=6 .
I am hoping that the JNA bindings to the C-library will move from
experimental to testing to production soon.

Cheers,

Tisham.


_______________________________________________
netcdf-java mailing list
netcdf-java@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit: 
http://www.unidata.ucar.edu/mailing_lists/


  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: