Fix ValueType error in pre-split data read

This commit is contained in:
Oliver Ruebel 2021-01-27 01:41:29 -08:00 committed by Gunther H. Weber
parent cea1173233
commit c9af28756c

@ -411,6 +411,7 @@ int main(int argc, char* argv[])
auto localBlockOriginsPortal = localBlockOrigins.WritePortal(); auto localBlockOriginsPortal = localBlockOrigins.WritePortal();
auto localBlockSizesPortal = localBlockSizes.WritePortal(); auto localBlockSizesPortal = localBlockSizes.WritePortal();
// Read the pre-split data files
if (preSplitFiles) if (preSplitFiles)
{ {
for (int blockNo = 0; blockNo < blocksPerRank; ++blockNo) for (int blockNo = 0; blockNo < blocksPerRank; ++blockNo)
@ -564,7 +565,7 @@ int main(int argc, char* argv[])
} }
// Read data // Read data
using ValueType = vtkm::FloatDefault; using ValueType = vtkm::Float64;
std::vector<ValueType> values(numVertices); std::vector<ValueType> values(numVertices);
if (filename.compare(filename.length() - 5, 5, ".bdem") == 0) if (filename.compare(filename.length() - 5, 5, ".bdem") == 0)
{ {
@ -669,13 +670,17 @@ int main(int argc, char* argv[])
<< " Number of dimensions: " << nDims << std::endl); << " Number of dimensions: " << nDims << std::endl);
} }
} }
// Read single-block data and split it for the ranks
else else
{ {
vtkm::cont::DataSet inDataSet; vtkm::cont::DataSet inDataSet;
using ValueType = vtkm::FloatDefault; // Currently FloatDefualt would be fine, but it could cause problems if we ever
// read binary files here.
using ValueType = vtkm::Float64;
std::vector<ValueType> values; std::vector<ValueType> values;
std::vector<vtkm::Id> dims; std::vector<vtkm::Id> dims;
// Read BOV data file
if (filename.compare(filename.length() - 3, 3, "bov") == 0) if (filename.compare(filename.length() - 3, 3, "bov") == 0)
{ {
std::cout << "Reading BOV file" << std::endl; std::cout << "Reading BOV file" << std::endl;
@ -703,7 +708,8 @@ int main(int argc, char* argv[])
vtkm::cont::ArrayCopy(tempFieldData.ResetTypes(vtkm::List<ValueType>{}), valuesHandle); vtkm::cont::ArrayCopy(tempFieldData.ResetTypes(vtkm::List<ValueType>{}), valuesHandle);
valuesHandle.SyncControlArray(); //Forces values to get updated if copy happened on GPU valuesHandle.SyncControlArray(); //Forces values to get updated if copy happened on GPU
} }
else // Read ASCII data input // Read ASCII data input
else
{ {
std::cout << "Reading ASCII file" << std::endl; std::cout << "Reading ASCII file" << std::endl;
std::ifstream inFile(filename); std::ifstream inFile(filename);