Skip to content

Write HDF5 Error for large matrix  #702

Open
@Goon83

Description

@Goon83

Hi All,
Hope you are doing well under current virus epidemic situation. I understand that you may have important things to do now. I just posted an error information here in case you can get chance to look into it.

Recently, I tested the function StoreHDF::write and found out that it works on small matrix but has issue for large array on multiple processes (CPU units). Below is the code:

using dash::io::hdf5::hdf5_options;
using dash::io::hdf5::StoreHDF;

#define N1 201
#define N2 15000
int main(int argc, char *argv[])
{
	dash::init(&argc, &argv);

	dash::Matrix<double, 2> *h5matrix = new dash::Matrix<double, 2>(dash::SizeSpec<2>(N1, N2));

	auto myid = dash::myid();

	if (!myid)
	{
		for (int i = 0; i < N1; i++)
		{
			for (int j = 0; j < N2; j++)
				h5matrix->at(i, j) = i + j;
		}
	}
	StoreHDF::write(*h5matrix, "testf.h5", "testg/testd2D");
	StoreHDF::read(*h5matrix, "testf.h5", "testg/testd2D");

	if (myid == 1)
	{
		for (int i = 0; i < N1; i++)
		{
			for (int j = 0; j < N2; j++)
			{
				double t = h5matrix->at(i, j);
				if (t != (i + j))
				{
					std::cout << "Wrong result \n";
					exit(-1);
				}
			}
		}
	}
	dash::finalize();

	return 0;
}

I compiled the code and ran it with 2 process, and it reports below error. Note that, if you change N1 and N2 in the code to small number, e.g, 10 by 10. It works.

>> mpirun  -n 2 ./h5-test
HDF5-DIAG: Error detected in HDF5 (1.10.5) MPI-process 1:
  #000: H5Dio.c line 322 in H5Dwrite(): could not get a validated dataspace from file_space_id
    major: Invalid arguments to routine
    minor: Bad value
  #001: H5S.c line 254 in H5S_get_validated_dataspace(): selection + offset not within extent
    major: Dataspace
    minor: Out of range
^C[mpiexec@dbinMac] Sending Ctrl-C to processes as requested
[mpiexec@dbinMac] Press Ctrl-C again to force abort

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions