Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

Hi,
I have met an obscure failure, and not find a good solution for two days. Could you help me? Thanks!
(Using: hdf5-1.10.0-patch1-linux-centos6-x86_64-gcc447-shared.tar.gz)
(Environment: redhat6.4-Intel-X64-g++4.4.7)

The error information:
HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:
  #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c line 491 in H5Fcreate(): unable to create file
    major: File accessibilty
    minor: Unable to open file
  #001: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5Fint.c line 1168 in H5F_open(): unable to lock the file or initialize file structure
    major: File accessibilty
    minor: Unable to open file
  #002: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FD.c line 1821 in H5FD_lock(): driver lock request failed
    major: Virtual File Layer
    minor: Can't update object
  #003: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FDsec2.c line 939 in H5FD_sec2_lock(): unable to flock file, errno = 38, error message = 'Function not implemented'
    major: File accessibilty
    minor: Bad file ID accessed
HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:
  #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c line 749 in H5Fclose(): not a file ID
    major: Invalid arguments to routine
    minor: Inappropriate type

compile no error: g++ -c packageHdf5.cpp -I ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp
link no error: g++ -o packageHdf5Run packageHdf5.o -I ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp
run error: ./packageHdf5Run (error information as above)

My code:

#include <stdio.h>
#include <iostream>
#include <string>

#include "H5Cpp.h"
#include <H5File.h>
#include "hdf5.h"

#ifndef H5_NO_NAMESPACE
using namespace H5;
#endif

using namespace std;

