Commit b66ffc7b authored by kicici's avatar kicici

Warn about disabled HDF5 at runtime, not compile.

Maybe I don't want HDF5 at all. Still, print a warning every time you
run an HDF5-related function. It would make sense to remove the
functions completely, such that the user must disable the function calls
as well.
parent b5c66e09
......@@ -33,6 +33,15 @@ template <> inline hid_t get_hdf5_type<double>() { return H5T_NATIVE_DOUBLE; }
CUBISM_NAMESPACE_BEGIN
inline void _warn_no_hdf5(void) {
static bool first = true;
if (first) {
fprintf(stderr, "USE OF HDF WAS DISABLED AT COMPILE TIME\n");
first = false;
}
}
// The following requirements for the data TStreamer are required:
// TStreamer::NCHANNELS : Number of data elements (1=Scalar, 3=Vector, 9=Tensor)
// TStreamer::operate : Data access methods for read and write
......@@ -197,7 +206,7 @@ void DumpHDF5(const TGrid &grid,
fclose(xmf);
}
#else
#warning USE OF HDF WAS DISABLED AT COMPILE TIME
_warn_no_hdf5();
#endif
}
......@@ -276,7 +285,7 @@ void ReadHDF5(TGrid &grid, const std::string& fname, const std::string& dpath=".
delete [] array_all;
#else
#warning USE OF HDF WAS DISABLED AT COMPILE TIME
_warn_no_hdf5();
#endif
}
......
......@@ -233,7 +233,7 @@ void DumpHDF5_MPI(const TGrid &grid,
fclose(xmf);
}
#else
#warning USE OF HDF WAS DISABLED AT COMPILE TIME
_warn_no_hdf5();
#endif
}
......@@ -325,7 +325,7 @@ void ReadHDF5_MPI(TGrid &grid, const std::string& fname, const std::string& dpat
delete [] array_all;
#else
#warning USE OF HDF WAS DISABLED AT COMPILE TIME
_warn_no_hdf5();
#endif
}
......
......@@ -450,7 +450,7 @@ void DumpSliceHDF5(const TSlice& slice,
}
#else
#warning USE OF HDF WAS DISABLED AT COMPILE TIME
_warn_no_hdf5();
#endif
}
......
......@@ -280,7 +280,7 @@ void DumpSliceHDF5MPI(const TSlice& slice,
fclose(xmf);
}
#else
#warning USE OF HDF WAS DISABLED AT COMPILE TIME
_warn_no_hdf5();
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment