3
$\begingroup$

I'm running an experiment where I want to be able to save my data to HDF5 on a shared network drive on one computer (using python and h5py), and be able to read it and do analysis while it's running (and potentially saving more data to the file) with Mathematica on another computer. I know how to save a file in SWMR mode in python, but the example code for h5py shows that it also has to be opened in SWMR mode, and I can't find any such options for Mathematica.

Does anyone know the details of Mathematica's HDF5 implementation well enough to say whether this functionality is supported?

$\endgroup$
4
  • $\begingroup$ (EDIT: Just saw that you need 9.0. Unsure if this was implemented then) Do you know if HDF5Tools`HDF5OpenFile will work for you? From the PrintDefinitionsLocal it looks like the modes are the same as the ones here (i.e. RDONLY, RDWR, TRUNC) plus an EXCL mode I guess. The actual opener function is HDF5Tools`h5fopen which is a library function. $\endgroup$
    – b3m2a1
    Aug 1 '17 at 19:47
  • $\begingroup$ I'm not super familiar with Mathematica, but running Needs["HDF5Tools`"] returned Get::noopen: Cannot open HDF5Tools`. >> and Needs::nocont: Context HDF5Tools` was not created when Needs was evaluated. >>, which I guess means no? $\endgroup$
    – llama
    Aug 1 '17 at 20:06
  • $\begingroup$ Yeah I bet it wasn't in 9.0. So i'm not sure what sort of support there will be. $\endgroup$
    – b3m2a1
    Aug 1 '17 at 20:08
  • $\begingroup$ Ok, I guess I can just figure out a way to make a local copy with python or something. Thanks $\endgroup$
    – llama
    Aug 1 '17 at 20:10
4
$\begingroup$

From HDF5 User's Guide on SWMR mode:

The SWMR feature is available in HDF5 version 1.10.0 and later.

Since Mathematica 11.3 uses HDF5 1.8.16 there is no support for SWMR neither in 11.3 nor in any previous release.

$\endgroup$
2
  • $\begingroup$ +1, but how can you tell that Mathematica 11.3 uses HDF5 1.8.16? $\endgroup$
    – Szabolcs
    Jan 28 '19 at 13:40
  • 3
    $\begingroup$ @Szabolcs I work at Wolfram. I don't think there is a way to figure out the version by just inspecting Mathematica binaries or HDF5Tools paclet in particular. $\endgroup$
    – rafalc
    Jan 28 '19 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.