int main(int argc, char* argv[])
{
hid_t file_id = H5Fcreate("/home/tg2hpps/tg2hpps_main/src/packageHdf5/dsetddd.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
H5Fclose(file_id);
}

Thanks!

Hi,

It looks like flock() is not implemented on your filesystem, which is causing the create call to fail. flock() file locking is used by the HDF5 1.10.0 to help enforce single-writer/multiple-readers (SWMR) semantics, but is not necessary for correct operation of the library. A fix for this problem should be available in HDF5 1.10.1, but in the meantime you can apply a source patch found here:

https://www.hdfgroup.org/HDF5/release/obtainsrc5110.html#conf

under "Patch to Disable File Locking" at the bottom of the page.

Cheers,

Dana Robinson
Software Engineer
The HDF Group

···

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of ???
Sent: Tuesday, July 26, 2016 1:35 AM
To: hdf-forum@lists.hdfgroup.org
Subject: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

Hi,
I have met an obscure failure, and not find a good solution for two days. Could you help me? Thanks!
(Using: hdf5-1.10.0-patch1-linux-centos6-x86_64-gcc447-shared.tar.gz)
(Environment: redhat6.4-Intel-X64-g++4.4.7)

The error information:
HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:
  #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c line 491 in H5Fcreate(): unable to create file
    major: File accessibilty
    minor: Unable to open file
  #001: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5Fint.c line 1168 in H5F_open(): unable to lock the file or initialize file structure
    major: File accessibilty
    minor: Unable to open file
  #002: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FD.c line 1821 in H5FD_lock(): driver lock request failed
    major: Virtual File Layer
    minor: Can't update object
  #003: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FDsec2.c line 939 in H5FD_sec2_lock(): unable to flock file, errno = 38, error message = 'Function not implemented'
    major: File accessibilty
    minor: Bad file ID accessed
HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:
  #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c line 749 in H5Fclose(): not a file ID
    major: Invalid arguments to routine
    minor: Inappropriate type

compile no error: g++ -c packageHdf5.cpp -I ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp
link no error: g++ -o packageHdf5Run packageHdf5.o -I ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp
run error: ./packageHdf5Run (error information as above)

My code:

#include <stdio.h>
#include <iostream>
#include <string>

#include "H5Cpp.h"
#include <H5File.h>
#include "hdf5.h"

#ifndef H5_NO_NAMESPACE
using namespace H5;
#endif

using namespace std;

int main(int argc, char* argv[])
{
            hid_t file_id = H5Fcreate("/home/tg2hpps/tg2hpps_main/src/packageHdf5/dsetddd.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);

            H5Fclose(file_id);
}

Thanks!

Hi Dana,
Thanks for your response.

I've tried with your method to patch and compile hdf5-1.10.0-patch1 source code. Patch and compile have no error. Unfortunately when run my code the error still exist. And error information is the same as before.

What should I do? Please help me.

Thank you again for your effort!

Haijun Yu

···

At 2016-07-26 13:47:39, "Dana Robinson" <derobins@hdfgroup.org> wrote:

Hi,

It looks like flock() is not implemented on your filesystem, which is causing the create call to fail. flock() file locking is used by the HDF5 1.10.0 to help enforce single-writer/multiple-readers (SWMR) semantics, but is not necessary for correct operation of the library. A fix for this problem should be available in HDF5 1.10.1, but in the meantime you can apply a source patch found here:

https://www.hdfgroup.org/HDF5/release/obtainsrc5110.html#conf

under "Patch to Disable File Locking" at the bottom of the page.

Cheers,

Dana Robinson

Software Engineer

The HDF Group

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of ???
Sent: Tuesday, July 26, 2016 1:35 AM
To:hdf-forum@lists.hdfgroup.org
Subject: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

Hi,

I have met an obscure failure, and not find a good solution for two days. Could you help me? Thanks!

(Using: hdf5-1.10.0-patch1-linux-centos6-x86_64-gcc447-shared.tar.gz)

(Environment: redhat6.4-Intel-X64-g++4.4.7)

The error information:

HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:

  #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c line 491 in H5Fcreate(): unable to create file

    major: File accessibilty

    minor: Unable to open file

  #001: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5Fint.c line 1168 in H5F_open(): unable to lock the file or initialize file structure

    major: File accessibilty

    minor: Unable to open file

  #002: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FD.c line 1821 in H5FD_lock(): driver lock request failed

    major: Virtual File Layer

    minor: Can't update object

  #003: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FDsec2.c line 939 in H5FD_sec2_lock(): unable to flock file, errno = 38, error message = 'Function not implemented'

    major: File accessibilty

    minor: Bad file ID accessed

HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:

  #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c line 749 in H5Fclose(): not a file ID

    major: Invalid arguments to routine

    minor: Inappropriate type

compile no error: g++ -c packageHdf5.cpp -I ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp

link no error: g++ -o packageHdf5Run packageHdf5.o -I ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp

run error: ./packageHdf5Run (error information as above)

My code:

#include <stdio.h>

#include <iostream>

#include <string>

#include "H5Cpp.h"

#include <H5File.h>

#include "hdf5.h"

#ifndef H5_NO_NAMESPACE

using namespace H5;

#endif

using namespace std;

int main(int argc, char* argv[])

{

            hid_t file_id = H5Fcreate("/home/tg2hpps/tg2hpps_main/src/packageHdf5/dsetddd.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);

            H5Fclose(file_id);

}

Thanks!

Haijun,

Did do a 'make clean' or (even better) 'make distclean' before recompiling your code? Make is supposed to determine that the source files are newer than the object files and build all the object files that depend on those source files and so on, but it's possible that the dependency tree broke down somewhere.

I would recommend deleting your entire HDF5 source directory, unzipping HDF again, applying the patch, and the going through the configure and make process again.

Prentice

···

On 07/27/2016 08:24 AM, Dana Robinson wrote:

Hi Haijun,

If you are still getting a flock error, I'd be suspicious that you aren't linking to the patched HDF5 library. The source patch completely removes flock so you shouldn't be seeing file locking errors.

Dana Robinson

Software Engineer

The HDF Group

*From:*Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] *On Behalf Of *???
*Sent:* Wednesday, July 27, 2016 2:16 AM
*To:* HDF Users Discussion List <hdf-forum@lists.hdfgroup.org>
*Subject:* Re: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

    Hi Dana,

    Thanks for your response.

    I've tried with your method to patch and compile
    hdf5-1.10.0-patch1 source code. Patch and compile have no error.
    Unfortunately when run my code the error still exist. And error
    information is the same as before.

    What should I do? Please help me.

    Thank you again for your effort!

    Haijun Yu

At 2016-07-26 13:47:39, "Dana Robinson" <derobins@hdfgroup.org > <mailto:derobins@hdfgroup.org>> wrote:

    Hi,

    It looks like flock() is not implemented on your filesystem, which
    is causing the create call to fail. flock() file locking is used
    by the HDF5 1.10.0 to help enforce single-writer/multiple-readers
    (SWMR) semantics, but is not necessary for correct operation of
    the library. A fix for this problem should be available in HDF5
    1.10.1, but in the meantime you can apply a source patch found here:

    https://www.hdfgroup.org/HDF5/release/obtainsrc5110.html#conf

    under "Patch to Disable File Locking" at the bottom of the page.

    Cheers,

    Dana Robinson

    Software Engineer

    The HDF Group

    *From:*Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org
    <mailto:hdf-forum-bounces@lists.hdfgroup.org>] *On Behalf Of *???
    *Sent:* Tuesday, July 26, 2016 1:35 AM
    *To:* hdf-forum@lists.hdfgroup.org
    <mailto:hdf-forum@lists.hdfgroup.org>
    *Subject:* [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0:
    /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

    Hi,

    I have met an obscure failure, and not find a good solution for
    two days. Could you help me? Thanks!

    (Using: hdf5-1.10.0-patch1-linux-centos6-x86_64-gcc447-shared.tar.gz)

    (Environment: redhat6.4-Intel-X64-g++4.4.7)

    The error information:

    HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:

    #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c
    line 491 in H5Fcreate(): unable to create file

      major: File accessibilty

      minor: Unable to open file

    #001: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5Fint.c
    line 1168 in H5F_open(): unable to lock the file or initialize
    file structure

      major: File accessibilty

      minor: Unable to open file

    #002: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FD.c
    line 1821 in H5FD_lock(): driver lock request failed

      major: Virtual File Layer

      minor: Can't update object

    #003:
    /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FDsec2.c
    line 939 in H5FD_sec2_lock(): unable to flock file, errno = 38,
    error message = 'Function not implemented'

      major: File accessibilty

      minor: Bad file ID accessed

    HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:

    #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c
    line 749 in H5Fclose(): not a file ID

      major: Invalid arguments to routine

      minor: Inappropriate type

    compile no error: g++ -c packageHdf5.cpp -I ../latest/include -L
    ../latest/lib -lhdf5 -lhdf5_cpp

    link no error: g++ -o packageHdf5Run packageHdf5.o -I
    ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp

    run error: ./packageHdf5Run (error information as above)

    My code:

    #include <stdio.h>

    #include <iostream>

    #include <string>

    #include "H5Cpp.h"

    #include <H5File.h>

    #include "hdf5.h"

    #ifndef H5_NO_NAMESPACE

    using namespace H5;

    #endif

    using namespace std;

    int main(int argc, char* argv[])

    {

    hid_t file_id =
    H5Fcreate("/home/tg2hpps/tg2hpps_main/src/packageHdf5/dsetddd.h5",
    H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);

    H5Fclose(file_id);

    }

    Thanks!

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Hi Haijun,

If you are still getting a flock error, I'd be suspicious that you aren't linking to the patched HDF5 library. The source patch completely removes flock so you shouldn't be seeing file locking errors.

Dana Robinson
Software Engineer
The HDF Group

···

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of ???
Sent: Wednesday, July 27, 2016 2:16 AM
To: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org>
Subject: Re: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

Hi Dana,
Thanks for your response.

I've tried with your method to patch and compile hdf5-1.10.0-patch1 source code. Patch and compile have no error. Unfortunately when run my code the error still exist. And error information is the same as before.

What should I do? Please help me.

Thank you again for your effort!

Haijun Yu

At 2016-07-26 13:47:39, "Dana Robinson" <derobins@hdfgroup.org<mailto:derobins@hdfgroup.org>> wrote:

Hi,

It looks like flock() is not implemented on your filesystem, which is causing the create call to fail. flock() file locking is used by the HDF5 1.10.0 to help enforce single-writer/multiple-readers (SWMR) semantics, but is not necessary for correct operation of the library. A fix for this problem should be available in HDF5 1.10.1, but in the meantime you can apply a source patch found here:

https://www.hdfgroup.org/HDF5/release/obtainsrc5110.html#conf

under "Patch to Disable File Locking" at the bottom of the page.

Cheers,

Dana Robinson
Software Engineer
The HDF Group

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org<mailto:hdf-forum-bounces@lists.hdfgroup.org>] On Behalf Of ???
Sent: Tuesday, July 26, 2016 1:35 AM
To: hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>
Subject: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

Hi,
I have met an obscure failure, and not find a good solution for two days. Could you help me? Thanks!
(Using: hdf5-1.10.0-patch1-linux-centos6-x86_64-gcc447-shared.tar.gz)
(Environment: redhat6.4-Intel-X64-g++4.4.7)

The error information:
HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:
  #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c line 491 in H5Fcreate(): unable to create file
    major: File accessibilty
    minor: Unable to open file
  #001: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5Fint.c line 1168 in H5F_open(): unable to lock the file or initialize file structure
    major: File accessibilty
    minor: Unable to open file
  #002: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FD.c line 1821 in H5FD_lock(): driver lock request failed
    major: Virtual File Layer
    minor: Can't update object
  #003: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FDsec2.c line 939 in H5FD_sec2_lock(): unable to flock file, errno = 38, error message = 'Function not implemented'
    major: File accessibilty
    minor: Bad file ID accessed
HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:
  #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c line 749 in H5Fclose(): not a file ID
    major: Invalid arguments to routine
    minor: Inappropriate type

compile no error: g++ -c packageHdf5.cpp -I ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp
link no error: g++ -o packageHdf5Run packageHdf5.o -I ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp
run error: ./packageHdf5Run (error information as above)

My code:

#include <stdio.h>
#include <iostream>
#include <string>

#include "H5Cpp.h"
#include <H5File.h>
#include "hdf5.h"

#ifndef H5_NO_NAMESPACE
using namespace H5;
#endif

using namespace std;

int main(int argc, char* argv[])
{
            hid_t file_id = H5Fcreate("/home/tg2hpps/tg2hpps_main/src/packageHdf5/dsetddd.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);

            H5Fclose(file_id);
}

Thanks!

Hi Dana and Prentice,
    
        Thanks for your response.
        I've tried with your method to repatch and recompile hdf5-1.10.0-patch1 source code. And I also checked the three files H5private.h, H5system.c and swmr.c. They were actually changed after run patch. Unfortunately when run my code the error still exist. And error information is the same as before.

        I compile the hdf5 code as follows:
        patch -p0 < file-lock-removal.diff
        ./configure --prefix=/home/duc001/3dtools/hdf5-1.10.0 --enable-cxx --with-zlib=/home/duc001/zlib-1.2.8/
        make
        make clean
        make check
        make install
        make check-install
        
        echo $PATH as follows:
        /home/duc001/3dtools/hdf5-1.10.0/bin

        I compile my code as follows:
        g++ -c test.cpp -I /home/duc001/3dtools/hdf5-1.10.0/include -L /home/duc001/3dtools/hdf5-1.10.0/lib -lhdf5 -lhdf5_cpp //no error
        g++ -o testRun test.o -I /home/duc001/3dtools/hdf5-1.10.0/include -L /home/duc001/3dtools/hdf5-1.10.0/lib -lhdf5 -lhdf5_cpp //no error
        ./testRun // with error

        Are there any questions in the above operation?

        Thanks again for your effort!

         Haijun Yu

···

At 2016-07-27 21:46:43, "Prentice Bisbal" <pbisbal@pppl.gov> wrote:
Haijun,

Did do a 'make clean' or (even better) 'make distclean' before recompiling your code? Make is supposed to determine that the source files are newer than the object files and build all the object files that depend on those source files and so on, but it's possible that the dependency tree broke down somewhere.

I would recommend deleting your entire HDF5 source directory, unzipping HDF again, applying the patch, and the going through the configure and make process again.

Prentice
On 07/27/2016 08:24 AM, Dana Robinson wrote:

Hi Haijun,

If you are still getting a flock error, I'd be suspicious that you aren't linking to the patched HDF5 library. The source patch completely removes flock so you shouldn't be seeing file locking errors.

Dana Robinson

Software Engineer

The HDF Group

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of ???
Sent: Wednesday, July 27, 2016 2:16 AM
To: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org>
Subject: Re: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

Hi Dana,

Thanks for your response.

I've tried with your method to patch and compile hdf5-1.10.0-patch1 source code. Patch and compile have no error. Unfortunately when run my code the error still exist. And error information is the same as before.

What should I do? Please help me.

Thank you again for your effort!

Haijun Yu

At 2016-07-26 13:47:39, "Dana Robinson" <derobins@hdfgroup.org> wrote:

Hi,

It looks like flock() is not implemented on your filesystem, which is causing the create call to fail. flock() file locking is used by the HDF5 1.10.0 to help enforce single-writer/multiple-readers (SWMR) semantics, but is not necessary for correct operation of the library. A fix for this problem should be available in HDF5 1.10.1, but in the meantime you can apply a source patch found here:

https://www.hdfgroup.org/HDF5/release/obtainsrc5110.html#conf

under "Patch to Disable File Locking" at the bottom of the page.

Cheers,

Dana Robinson

Software Engineer

The HDF Group

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of ???
Sent: Tuesday, July 26, 2016 1:35 AM
To:hdf-forum@lists.hdfgroup.org
Subject: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

Hi,

I have met an obscure failure, and not find a good solution for two days. Could you help me? Thanks!

(Using: hdf5-1.10.0-patch1-linux-centos6-x86_64-gcc447-shared.tar.gz)

(Environment: redhat6.4-Intel-X64-g++4.4.7)

The error information:

HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:

  #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c line 491 in H5Fcreate(): unable to create file

    major: File accessibilty

    minor: Unable to open file

  #001: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5Fint.c line 1168 in H5F_open(): unable to lock the file or initialize file structure

    major: File accessibilty

    minor: Unable to open file

  #002: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FD.c line 1821 in H5FD_lock(): driver lock request failed

    major: Virtual File Layer

    minor: Can't update object

  #003: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FDsec2.c line 939 in H5FD_sec2_lock(): unable to flock file, errno = 38, error message = 'Function not implemented'

    major: File accessibilty

    minor: Bad file ID accessed

HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:

  #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c line 749 in H5Fclose(): not a file ID

    major: Invalid arguments to routine

    minor: Inappropriate type

compile no error: g++ -c packageHdf5.cpp -I ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp

link no error: g++ -o packageHdf5Run packageHdf5.o -I ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp

run error: ./packageHdf5Run (error information as above)

My code:

#include <stdio.h>

#include <iostream>

#include <string>

#include "H5Cpp.h"

#include <H5File.h>

#include "hdf5.h"

#ifndef H5_NO_NAMESPACE

using namespace H5;

#endif

using namespace std;

int main(int argc, char* argv[])

{

            hid_t file_id = H5Fcreate("/home/tg2hpps/tg2hpps_main/src/packageHdf5/dsetddd.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);

            H5Fclose(file_id);

}

Thanks!

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.orghttp://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

I know this may sound like a stupid question, but I have to ask, because I've learned never to assume things: Are you sure you have write access where you're trying to create this file? Have you confirmed this by going the directory where you are trying to create the directory and doing 'touch test', which will create an empty file named "test"?

Prentice

···

On 07/28/2016 11:24 PM, 于海军 wrote:

Hi Dana and Prentice,
Thanks for your response.
I've tried with your method to repatch and recompile hdf5-1.10.0-patch1 source code. And I also checked the three files H5private.h, H5system.c and swmr.c. They were actually changed after run patch. Unfortunately when run my code the error still exist. And error information is the same as before.

        I compile the hdf5 code as follows:
        patch -p0 < file-lock-removal.diff
        ./configure --prefix=/home/duc001/3dtools/hdf5-1.10.0 --enable-cxx --with-zlib=/home/duc001/zlib-1.2.8/
        make
        make clean
        make check
        make install
        make check-install
        echo $PATH as follows:
/home/duc001/3dtools/hdf5-1.10.0/bin

        I compile my code as follows:
        g++ -c test.cpp -I /home/duc001/3dtools/hdf5-1.10.0/include -L /home/duc001/3dtools/hdf5-1.10.0/lib -lhdf5 -lhdf5_cpp //no error
g++ -o testRun test.o -I /home/duc001/3dtools/hdf5-1.10.0/include -L /home/duc001/3dtools/hdf5-1.10.0/lib -lhdf5 -lhdf5_cpp //no error
        ./testRun // with error

        Are there any questions in the above operation?

Thanks again for your effort!

         Haijun Yu

At 2016-07-27 21:46:43, "Prentice Bisbal" <pbisbal@pppl.gov> wrote:

    Haijun,

    Did do a 'make clean' or (even better) 'make distclean' before
    recompiling your code? Make is supposed to determine that the
    source files are newer than the object files and build all the
    object files that depend on those source files and so on, but it's
    possible that the dependency tree broke down somewhere.

    I would recommend deleting your entire HDF5 source directory,
    unzipping HDF again, applying the patch, and the going through
    the configure and make process again.

    Prentice

    On 07/27/2016 08:24 AM, Dana Robinson wrote:

    Hi Haijun,

    If you are still getting a flock error, I'd be suspicious that
    you aren't linking to the patched HDF5 library. The source patch
    completely removes flock so you shouldn't be seeing file locking
    errors.

    Dana Robinson

    Software Engineer

    The HDF Group

    *From:*Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org]
    *On Behalf Of *???
    *Sent:* Wednesday, July 27, 2016 2:16 AM
    *To:* HDF Users Discussion List <hdf-forum@lists.hdfgroup.org>
    *Subject:* Re: [Hdf-forum] Error detected in HDF5 (1.10.0) thread
    0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

        Hi Dana,

        Thanks for your response.

        I've tried with your method to patch and compile
        hdf5-1.10.0-patch1 source code. Patch and compile have no
        error. Unfortunately when run my code the error still exist.
        And error information is the same as before.

        What should I do? Please help me.

        Thank you again for your effort!

        Haijun Yu

    At 2016-07-26 13:47:39, "Dana Robinson" <derobins@hdfgroup.org >> <mailto:derobins@hdfgroup.org>> wrote:

        Hi,

        It looks like flock() is not implemented on your filesystem,
        which is causing the create call to fail. flock() file
        locking is used by the HDF5 1.10.0 to help enforce
        single-writer/multiple-readers (SWMR) semantics, but is not
        necessary for correct operation of the library. A fix for
        this problem should be available in HDF5 1.10.1, but in the
        meantime you can apply a source patch found here:

        https://www.hdfgroup.org/HDF5/release/obtainsrc5110.html#conf

        under "Patch to Disable File Locking" at the bottom of the page.

        Cheers,

        Dana Robinson

        Software Engineer

        The HDF Group

        *From:*Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org
        <mailto:hdf-forum-bounces@lists.hdfgroup.org>] *On Behalf Of *???
        *Sent:* Tuesday, July 26, 2016 1:35 AM
        *To:* hdf-forum@lists.hdfgroup.org
        <mailto:hdf-forum@lists.hdfgroup.org>
        *Subject:* [Hdf-forum] Error detected in HDF5 (1.10.0) thread
        0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

        Hi,

        I have met an obscure failure, and not find a good solution
        for two days. Could you help me? Thanks!

        (Using:
        hdf5-1.10.0-patch1-linux-centos6-x86_64-gcc447-shared.tar.gz)

        (Environment: redhat6.4-Intel-X64-g++4.4.7)

        The error information:

        HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:

        #000:
        /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c
        line 491 in H5Fcreate(): unable to create file

          major: File accessibilty

          minor: Unable to open file

        #001:
        /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5Fint.c
        line 1168 in H5F_open(): unable to lock the file or
        initialize file structure

          major: File accessibilty

          minor: Unable to open file

        #002:
        /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FD.c
        line 1821 in H5FD_lock(): driver lock request failed

          major: Virtual File Layer

          minor: Can't update object

        #003:
        /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FDsec2.c
        line 939 in H5FD_sec2_lock(): unable to flock file, errno =
        38, error message = 'Function not implemented'

          major: File accessibilty

          minor: Bad file ID accessed

        HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:

        #000:
        /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c
        line 749 in H5Fclose(): not a file ID

          major: Invalid arguments to routine

          minor: Inappropriate type

        compile no error: g++ -c packageHdf5.cpp -I ../latest/include
        -L ../latest/lib -lhdf5 -lhdf5_cpp

        link no error: g++ -o packageHdf5Run packageHdf5.o -I
        ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp

        run error: ./packageHdf5Run (error information as above)

        My code:

        #include <stdio.h>

        #include <iostream>

        #include <string>

        #include "H5Cpp.h"

        #include <H5File.h>

        #include "hdf5.h"

        #ifndef H5_NO_NAMESPACE

        using namespace H5;

        #endif

        using namespace std;

        int main(int argc, char* argv[])

        {

        hid_t file_id =
        H5Fcreate("/home/tg2hpps/tg2hpps_main/src/packageHdf5/dsetddd.h5",
        H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);

        H5Fclose(file_id);

        }

        Thanks!

    _______________________________________________
    Hdf-forum is for HDF software users discussion.
    Hdf-forum@lists.hdfgroup.org
    http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
    Twitter:https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Hi all,

The source patch removes all references to flock() so this error should not be occurring, regardless of the permissions. If you are still seeing errors, I suspect that you are linking to a different HDF5 library than the one you patched.

One thing I would try is, instead of using g++ directly, try using the h5c++ compiler wrapper that should be located in the bin directory of the HDF5 install. That will ensure that you are linking to the correct libraries. When you use h5c++, you won't need to include the -I, -L, and -l flags for HDF5 paths and libraries since h5c++ sets that up for you.

Dana Robinson
Software Engineer
The HDF Group

···

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of Prentice Bisbal
Sent: Friday, July 29, 2016 9:43 AM
To: hdf-forum@lists.hdfgroup.org
Subject: Re: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

I know this may sound like a stupid question, but I have to ask, because I've learned never to assume things: Are you sure you have write access where you're trying to create this file? Have you confirmed this by going the directory where you are trying to create the directory and doing 'touch test', which will create an empty file named "test"?

Prentice
On 07/28/2016 11:24 PM, 于海军 wrote:
Hi Dana and Prentice,

        Thanks for your response.
        I've tried with your method to repatch and recompile hdf5-1.10.0-patch1 source code. And I also checked the three files H5private.h, H5system.c and swmr.c. They were actually changed after run patch. Unfortunately when run my code the error still exist. And error information is the same as before.

        I compile the hdf5 code as follows:
        patch -p0 < file-lock-removal.diff
        ./configure --prefix=/home/duc001/3dtools/hdf5-1.10.0 --enable-cxx --with-zlib=/home/duc001/zlib-1.2.8/
        make
        make clean
        make check
        make install
        make check-install

        echo $PATH as follows:
        /home/duc001/3dtools/hdf5-1.10.0/bin

        I compile my code as follows:
        g++ -c test.cpp -I /home/duc001/3dtools/hdf5-1.10.0/include -L /home/duc001/3dtools/hdf5-1.10.0/lib -lhdf5 -lhdf5_cpp //no error
        g++ -o testRun test.o -I /home/duc001/3dtools/hdf5-1.10.0/include -L /home/duc001/3dtools/hdf5-1.10.0/lib -lhdf5 -lhdf5_cpp //no error
        ./testRun // with error

        Are there any questions in the above operation?

        Thanks again for your effort!

         Haijun Yu

At 2016-07-27 21:46:43, "Prentice Bisbal" <pbisbal@pppl.gov><mailto:pbisbal@pppl.gov> wrote:

Haijun,

Did do a 'make clean' or (even better) 'make distclean' before recompiling your code? Make is supposed to determine that the source files are newer than the object files and build all the object files that depend on those source files and so on, but it's possible that the dependency tree broke down somewhere.

I would recommend deleting your entire HDF5 source directory, unzipping HDF again, applying the patch, and the going through the configure and make process again.

Prentice
On 07/27/2016 08:24 AM, Dana Robinson wrote:
Hi Haijun,

If you are still getting a flock error, I'd be suspicious that you aren't linking to the patched HDF5 library. The source patch completely removes flock so you shouldn't be seeing file locking errors.

Dana Robinson
Software Engineer
The HDF Group

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of ???
Sent: Wednesday, July 27, 2016 2:16 AM
To: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org><mailto:hdf-forum@lists.hdfgroup.org>
Subject: Re: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

Hi Dana,
Thanks for your response.

I've tried with your method to patch and compile hdf5-1.10.0-patch1 source code. Patch and compile have no error. Unfortunately when run my code the error still exist. And error information is the same as before.

What should I do? Please help me.

Thank you again for your effort!

Haijun Yu

At 2016-07-26 13:47:39, "Dana Robinson" <derobins@hdfgroup.org<mailto:derobins@hdfgroup.org>> wrote:

Hi,

It looks like flock() is not implemented on your filesystem, which is causing the create call to fail. flock() file locking is used by the HDF5 1.10.0 to help enforce single-writer/multiple-readers (SWMR) semantics, but is not necessary for correct operation of the library. A fix for this problem should be available in HDF5 1.10.1, but in the meantime you can apply a source patch found here:

https://www.hdfgroup.org/HDF5/release/obtainsrc5110.html#conf

under "Patch to Disable File Locking" at the bottom of the page.

Cheers,

Dana Robinson
Software Engineer
The HDF Group

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org<mailto:hdf-forum-bounces@lists.hdfgroup.org>] On Behalf Of ???
Sent: Tuesday, July 26, 2016 1:35 AM
To: hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>
Subject: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

