H5Pset_shared_mesg_nindexes fails with greater value than 8

As the following github example shows, the argument is limited to 0 - H5O_SHMESG_MAX_NINDEXES interval, missing from published documentation

int main() {
	char name[1024];
	hid_t fcpl_id, fd_id;
	herr_t err;
	unsigned N=9, nidx;

	fcpl_id =  H5Pcreate(H5P_FILE_CREATE);
	err = H5Pset_shared_mesg_nindexes( fcpl_id, N );
	fd_id = H5Fcreate("test.h5", H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT );
	H5Pget_shared_mesg_nindexes( fcpl_id, &nidx );
	printf("results: %i - %i = %i \n", N, nidx, H5O_SHMESG_MAX_NINDEXES);

	H5Pclose(fcpl_id);
	H5Fclose(fd_id);
}

#output of make test

cc main.c -lhdf5  -lz -ldl -lm -o set_shared_mesg_nindices	
./set_shared_mesg_nindices
HDF5-DIAG: Error detected in HDF5 (1.10.6) thread 0:
  #000: H5Pfcpl.c line 831 in H5Pset_shared_mesg_nindexes(): number of indexes is greater than H5O_SHMESG_MAX_NINDEXES
    major: Invalid arguments to routine
    minor: Out of range
results: 9 - 0 = 8

Documenting that N <= H5O_SHMESG_MAX_NINDEXES can help to prevent error message

1 Like

Like Schubert’s magnificent Symphony no. 9 the documentation is written in C (Major) and can be found in H5Opublic.h. :grinning:

As I’ll be writing test cases over the next few months, there possibly will be more of these minor hiccups; should I enter them directly to JIRA or report them here?

steve

Steven,

Thank you for reporting! Please go ahead and enter issues into Jira.

Elena

1 Like