[NeXus-tech] NeXus API and large arrays

Peterson, Peter F. petersonpf at ornl.gov
Mon Oct 17 14:30:07 BST 2011


Why wouldn't you just overload the existing functions with the versions that take hsize_t (or int64_t) as their type? If somebody calls these functions with something ambiguous the compiler will complain and they will have to cast in order to resolve it.

P^2

On Oct 17, 2011, at 6:20 AM, <freddie.akeroyd at stfc.ac.uk> wrote:

> Hi,
> 
> We have managed to create a rather large (>2 billion elements) one dimensional array on one of our instruments - this has caused issues with the NeXus API as the functions dealing with array dimensions are all signed 32bit integers. I have worked around this in the local implementation, but was wondering if some additions to the NeXus API would be the best solution for the future (in this particular case I intend to try and split data before it gets to this point in future, but I'm sure a similar situation could arise again elsewhere)
> 
> HDF5 uses hsize_t internally for array dimension, which is an unsigned 64bit type - my suggestion is that we create a set of new NeXus API functions handling "int64_t" dimensions (I suggest this rather than uint64_t as NX_UNLIMITED is -1 and I'm always a little cautious about casting negative numbers to unsigned). As for naming these functions, how about adding "64" to the end of the function name?
> 
> The main functions that would need adding are:
> 
> NXputslab64
> NXgetslab64
> NXgetinfo64
> NXgetrawinfo64
> 
> The following should probably be added too for completeness:
> NXmakedata64
> NXcompmakedata64
> NXmalloc64
> 
> Regards,
> 
> Freddie
> 
> -- 
> Scanned by iCritical.
> 
> _______________________________________________
> NeXus-tech mailing list
> NeXus-tech at nexusformat.org
> hxxp://lists.nexusformat.org/mailman/listinfo/nexus-tech




More information about the NeXus-tech mailing list