Hi,
I have met an obscure failure, and not find a good solution for two days. Could you help me? Thanks!
(Using: hdf5-1.10.0-patch1-linux-centos6-x86_64-gcc447-shared.tar.gz)
(Environment: redhat6.4-Intel-X64-g++4.4.7)

The error information:
HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:
  #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c line 491 in H5Fcreate(): unable to create file
    major: File accessibilty
    minor: Unable to open file
  #001: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5Fint.c line 1168 in H5F_open(): unable to lock the file or initialize file structure
    major: File accessibilty
    minor: Unable to open file
  #002: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FD.c line 1821 in H5FD_lock(): driver lock request failed
    major: Virtual File Layer
    minor: Can't update object
  #003: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FDsec2.c line 939 in H5FD_sec2_lock(): unable to flock file, errno = 38, error message = 'Function not implemented'
    major: File accessibilty
    minor: Bad file ID accessed
HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:
  #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c line 749 in H5Fclose(): not a file ID
    major: Invalid arguments to routine
    minor: Inappropriate type

compile no error: g++ -c packageHdf5.cpp -I ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp
link no error: g++ -o packageHdf5Run packageHdf5.o -I ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp
run error: ./packageHdf5Run (error information as above)

My code:

#include <stdio.h>
#include <iostream>
#include <string>

