|
37 | 37 | #include "splash/core/DCHelper.hpp" |
38 | 38 | #include "splash/core/SDCHelper.hpp" |
39 | 39 | #include "splash/core/logging.hpp" |
| 40 | +#include "splash/basetypes/basetypes.hpp" |
40 | 41 |
|
41 | 42 | namespace splash |
42 | 43 | { |
@@ -428,6 +429,21 @@ namespace splash |
428 | 429 | Dimensions(0, 0, 0), sizeRead, ndims, data); |
429 | 430 | } |
430 | 431 |
|
| 432 | + CollectionType* SerialDataCollector::readMeta(int32_t id, |
| 433 | + const char* name, |
| 434 | + const Dimensions dstBuffer, |
| 435 | + const Dimensions dstOffset, |
| 436 | + Dimensions &sizeRead) |
| 437 | + throw (DCException) |
| 438 | + { |
| 439 | + if (fileStatus != FST_READING && fileStatus != FST_WRITING && fileStatus != FST_MERGING) |
| 440 | + throw DCException(getExceptionString("readMeta", "this access is not permitted")); |
| 441 | + |
| 442 | + uint32_t ndims = 0; |
| 443 | + return readDataSetMeta(handles.get(id), id, name, dstBuffer, dstOffset, |
| 444 | + Dimensions(0, 0, 0), sizeRead, ndims); |
| 445 | + } |
| 446 | + |
431 | 447 | void SerialDataCollector::write(int32_t id, const CollectionType& type, uint32_t ndims, |
432 | 448 | const Selection select, const char* name, const void* data) |
433 | 449 | throw (DCException) |
@@ -960,6 +976,40 @@ namespace splash |
960 | 976 | dataset.close(); |
961 | 977 | } |
962 | 978 |
|
| 979 | + CollectionType* SerialDataCollector::readDataSetMeta(H5Handle h5File, |
| 980 | + int32_t id, |
| 981 | + const char* name, |
| 982 | + const Dimensions dstBuffer, |
| 983 | + const Dimensions dstOffset, |
| 984 | + const Dimensions srcOffset, |
| 985 | + Dimensions &sizeRead, |
| 986 | + uint32_t& srcDims) |
| 987 | + throw (DCException) |
| 988 | + { |
| 989 | + log_msg(2, "readDataSetMeta"); |
| 990 | + |
| 991 | + std::string group_path, dset_name; |
| 992 | + DCDataSet::getFullDataPath(name, SDC_GROUP_DATA, id, group_path, dset_name); |
| 993 | + |
| 994 | + DCGroup group; |
| 995 | + group.open(h5File, group_path); |
| 996 | + |
| 997 | + DCDataSet dataset(dset_name.c_str()); |
| 998 | + dataset.open(group.getHandle()); |
| 999 | + |
| 1000 | + size_t entrySize; |
| 1001 | + getEntriesForID(id, NULL, &entrySize); |
| 1002 | + std::vector<DataCollector::DCEntry> entries(entrySize); |
| 1003 | + |
| 1004 | + getEntriesForID(id, &(*entries.begin()), NULL); |
| 1005 | + |
| 1006 | + Dimensions src_size(dataset.getSize() - srcOffset); |
| 1007 | + dataset.read(dstBuffer, dstOffset, src_size, srcOffset, sizeRead, srcDims, NULL); |
| 1008 | + dataset.close(); |
| 1009 | + |
| 1010 | + return entries[0].colType; |
| 1011 | + } |
| 1012 | + |
963 | 1013 | void SerialDataCollector::readSizeInternal(H5Handle h5File, |
964 | 1014 | int32_t id, |
965 | 1015 | const char* name, |
|
0 commit comments