Skip to content

Commit 55e658a

Browse files
committed
libSplash 1.7.0: readAttribute(Info)
refactor deprecated legacy attribute read API with new API. Reference: ComputationalRadiationPhysics/libSplash#248
1 parent 6efdac2 commit 55e658a

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

include/picongpu/plugins/hdf5/HDF5Writer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ class HDF5Writer :
448448

449449
/* load number of slides to initialize MovingWindow */
450450
uint32_t slides = 0;
451-
mThreadParams.dataCollector->readAttribute(restartStep, nullptr, "sim_slides", &slides);
451+
mThreadParams.dataCollector->readAttributeInfo(restartStep, nullptr, "sim_slides").read(&slides, sizeof(slides));
452452

453453
/* apply slides to set gpus to last/written configuration */
454454
log<picLog::INPUT_OUTPUT > ("HDF5 setting slide count for moving window to %1%") % slides;

include/picongpu/plugins/hdf5/NDScalars.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ struct ReadNDScalars
120120
if(!attrName.empty())
121121
{
122122
log<picLog::INPUT_OUTPUT>("HDF5: read attribute %1% for scalars: %2%") % attrName % name;
123-
params.dataCollector->readAttribute(params.currentStep, name.c_str(), attrName.c_str(), attribute);
123+
params.dataCollector->readAttributeInfo(params.currentStep, name.c_str(), attrName.c_str()).read(attribute, sizeof(T_Attribute));
124124
log<picLog::INPUT_OUTPUT>("HDF5: attribute %1% = %2%") % attrName % *attribute;
125125
}
126126
}

src/tools/splash2txt/tools_splash_parallel.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,7 @@ void ToolsSplashParallel::convertToText()
232232
DomainCollector::DomDataClass ref_data_class = DomainCollector::UndefinedType;
233233
try
234234
{
235-
dc.readAttribute(m_options.step, m_options.data[0].c_str(), DOMCOL_ATTR_CLASS,
236-
&ref_data_class, nullptr);
235+
dc.readAttributeInfo(m_options.step, m_options.data[0].c_str(), DOMCOL_ATTR_CLASS).read(&ref_data_class, sizeof(ref_data_class));
237236
} catch (const DCException&)
238237
{
239238
errorStream << "Error: No domain information for dataset '" << m_options.data[0] << "' available." << std::endl;
@@ -265,8 +264,7 @@ void ToolsSplashParallel::convertToText()
265264
//
266265

267266
DomainCollector::DomDataClass data_class = DomainCollector::UndefinedType;
268-
dc.readAttribute(m_options.step, iter->c_str(), DOMCOL_ATTR_CLASS,
269-
&data_class, nullptr);
267+
dc.readAttributeInfo(m_options.step, iter->c_str(), DOMCOL_ATTR_CLASS).read(&data_class, sizeof(data_class));
270268
if (data_class != ref_data_class)
271269
throw std::runtime_error("All requested datasets must be of the same data class");
272270

@@ -311,8 +309,7 @@ void ToolsSplashParallel::convertToText()
311309
{
312310
try
313311
{
314-
dc.readAttribute(m_options.step, iter->c_str(), "unitSI",
315-
&(excontainer.unit), nullptr);
312+
dc.readAttribute(m_options.step, iter->c_str(), "unitSI").read(&(excontainer.unit), sizeof(excontainer.unit));
316313
} catch (const DCException&)
317314
{
318315
if (m_options.verbose)

0 commit comments

Comments
 (0)