#include "H5Cpp.h"
#include <H5File.h>
#include "hdf5.h"

#ifndef H5_NO_NAMESPACE
using namespace H5;
#endif

using namespace std;

int main(int argc, char* argv[])
{
            hid_t file_id = H5Fcreate("/home/tg2hpps/tg2hpps_main/src/packageHdf5/dsetddd.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);

            H5Fclose(file_id);
}

Thanks!

_______________________________________________

Hdf-forum is for HDF software users discussion.

Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>

http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Twitter: https://twitter.com/hdf5

_______________________________________________

Hdf-forum is for HDF software users discussion.

Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>

http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Twitter: https://twitter.com/hdf5

Hi Dana and Prentice,

        Thanks for your help.

         My problem has been solved perfectly. I use the h5c++ compiler to compile the code, and it works. Wonderful!

         Maybe I linked to the error libraries when I linked mannually.

        Thanks again for your help!

         Haijun Yu

···

At 2016-07-29 23:40:52, "Dana Robinson" <derobins@hdfgroup.org> wrote:

Hi all,

The source patch removes all references to flock() so this error should not be occurring, regardless of the permissions. If you are still seeing errors, I suspect that you are linking to a different HDF5 library than the one you patched.

One thing I would try is, instead of using g++ directly, try using the h5c++ compiler wrapper that should be located in the bin directory of the HDF5 install. That will ensure that you are linking to the correct libraries. When you use h5c++, you won't need to include the -I, -L, and -l flags for HDF5 paths and libraries since h5c++ sets that up for you.

Dana Robinson

Software Engineer

The HDF Group

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of Prentice Bisbal
Sent: Friday, July 29, 2016 9:43 AM
To:hdf-forum@lists.hdfgroup.org
Subject: Re: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

I know this may sound like a stupid question, but I have to ask, because I've learned never to assume things: Are you sure you have write access where you're trying to create this file? Have you confirmed this by going the directory where you are trying to create the directory and doing 'touch test', which will create an empty file named "test"?

Prentice

On 07/28/2016 11:24 PM, 于海军 wrote:

Hi Dana and Prentice,

        Thanks for your response.

        I've tried with your method to repatch and recompile hdf5-1.10.0-patch1 source code. And I also checked the three files H5private.h, H5system.c and swmr.c. They were actually changed after run patch. Unfortunately when run my code the error still exist. And error information is the same as before.

        I compile the hdf5 code as follows:

        patch -p0 < file-lock-removal.diff

        ./configure --prefix=/home/duc001/3dtools/hdf5-1.10.0 --enable-cxx --with-zlib=/home/duc001/zlib-1.2.8/

        make

        make clean

        make check

        make install

        make check-install

        echo $PATH as follows:

        /home/duc001/3dtools/hdf5-1.10.0/bin

        I compile my code as follows:

        g++ -c test.cpp -I /home/duc001/3dtools/hdf5-1.10.0/include -L /home/duc001/3dtools/hdf5-1.10.0/lib -lhdf5 -lhdf5_cpp //no error

        g++ -o testRun test.o -I /home/duc001/3dtools/hdf5-1.10.0/include -L /home/duc001/3dtools/hdf5-1.10.0/lib -lhdf5 -lhdf5_cpp //no error

        ./testRun // with error

        Are there any questions in the above operation?

        Thanks again for your effort!

         Haijun Yu

At 2016-07-27 21:46:43, "Prentice Bisbal" <pbisbal@pppl.gov> wrote:

Haijun,

Did do a 'make clean' or (even better) 'make distclean' before recompiling your code? Make is supposed to determine that the source files are newer than the object files and build all the object files that depend on those source files and so on, but it's possible that the dependency tree broke down somewhere.

I would recommend deleting your entire HDF5 source directory, unzipping HDF again, applying the patch, and the going through the configure and make process again.

Prentice

On 07/27/2016 08:24 AM, Dana Robinson wrote:

Hi Haijun,

If you are still getting a flock error, I'd be suspicious that you aren't linking to the patched HDF5 library. The source patch completely removes flock so you shouldn't be seeing file locking errors.

Dana Robinson

Software Engineer

The HDF Group

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of ???
Sent: Wednesday, July 27, 2016 2:16 AM
To: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org>
Subject: Re: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

Hi Dana,

Thanks for your response.

I've tried with your method to patch and compile hdf5-1.10.0-patch1 source code. Patch and compile have no error. Unfortunately when run my code the error still exist. And error information is the same as before.

What should I do? Please help me.

Thank you again for your effort!

Haijun Yu

At 2016-07-26 13:47:39, "Dana Robinson" <derobins@hdfgroup.org> wrote:

Hi,

It looks like flock() is not implemented on your filesystem, which is causing the create call to fail. flock() file locking is used by the HDF5 1.10.0 to help enforce single-writer/multiple-readers (SWMR) semantics, but is not necessary for correct operation of the library. A fix for this problem should be available in HDF5 1.10.1, but in the meantime you can apply a source patch found here:

https://www.hdfgroup.org/HDF5/release/obtainsrc5110.html#conf

under "Patch to Disable File Locking" at the bottom of the page.

Cheers,

Dana Robinson

Software Engineer

The HDF Group

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of ???
Sent: Tuesday, July 26, 2016 1:35 AM
To:hdf-forum@lists.hdfgroup.org
Subject: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

Hi,

I have met an obscure failure, and not find a good solution for two days. Could you help me? Thanks!

(Using: hdf5-1.10.0-patch1-linux-centos6-x86_64-gcc447-shared.tar.gz)

(Environment: redhat6.4-Intel-X64-g++4.4.7)

The error information:

HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:

  #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c line 491 in H5Fcreate(): unable to create file

    major: File accessibilty

    minor: Unable to open file

  #001: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5Fint.c line 1168 in H5F_open(): unable to lock the file or initialize file structure

    major: File accessibilty

    minor: Unable to open file

  #002: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FD.c line 1821 in H5FD_lock(): driver lock request failed

    major: Virtual File Layer

    minor: Can't update object

  #003: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FDsec2.c line 939 in H5FD_sec2_lock(): unable to flock file, errno = 38, error message = 'Function not implemented'

    major: File accessibilty

    minor: Bad file ID accessed

HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:

  #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c line 749 in H5Fclose(): not a file ID

    major: Invalid arguments to routine

    minor: Inappropriate type

compile no error: g++ -c packageHdf5.cpp -I ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp

link no error: g++ -o packageHdf5Run packageHdf5.o -I ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp

run error: ./packageHdf5Run (error information as above)

My code:

#include <stdio.h>

#include <iostream>

#include <string>

#include "H5Cpp.h"

#include <H5File.h>

#include "hdf5.h"

#ifndef H5_NO_NAMESPACE

using namespace H5;

#endif

using namespace std;

int main(int argc, char* argv[])

{

            hid_t file_id = H5Fcreate("/home/tg2hpps/tg2hpps_main/src/packageHdf5/dsetddd.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);

            H5Fclose(file_id);

}

Thanks!

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Great news! Thanks for letting us know.

Prentice

···

On 07/31/2016 11:14 PM, 于海军 wrote:

Hi Dana and Prentice,

Thanks for your help.

   My problem has been solved perfectly. I use the h5c++ compiler to compile the code, and it works. Wonderful!

Maybe I linked to the error libraries when I linked mannually.

Thanks again for your help!

       Haijun Yu

At 2016-07-29 23:40:52, "Dana Robinson" <derobins@hdfgroup.org> wrote:

    Hi all,

    The source patch removes all references to flock() so this error
    should not be occurring, regardless of the permissions. If you are
    still seeing errors, I suspect that you are linking to a different
    HDF5 library than the one you patched.

    One thing I would try is, instead of using g++ directly, try using
    the h5c++ compiler wrapper that should be located in the bin
    directory of the HDF5 install. That will ensure that you are
    linking to the correct libraries. When you use h5c++, you won't
    need to include the -I, -L, and -l flags for HDF5 paths and
    libraries since h5c++ sets that up for you.

    Dana Robinson

    Software Engineer

    The HDF Group

    *From:*Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org
    <mailto:hdf-forum-bounces@lists.hdfgroup.org>] *On Behalf Of
    *Prentice Bisbal
    *Sent:* Friday, July 29, 2016 9:43 AM
    *To:* hdf-forum@lists.hdfgroup.org
    <mailto:hdf-forum@lists.hdfgroup.org>
    *Subject:* Re: [Hdf-forum] Error detected in HDF5 (1.10.0) thread
    0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

    I know this may sound like a stupid question, but I have to ask,
    because I've learned never to assume things: Are you sure you have
    write access where you're trying to create this file? Have you
    confirmed this by going the directory where you are trying to
    create the directory and doing 'touch test', which will create an
    empty file named "test"?

    Prentice

    On 07/28/2016 11:24 PM, 于海军 wrote:

        Hi Dana and Prentice,

        Thanks for your response.

        I've tried with your method to repatch and recompile
        hdf5-1.10.0-patch1 source code. And I also checked the three
        files H5private.h, H5system.c and swmr.c. They were actually
        changed after run patch. Unfortunately when run my code the
        error still exist. And error information is the same as before.

              I compile the hdf5 code as follows:

              patch -p0 < file-lock-removal.diff

              ./configure --prefix=/home/duc001/3dtools/hdf5-1.10.0
        --enable-cxx --with-zlib=/home/duc001/zlib-1.2.8/

              make

              make clean

              make check

              make install

              make check-install

              echo $PATH as follows:

              /home/duc001/3dtools/hdf5-1.10.0/bin

              I compile my code as follows:

              g++ -c test.cpp
        -I /home/duc001/3dtools/hdf5-1.10.0/include
        -L /home/duc001/3dtools/hdf5-1.10.0/lib -lhdf5 -lhdf5_cpp
         //no error

              g++ -o testRun test.o
        -I /home/duc001/3dtools/hdf5-1.10.0/include
        -L /home/duc001/3dtools/hdf5-1.10.0/lib -lhdf5 -lhdf5_cpp
         //no error

              ./testRun // with error

              Are there any questions in the above operation?

        Thanks again for your effort!

               Haijun Yu

        At 2016-07-27 21:46:43, "Prentice Bisbal" <pbisbal@pppl.gov> > <mailto:pbisbal@pppl.gov>wrote:

            Haijun,

            Did do a 'make clean' or (even better) 'make distclean'
            before recompiling your code? Make is supposed to
            determine that the source files are newer than the object
            files and build all the object files that depend on those
            source files and so on, but it's possible that the
            dependency tree broke down somewhere.

            I would recommend deleting your entire HDF5 source
            directory, unzipping HDF again, applying the patch, and
            the going through the configure and make process again.

            Prentice

            On 07/27/2016 08:24 AM, Dana Robinson wrote:

                Hi Haijun,

                If you are still getting a flock error, I'd be
                suspicious that you aren't linking to the patched HDF5
                library. The source patch completely removes flock so
                you shouldn't be seeing file locking errors.

                Dana Robinson

                Software Engineer

                The HDF Group

                *From:*Hdf-forum
                [mailto:hdf-forum-bounces@lists.hdfgroup.org] *On
                Behalf Of *???
                *Sent:* Wednesday, July 27, 2016 2:16 AM
                *To:* HDF Users Discussion List
                <hdf-forum@lists.hdfgroup.org>
                <mailto:hdf-forum@lists.hdfgroup.org>
                *Subject:* Re: [Hdf-forum] Error detected in HDF5
                (1.10.0) thread 0:
                /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

                    Hi Dana,

                    Thanks for your response.

                    I've tried with your method to patch and compile
                    hdf5-1.10.0-patch1 source code. Patch and compile
                    have no error. Unfortunately when run my code the
                    error still exist. And error information is the
                    same as before.

                    What should I do? Please help me.

                    Thank you again for your effort!

                    Haijun Yu

                At 2016-07-26 13:47:39, "Dana Robinson" > <derobins@hdfgroup.org <mailto:derobins@hdfgroup.org>> > wrote:

                    Hi,

                    It looks like flock() is not implemented on your
                    filesystem, which is causing the create call to
                    fail. flock() file locking is used by the HDF5
                    1.10.0 to help enforce
                    single-writer/multiple-readers (SWMR) semantics,
                    but is not necessary for correct operation of the
                    library. A fix for this problem should be
                    available in HDF5 1.10.1, but in the meantime you
                    can apply a source patch found here:

                    https://www.hdfgroup.org/HDF5/release/obtainsrc5110.html#conf

                    under "Patch to Disable File Locking" at the
                    bottom of the page.

                    Cheers,

                    Dana Robinson

                    Software Engineer

                    The HDF Group

                    *From:*Hdf-forum
                    [mailto:hdf-forum-bounces@lists.hdfgroup.org
                    <mailto:hdf-forum-bounces@lists.hdfgroup.org>] *On
                    Behalf Of *???
                    *Sent:* Tuesday, July 26, 2016 1:35 AM
                    *To:* hdf-forum@lists.hdfgroup.org
                    <mailto:hdf-forum@lists.hdfgroup.org>
                    *Subject:* [Hdf-forum] Error detected in HDF5
                    (1.10.0) thread 0:
                    /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

                    Hi,

                    I have met an obscure failure, and not find a good
                    solution for two days. Could you help me? Thanks!

                    (Using:
                    hdf5-1.10.0-patch1-linux-centos6-x86_64-gcc447-shared.tar.gz)

                    (Environment: redhat6.4-Intel-X64-g++4.4.7)

                    The error information:

                    HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:

                    #000:
                    /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c
                    line 491 in H5Fcreate(): unable to create file

                    major: File accessibilty

                    minor: Unable to open file

                    #001:
                    /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5Fint.c
                    line 1168 in H5F_open(): unable to lock the file
                    or initialize file structure

                    major: File accessibilty

                    minor: Unable to open file

                    #002:
                    /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FD.c
                    line 1821 in H5FD_lock(): driver lock request failed

                    major: Virtual File Layer

                    minor: Can't update object

                    #003:
                    /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FDsec2.c
                    line 939 in H5FD_sec2_lock(): unable to flock
                    file, errno = 38, error message = 'Function not
                    implemented'

                    major: File accessibilty

                    minor: Bad file ID accessed

                    HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:

                    #000:
                    /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c
                    line 749 in H5Fclose(): not a file ID

                    major: Invalid arguments to routine

                    minor: Inappropriate type

                    compile no error: g++ -c packageHdf5.cpp -I
                    ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp

                    link no error: g++ -o packageHdf5Run packageHdf5.o
                    -I ../latest/include -L ../latest/lib -lhdf5
                    -lhdf5_cpp

                    run error: ./packageHdf5Run (error information
                    as above)

                    My code:

                    #include <stdio.h>

                    #include <iostream>

                    #include <string>

                    #include "H5Cpp.h"

                    #include <H5File.h>

                    #include "hdf5.h"

                    #ifndef H5_NO_NAMESPACE

                    using namespace H5;

                    #endif

                    using namespace std;

                    int main(int argc, char* argv[])

                    {

                    hid_t file_id =
                    H5Fcreate("/home/tg2hpps/tg2hpps_main/src/packageHdf5/dsetddd.h5",
                    H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);

                    H5Fclose(file_id);

                    }

                    Thanks!

                _______________________________________________

                Hdf-forum is for HDF software users discussion.

                Hdf-forum@lists.hdfgroup.org
                <mailto:Hdf-forum@lists.hdfgroup.org>

                http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

                Twitter:https://twitter.com/hdf5

        _______________________________________________

        Hdf-forum is for HDF software users discussion.

        Hdf-forum@lists.hdfgroup.org <mailto:Hdf-forum@lists.hdfgroup.org>

        http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

        Twitter:https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Great! Glad that worked for you.

Dana

···

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of ???
Sent: Sunday, July 31, 2016 11:15 PM
To: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org>
Subject: Re: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

Hi Dana and Prentice,
        Thanks for your help.
         My problem has been solved perfectly. I use the h5c++ compiler to compile the code, and it works. Wonderful!
         Maybe I linked to the error libraries when I linked mannually.
        Thanks again for your help!
         Haijun Yu

At 2016-07-29 23:40:52, "Dana Robinson" <derobins@hdfgroup.org<mailto:derobins@hdfgroup.org>> wrote:

Hi all,

The source patch removes all references to flock() so this error should not be occurring, regardless of the permissions. If you are still seeing errors, I suspect that you are linking to a different HDF5 library than the one you patched.

One thing I would try is, instead of using g++ directly, try using the h5c++ compiler wrapper that should be located in the bin directory of the HDF5 install. That will ensure that you are linking to the correct libraries. When you use h5c++, you won't need to include the -I, -L, and -l flags for HDF5 paths and libraries since h5c++ sets that up for you.

Dana Robinson
Software Engineer
The HDF Group

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org<mailto:hdf-forum-bounces@lists.hdfgroup.org>] On Behalf Of Prentice Bisbal
Sent: Friday, July 29, 2016 9:43 AM
To: hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>
Subject: Re: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

I know this may sound like a stupid question, but I have to ask, because I've learned never to assume things: Are you sure you have write access where you're trying to create this file? Have you confirmed this by going the directory where you are trying to create the directory and doing 'touch test', which will create an empty file named "test"?

Prentice
On 07/28/2016 11:24 PM, 于海军 wrote:
Hi Dana and Prentice,

        Thanks for your response.
        I've tried with your method to repatch and recompile hdf5-1.10.0-patch1 source code. And I also checked the three files H5private.h, H5system.c and swmr.c. They were actually changed after run patch. Unfortunately when run my code the error still exist. And error information is the same as before.

        I compile the hdf5 code as follows:
        patch -p0 < file-lock-removal.diff
        ./configure --prefix=/home/duc001/3dtools/hdf5-1.10.0 --enable-cxx --with-zlib=/home/duc001/zlib-1.2.8/
        make
        make clean
        make check
        make install
        make check-install

        echo $PATH as follows:
        /home/duc001/3dtools/hdf5-1.10.0/bin

        I compile my code as follows:
        g++ -c test.cpp -I /home/duc001/3dtools/hdf5-1.10.0/include -L /home/duc001/3dtools/hdf5-1.10.0/lib -lhdf5 -lhdf5_cpp //no error
        g++ -o testRun test.o -I /home/duc001/3dtools/hdf5-1.10.0/include -L /home/duc001/3dtools/hdf5-1.10.0/lib -lhdf5 -lhdf5_cpp //no error
        ./testRun // with error

        Are there any questions in the above operation?

        Thanks again for your effort!

         Haijun Yu

