2016-06-30 56 views
0

我有一个运行在集群中的程序实例,该程序基本上使用h5py执行读取和写入数值数组到HDF5文件的数值计算。HDF5文件中的节点损坏

当我尝试在集群中的不同计算节点上运行我的代码的几个实例时,所有正在运行的脚本只有一个崩溃。报告的错误是

KeyError: 'Unable to get link info (Bad symbol table node signature)'

幸存的脚本继续运行没有问题。我已经在与HDF5交谈的所有功能中使用了语句,以确保在完成I/O操作后文件已正确关闭。

有人请解释我这个错误的含义是什么?

+0

你试图在同一时间从多个进程的数据写入到一个HDF5文件? – ziky

+0

是的我想在同一个HDF5文件中写入来自多个进程的数据。我应该使用锁吗? – felipez

+0

我认为你不能同时从几个进程访问同一个hdf5文件。您只能使用MPI执行此操作,请参阅http://docs.h5py.org/en/latest/mpi.html。否则,请务必同时打开一个进程的文件。 – ziky

回答

0

根据书Python和HDF5安德鲁Collete,

multiprocessing is a more recent built-in module available with Python, which provides support for basic fork()-based parallel processing. The main restriction is that your parallel processes can’t share a single HDF5 file, even if the file is opened read- only. This is a limitation of the HDF5 library.....

For anything else, MPI-based Parallel HDF5 is by far the best way to go. MPI is the official “flavor” of parallelism supported by the HDF5 library. You can have an unlimited number of processes, all of which share the same open HDF5 file.