[gdal-dev] HDF5 Multi-threading Errors

andrewparadis orangewombat at gmail.com
Wed Feb 27 07:35:22 PST 2019


Oops, apparently my "raw" blocks of code and output samples did not carry
over...

The test application mentioned is this:

private static void Main(string[] args)
{
    GdalConfiguration.ConfigureGdal();
    
    const string eTopoSource = @"F:\msa\testing\etopo\etopo1_ice_g_f4.flt";
    const string dbDbvSource = @"F:\msa\testing\dbdbv\dbdbv6_level0c.h5";

    Parallel.For(0, 4, i =>
    {
	Debug.WriteLine($"Opening Etopo... thread {i}");
	var etopoRaster = Gdal.Open(eTopoSource, Access.GA_ReadOnly);
	Debug.WriteLine($"-- Finished opening Etopo... thread {i}... " +
			$"size {etopoRaster.RasterXSize} x {etopoRaster.RasterYSize}");
    });

    Parallel.For(0, 4, i =>
    {
	Debug.WriteLine($"Opening Dbdb-V... thread {i}");
	var dbdbvRaster = Gdal.Open(dbDbvSource, Access.GA_ReadOnly);
	Debug.WriteLine($"-- Finished opening Dbdb-V... thread {i}... " +
			$"size {dbdbvRaster.RasterXSize} x {dbdbvRaster.RasterYSize}");
    });
}

The first batch of output (showing working ETOPO1, failing DBDB-V) is this:

Opening Etopo... thread 0
Opening Etopo... thread 1
Opening Etopo... thread 2
Opening Etopo... thread 3
-- Finished opening Etopo... thread 0... size 21601 x 10801
-- Finished opening Etopo... thread 1... size 21601 x 10801
-- Finished opening Etopo... thread 2... size 21601 x 10801
-- Finished opening Etopo... thread 3... size 21601 x 10801
Opening Dbdb-V... thread 0
Opening Dbdb-V... thread 3
Opening Dbdb-V... thread 1
Exception thrown: 'System.AccessViolationException' in gdal_csharp.dll
Opening Dbdb-V... thread 2
Exception thrown: 'System.AccessViolationException' in gdal_csharp.dll
Exception thrown: 'System.AccessViolationException' in gdal_csharp.dll
Exception thrown: 'System.AccessViolationException' in gdal_csharp.dll

The originating exception (from HDF5 lib) is this:

HDF5-DIAG: Error detected in HDF5 (1.8.14) thread 0:
  #000: E:\builds\hdf5-1.8.14\src\H5Gtraverse.c line 780 in
H5G_traverse_real():         
    major: File accessibilty
    minor: Unable to open file
  #4294967295: HµHµ line 2799 in (): m
    major: Symbol table
    minor: Object not found
ERROR 4: `F:\msa\testing\dbdbv\dbdbv6_level0c.h5' not recognized as a
supported file format.

Finally, the "successful" output (after making the DBDB-V calls sequentially
rather than in parallel) is this:

Opening Dbdb-V... thread 0
-- Finished opening Dbdb-V... thread 0... size 512 x 512
Opening Dbdb-V... thread 1
-- Finished opening Dbdb-V... thread 1... size 512 x 512
Opening Dbdb-V... thread 2
-- Finished opening Dbdb-V... thread 2... size 512 x 512
Opening Dbdb-V... thread 3
-- Finished opening Dbdb-V... thread 3... size 512 x 512

Sorry about that.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list