At 2016-07-27 21:46:43, "Prentice Bisbal" <pbisbal@pppl.gov><mailto:pbisbal@pppl.gov> wrote:
Haijun,

Did do a 'make clean' or (even better) 'make distclean' before recompiling your code? Make is supposed to determine that the source files are newer than the object files and build all the object files that depend on those source files and so on, but it's possible that the dependency tree broke down somewhere.

I would recommend deleting your entire HDF5 source directory, unzipping HDF again, applying the patch, and the going through the configure and make process again.

Prentice
On 07/27/2016 08:24 AM, Dana Robinson wrote:
Hi Haijun,

If you are still getting a flock error, I'd be suspicious that you aren't linking to the patched HDF5 library. The source patch completely removes flock so you shouldn't be seeing file locking errors.

Dana Robinson
Software Engineer
The HDF Group

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of ???
Sent: Wednesday, July 27, 2016 2:16 AM
To: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org><mailto:hdf-forum@lists.hdfgroup.org>
Subject: Re: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

Hi Dana,
Thanks for your response.

I've tried with your method to patch and compile hdf5-1.10.0-patch1 source code. Patch and compile have no error. Unfortunately when run my code the error still exist. And error information is the same as before.

What should I do? Please help me.

Thank you again for your effort!

Haijun Yu

