Commit c4e45f1c authored by Burlen Loring's avatar Burlen Loring

Merge branch 'sc18_vm' into 'master'

ADIOS DataAdaptor fixes for cell data

See merge request !142
parents f55fd832 58f61e82
if(ENABLE_ADIOS)
add_executable(ADIOSAnalysisEndPoint ADIOSAnalysisEndPoint.cxx)
target_link_libraries(ADIOSAnalysisEndPoint PRIVATE opts sensei timer sADIOS sMPI)
install(TARGETS ADIOSAnalysisEndPoint
RUNTIME DESTINATION bin)
endif()
......@@ -377,7 +377,6 @@ int ConfigurableAnalysis::InternalsType::AddAdios(pugi::xml_node node)
SENSEI_ERROR("ADIOS was requested but is disabled in this build")
return -1;
#else
auto adios = vtkSmartPointer<ADIOSAnalysisAdaptor>::New();
if (this->Comm != MPI_COMM_NULL)
......@@ -391,6 +390,14 @@ int ConfigurableAnalysis::InternalsType::AddAdios(pugi::xml_node node)
if (method)
adios->SetMethod(method.value());
DataRequirements req;
if (req.Initialize(node))
{
SENSEI_ERROR("Failed to initialize ADIOS.")
return -1;
}
adios->SetDataRequirements(req);
this->TimeInitialization(adios);
this->Analyses.push_back(adios.GetPointer());
......
......@@ -109,7 +109,8 @@ void MeshMetadata::SetArrayNames(int association,
{
if (association == vtkDataObject::POINT)
this->PointDataArrayNames.assign(arrayNames.begin(), arrayNames.end());
this->CellDataArrayNames.assign(arrayNames.begin(), arrayNames.end());
else if (association == vtkDataObject::CELL)
this->CellDataArrayNames.assign(arrayNames.begin(), arrayNames.end());
}
};
......
......@@ -56,13 +56,16 @@ def read_data(file_name, method):
# get a VTK dataset with all the arrays
ds = da.GetMesh(meshName, False)
# request each array
assocs = {vtk.VTK_POINT_DATA:'point', vtk.VTK_CELL_DATA:'cell'}
assocs = {vtk.vtkDataObject.POINT:'point', vtk.vtkDataObject.CELL:'cell'}
for assoc,assoc_name in assocs.iteritems():
n_arrays = da.GetNumberOfArrays(meshName, assoc)
status_message('%d %s arrays'%(n_arrays, assoc_name))
i = 0
while i < n_arrays:
array_name = da.GetArrayName(meshName, assoc, i)
da.AddArray(ds, meshName, assoc, array_name)
status_message('receive array %s'%(array_name))
i += 1
# this often will cause segv's if the dataset has been
# improperly constructed, thus serves as a good check
......@@ -80,7 +83,7 @@ def read_data(file_name, method):
j = 0
while j < n_arrays:
array = bds.GetPointData().GetArray(j) \
if assoc == vtk.VTK_POINT_DATA else \
if assoc == vtk.vtkDataObject.POINT else \
bds.GetCellData().GetArray(j)
if (check_array(array)):
error_message('Test failed on array %d "%s"'%( \
......
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