At 2016-07-26 13:47:39, "Dana Robinson" <derobins@hdfgroup.org<mailto:derobins@hdfgroup.org>> wrote:

Hi,

It looks like flock() is not implemented on your filesystem, which is causing the create call to fail. flock() file locking is used by the HDF5 1.10.0 to help enforce single-writer/multiple-readers (SWMR) semantics, but is not necessary for correct operation of the library. A fix for this problem should be available in HDF5 1.10.1, but in the meantime you can apply a source patch found here:

https://www.hdfgroup.org/HDF5/release/obtainsrc5110.html#conf

under "Patch to Disable File Locking" at the bottom of the page.

Cheers,

Dana Robinson
Software Engineer
The HDF Group

From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org<mailto:hdf-forum-bounces@lists.hdfgroup.org>] On Behalf Of ???
Sent: Tuesday, July 26, 2016 1:35 AM
To: hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>
Subject: [Hdf-forum] Error detected in HDF5 (1.10.0) thread 0: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src

Hi,
I have met an obscure failure, and not find a good solution for two days. Could you help me? Thanks!
(Using: hdf5-1.10.0-patch1-linux-centos6-x86_64-gcc447-shared.tar.gz)
(Environment: redhat6.4-Intel-X64-g++4.4.7)

The error information:
HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:
  #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c line 491 in H5Fcreate(): unable to create file
    major: File accessibilty
    minor: Unable to open file
  #001: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5Fint.c line 1168 in H5F_open(): unable to lock the file or initialize file structure
    major: File accessibilty
    minor: Unable to open file
  #002: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FD.c line 1821 in H5FD_lock(): driver lock request failed
    major: Virtual File Layer
    minor: Can't update object
  #003: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5FDsec2.c line 939 in H5FD_sec2_lock(): unable to flock file, errno = 38, error message = 'Function not implemented'
    major: File accessibilty
    minor: Bad file ID accessed
HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:
  #000: /home/hdftest/snapshots-hdf5_1_10_alpha/current/src/H5F.c line 749 in H5Fclose(): not a file ID
    major: Invalid arguments to routine
    minor: Inappropriate type

compile no error: g++ -c packageHdf5.cpp -I ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp
link no error: g++ -o packageHdf5Run packageHdf5.o -I ../latest/include -L ../latest/lib -lhdf5 -lhdf5_cpp
run error: ./packageHdf5Run (error information as above)

My code:

#include <stdio.h>
#include <iostream>
#include <string>

#include "H5Cpp.h"
#include <H5File.h>
#include "hdf5.h"

#ifndef H5_NO_NAMESPACE
using namespace H5;
#endif

using namespace std;

int main(int argc, char* argv[])
{
            hid_t file_id = H5Fcreate("/home/tg2hpps/tg2hpps_main/src/packageHdf5/dsetddd.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);

            H5Fclose(file_id);
}

Thanks!

_______________________________________________

Hdf-forum is for HDF software users discussion.

Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>

http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Twitter: https://twitter.com/hdf5

_______________________________________________

Hdf-forum is for HDF software users discussion.

Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>

http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Twitter: https://twitter.com/hdf5