Commit a72f4007 authored by Andrew J. Burns (Cont's avatar Andrew J. Burns (Cont

Formatting changes and removing warnings

parent 03e031e0
...@@ -54,7 +54,7 @@ XdmfGraph::getItemTag() const ...@@ -54,7 +54,7 @@ XdmfGraph::getItemTag() const
unsigned int unsigned int
XdmfGraph::getNumberNodes() const XdmfGraph::getNumberNodes() const
{ {
//The number of nodes is equal to the number of rows or columns. Either will work. // The number of nodes is equal to the number of rows or columns. Either will work.
return this->getNumberRows(); return this->getNumberRows();
} }
......
...@@ -219,19 +219,18 @@ XdmfMap::populateItem(const std::map<std::string, std::string> & itemProperties, ...@@ -219,19 +219,18 @@ XdmfMap::populateItem(const std::map<std::string, std::string> & itemProperties,
} }
else { else {
//this needs to be changed to account for controllers being a vector now
mRemoteTaskIdsControllers.clear(); mRemoteTaskIdsControllers.clear();
for (unsigned int i = 0; i < arrayVector[0]->getNumberHeavyDataControllers(); i++) for (unsigned int i = 0; i < arrayVector[0]->getNumberHeavyDataControllers(); ++i)
{ {
mRemoteTaskIdsControllers.push_back(arrayVector[0]->getHeavyDataController(i)); mRemoteTaskIdsControllers.push_back(arrayVector[0]->getHeavyDataController(i));
} }
mLocalNodeIdsControllers.clear(); mLocalNodeIdsControllers.clear();
for (unsigned int i = 0; i < arrayVector[1]->getNumberHeavyDataControllers(); i++) for (unsigned int i = 0; i < arrayVector[1]->getNumberHeavyDataControllers(); ++i)
{ {
mLocalNodeIdsControllers.push_back(arrayVector[1]->getHeavyDataController(i)); mLocalNodeIdsControllers.push_back(arrayVector[1]->getHeavyDataController(i));
} }
mRemoteLocalNodeIdsControllers.clear(); mRemoteLocalNodeIdsControllers.clear();
for (unsigned int i = 0; i < arrayVector[2]->getNumberHeavyDataControllers(); i++) for (unsigned int i = 0; i < arrayVector[2]->getNumberHeavyDataControllers(); ++i)
{ {
mRemoteLocalNodeIdsControllers.push_back(arrayVector[2]->getHeavyDataController(i)); mRemoteLocalNodeIdsControllers.push_back(arrayVector[2]->getHeavyDataController(i));
} }
...@@ -247,17 +246,17 @@ XdmfMap::read() ...@@ -247,17 +246,17 @@ XdmfMap::read()
mRemoteLocalNodeIdsControllers.size() > 0) { mRemoteLocalNodeIdsControllers.size() > 0) {
unsigned int localNodeCount = 0; unsigned int localNodeCount = 0;
for (unsigned int i = 0; i< mLocalNodeIdsControllers.size(); i++) for (unsigned int i = 0; i< mLocalNodeIdsControllers.size(); ++i)
{ {
localNodeCount += mLocalNodeIdsControllers[i]->getSize(); localNodeCount += mLocalNodeIdsControllers[i]->getSize();
} }
unsigned int remoteTaskCount = 0; unsigned int remoteTaskCount = 0;
for (unsigned int i = 0; i< mRemoteTaskIdsControllers.size(); i++) for (unsigned int i = 0; i< mRemoteTaskIdsControllers.size(); ++i)
{ {
remoteTaskCount += mRemoteTaskIdsControllers[i]->getSize(); remoteTaskCount += mRemoteTaskIdsControllers[i]->getSize();
} }
unsigned int remoteNodeCount = 0; unsigned int remoteNodeCount = 0;
for (unsigned int i = 0; i< mRemoteLocalNodeIdsControllers.size(); i++) for (unsigned int i = 0; i< mRemoteLocalNodeIdsControllers.size(); ++i)
{ {
remoteNodeCount += mRemoteLocalNodeIdsControllers[i]->getSize(); remoteNodeCount += mRemoteLocalNodeIdsControllers[i]->getSize();
} }
...@@ -280,21 +279,21 @@ XdmfMap::read() ...@@ -280,21 +279,21 @@ XdmfMap::read()
shared_ptr<XdmfArray> remoteLocalNodeIds = XdmfArray::New(); shared_ptr<XdmfArray> remoteLocalNodeIds = XdmfArray::New();
mRemoteTaskIdsControllers[0]->read(remoteTaskIds.get()); mRemoteTaskIdsControllers[0]->read(remoteTaskIds.get());
for (unsigned int i = 1; i < mRemoteTaskIdsControllers.size(); i++) for (unsigned int i = 1; i < mRemoteTaskIdsControllers.size(); ++i)
{ {
shared_ptr<XdmfArray> tempArray = XdmfArray::New(); shared_ptr<XdmfArray> tempArray = XdmfArray::New();
mRemoteTaskIdsControllers[i]->read(tempArray.get()); mRemoteTaskIdsControllers[i]->read(tempArray.get());
remoteTaskIds->insert(remoteTaskIds->getSize(), tempArray, 0, tempArray->getSize()); remoteTaskIds->insert(remoteTaskIds->getSize(), tempArray, 0, tempArray->getSize());
} }
mLocalNodeIdsControllers[0]->read(localNodeIds.get()); mLocalNodeIdsControllers[0]->read(localNodeIds.get());
for (unsigned int i = 1; i < mLocalNodeIdsControllers.size(); i++) for (unsigned int i = 1; i < mLocalNodeIdsControllers.size(); ++i)
{ {
shared_ptr<XdmfArray> tempArray = XdmfArray::New(); shared_ptr<XdmfArray> tempArray = XdmfArray::New();
mLocalNodeIdsControllers[i]->read(tempArray.get()); mLocalNodeIdsControllers[i]->read(tempArray.get());
localNodeIds->insert(localNodeIds->getSize(), tempArray, 0, tempArray->getSize()); localNodeIds->insert(localNodeIds->getSize(), tempArray, 0, tempArray->getSize());
} }
mRemoteLocalNodeIdsControllers[0]->read(remoteLocalNodeIds.get()); mRemoteLocalNodeIdsControllers[0]->read(remoteLocalNodeIds.get());
for (unsigned int i = 1; i < mRemoteLocalNodeIdsControllers.size(); i++) for (unsigned int i = 1; i < mRemoteLocalNodeIdsControllers.size(); ++i)
{ {
shared_ptr<XdmfArray> tempArray = XdmfArray::New(); shared_ptr<XdmfArray> tempArray = XdmfArray::New();
mRemoteLocalNodeIdsControllers[i]->read(tempArray.get()); mRemoteLocalNodeIdsControllers[i]->read(tempArray.get());
...@@ -324,17 +323,17 @@ XdmfMap::setHeavyDataControllers(std::vector<shared_ptr<XdmfHeavyDataController> ...@@ -324,17 +323,17 @@ XdmfMap::setHeavyDataControllers(std::vector<shared_ptr<XdmfHeavyDataController>
std::vector<shared_ptr<XdmfHeavyDataController> > remoteLocalNodeIdsControllers) std::vector<shared_ptr<XdmfHeavyDataController> > remoteLocalNodeIdsControllers)
{ {
unsigned int localNodeCount = 0; unsigned int localNodeCount = 0;
for (unsigned int i = 0; i< localNodeIdsControllers.size(); i++) for (unsigned int i = 0; i< localNodeIdsControllers.size(); ++i)
{ {
localNodeCount += localNodeIdsControllers[i]->getSize(); localNodeCount += localNodeIdsControllers[i]->getSize();
} }
unsigned int remoteTaskCount = 0; unsigned int remoteTaskCount = 0;
for (unsigned int i = 0; i< remoteTaskIdsControllers.size(); i++) for (unsigned int i = 0; i< remoteTaskIdsControllers.size(); ++i)
{ {
remoteTaskCount += remoteTaskIdsControllers[i]->getSize(); remoteTaskCount += remoteTaskIdsControllers[i]->getSize();
} }
unsigned int remoteNodeCount = 0; unsigned int remoteNodeCount = 0;
for (unsigned int i = 0; i< remoteLocalNodeIdsControllers.size(); i++) for (unsigned int i = 0; i< remoteLocalNodeIdsControllers.size(); ++i)
{ {
remoteNodeCount += remoteLocalNodeIdsControllers[i]->getSize(); remoteNodeCount += remoteLocalNodeIdsControllers[i]->getSize();
} }
...@@ -396,15 +395,15 @@ XdmfMap::traverse(const shared_ptr<XdmfBaseVisitor> visitor) ...@@ -396,15 +395,15 @@ XdmfMap::traverse(const shared_ptr<XdmfBaseVisitor> visitor)
} }
} }
for (unsigned int i = 0; i < mRemoteTaskIdsControllers.size(); i++) for (unsigned int i = 0; i < mRemoteTaskIdsControllers.size(); ++i)
{ {
remoteTaskIds->insert(mRemoteTaskIdsControllers[i]); remoteTaskIds->insert(mRemoteTaskIdsControllers[i]);
} }
for (unsigned int i = 0; i < mLocalNodeIdsControllers.size(); i++) for (unsigned int i = 0; i < mLocalNodeIdsControllers.size(); ++i)
{ {
localNodeIds->insert(mLocalNodeIdsControllers[i]); localNodeIds->insert(mLocalNodeIdsControllers[i]);
} }
for (unsigned int i = 0; i < mRemoteLocalNodeIdsControllers.size(); i++) for (unsigned int i = 0; i < mRemoteLocalNodeIdsControllers.size(); ++i)
{ {
remoteLocalNodeIds->insert(mRemoteLocalNodeIdsControllers[i]); remoteLocalNodeIds->insert(mRemoteLocalNodeIdsControllers[i]);
} }
...@@ -417,15 +416,15 @@ XdmfMap::traverse(const shared_ptr<XdmfBaseVisitor> visitor) ...@@ -417,15 +416,15 @@ XdmfMap::traverse(const shared_ptr<XdmfBaseVisitor> visitor)
mRemoteTaskIdsControllers.clear(); mRemoteTaskIdsControllers.clear();
mRemoteLocalNodeIdsControllers.clear(); mRemoteLocalNodeIdsControllers.clear();
for (unsigned int i = 0; i < remoteTaskIds->getNumberHeavyDataControllers(); i++) for (unsigned int i = 0; i < remoteTaskIds->getNumberHeavyDataControllers(); ++i)
{ {
mRemoteTaskIdsControllers.push_back(remoteTaskIds->getHeavyDataController(i)); mRemoteTaskIdsControllers.push_back(remoteTaskIds->getHeavyDataController(i));
} }
for (unsigned int i = 0; i < localNodeIds->getNumberHeavyDataControllers(); i++) for (unsigned int i = 0; i < localNodeIds->getNumberHeavyDataControllers(); ++i)
{ {
mLocalNodeIdsControllers.push_back(localNodeIds->getHeavyDataController(i)); mLocalNodeIdsControllers.push_back(localNodeIds->getHeavyDataController(i));
} }
for (unsigned int i = 0; i < remoteLocalNodeIds->getNumberHeavyDataControllers(); i++) for (unsigned int i = 0; i < remoteLocalNodeIds->getNumberHeavyDataControllers(); ++i)
{ {
mRemoteLocalNodeIdsControllers.push_back(remoteLocalNodeIds->getHeavyDataController(i)); mRemoteLocalNodeIdsControllers.push_back(remoteLocalNodeIds->getHeavyDataController(i));
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -950,6 +950,7 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i ...@@ -950,6 +950,7 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
%include XdmfItem.hpp %include XdmfItem.hpp
%include XdmfItemProperty.hpp %include XdmfItemProperty.hpp
%include XdmfSparseMatrix.hpp %include XdmfSparseMatrix.hpp
%include XdmfSystemUtils.hpp
%include XdmfVisitor.hpp %include XdmfVisitor.hpp
%include XdmfHeavyDataController.hpp %include XdmfHeavyDataController.hpp
%include XdmfHeavyDataWriter.hpp %include XdmfHeavyDataWriter.hpp
......
This diff is collapsed.
...@@ -68,8 +68,8 @@ XdmfError::setBuffer(std::streambuf* buf) ...@@ -68,8 +68,8 @@ XdmfError::setBuffer(std::streambuf* buf)
*** Private Static Functions *** *** Private Static Functions ***
********************************/ ********************************/
//automatically writes the message to the provided buffer // automatically writes the message to the provided buffer
//by default this is basically a print statement // by default this is basically a print statement
void void
XdmfError::WriteToStream(std::string msg) XdmfError::WriteToStream(std::string msg)
{ {
......
This diff is collapsed.
...@@ -202,8 +202,8 @@ XdmfSparseMatrix::populateItem(const std::map<std::string, std::string> & itemPr ...@@ -202,8 +202,8 @@ XdmfSparseMatrix::populateItem(const std::map<std::string, std::string> & itemPr
} }
if(arrayVector.size() < 3) { if(arrayVector.size() < 3) {
//The three required arrays are for the row pointer, column index, and the contained values. // The three required arrays are for the row pointer, column index, and the contained values.
//Without these arrays the object can't be properly built. // Without these arrays the object can't be properly built.
try { try {
XdmfError::message(XdmfError::FATAL, XdmfError::message(XdmfError::FATAL,
"Expected 3 arrays attached to " "Expected 3 arrays attached to "
......
...@@ -73,6 +73,7 @@ public: ...@@ -73,6 +73,7 @@ public:
{ {
mXPath.clear(); mXPath.clear();
//this section writes to file
std::ofstream fileStream; std::ofstream fileStream;
if(!mStream) { if(!mStream) {
fileStream.open(mXMLFilePath.c_str()); fileStream.open(mXMLFilePath.c_str());
...@@ -96,7 +97,7 @@ public: ...@@ -96,7 +97,7 @@ public:
xmlFreeDoc(mXMLDocument); xmlFreeDoc(mXMLDocument);
xmlCleanupParser(); xmlCleanupParser();
if(mHeavyDataWriter->getMode() == XdmfHeavyDataWriter::Default) { if(mHeavyDataWriter->getMode() == XdmfHeavyDataWriter::Default) {
mHeavyDataWriter->closeFile(); mHeavyDataWriter->closeFile();
} }
...@@ -285,6 +286,7 @@ XdmfWriter::visit(XdmfArray & array, ...@@ -285,6 +286,7 @@ XdmfWriter::visit(XdmfArray & array,
const bool isSubclassed = const bool isSubclassed =
array.getItemTag().compare(XdmfArray::ItemTag) != 0; array.getItemTag().compare(XdmfArray::ItemTag) != 0;
if(isSubclassed) { if(isSubclassed) {
try { try {
this->visit(dynamic_cast<XdmfItem &>(array), visitor); this->visit(dynamic_cast<XdmfItem &>(array), visitor);
...@@ -294,10 +296,10 @@ XdmfWriter::visit(XdmfArray & array, ...@@ -294,10 +296,10 @@ XdmfWriter::visit(XdmfArray & array,
} }
} }
if(array.getSize() > 0 && !(mImpl->mLastXPathed && isSubclassed)) { if(array.getSize() > 0 && !(mImpl->mLastXPathed && isSubclassed)) {
std::vector<std::string> xmlTextValues; std::vector<std::string> xmlTextValues;
//adjust for multifile write
// Take care of writing to single heavy data file (Default behavior) // Take care of writing to single heavy data file (Default behavior)
if(!array.isInitialized() && array.getHeavyDataController(0) && if(!array.isInitialized() && array.getHeavyDataController(0) &&
array.getHeavyDataController(0)->getFilePath().compare(mImpl->mHeavyDataWriter->getFilePath()) != 0 && array.getHeavyDataController(0)->getFilePath().compare(mImpl->mHeavyDataWriter->getFilePath()) != 0 &&
...@@ -307,36 +309,42 @@ XdmfWriter::visit(XdmfArray & array, ...@@ -307,36 +309,42 @@ XdmfWriter::visit(XdmfArray & array,
if(array.getHeavyDataController(0) || if(array.getHeavyDataController(0) ||
array.getSize() > mImpl->mLightDataLimit) { array.getSize() > mImpl->mLightDataLimit) {
//this case is for if the data is smaller than the limit
//create case for when data is over the limit
// Write values to heavy data // Write values to heavy data
try {
try {// this takes about half the time needed
mImpl->mHeavyDataWriter->visit(array, mImpl->mHeavyDataWriter); mImpl->mHeavyDataWriter->visit(array, mImpl->mHeavyDataWriter);
} }
catch (XdmfError e) { catch (XdmfError e) {
throw e; throw e;
} }
std::stringstream valuesStream; std::stringstream valuesStream;
for(unsigned int i = 0; i < array.getNumberHeavyDataControllers(); i++) { for(unsigned int i = 0; i < array.getNumberHeavyDataControllers(); ++i) {
std::string heavyDataPath = std::string heavyDataPath =
array.getHeavyDataController(i)->getFilePath(); array.getHeavyDataController(i)->getFilePath();
size_t index = heavyDataPath.find_last_of("/\\"); size_t index = heavyDataPath.find_last_of("/\\");
if(index != std::string::npos) {//if path is not a folder if(index != std::string::npos) {
const std::string heavyDataDir = heavyDataPath.substr(0, index + 1);//put the directory path into this variable // if path is not a folder
if(mImpl->mXMLFilePath.find(heavyDataDir) == 0) {//if the directory is in the XML File Path // put the directory path into this variable
const std::string heavyDataDir = heavyDataPath.substr(0, index + 1);
// if the directory is in the XML File Path
if(mImpl->mXMLFilePath.find(heavyDataDir) == 0) {
heavyDataPath = heavyDataPath =
heavyDataPath.substr(heavyDataDir.size(), heavyDataPath.substr(heavyDataDir.size(),
heavyDataPath.size() - heavyDataDir.size());//pull the file off of the end and place it in the DataPath heavyDataPath.size() - heavyDataDir.size());
}//otherwise the full path is required // pull the file off of the end and place it in the DataPath
}
// otherwise the full path is required
} }
std::stringstream dimensionStream; std::stringstream dimensionStream;
for (unsigned int j = 0; j < array.getHeavyDataController(i)->getDimensions().size(); j++) { for (unsigned int j = 0; j < array.getHeavyDataController(i)->getDimensions().size(); ++j) {
dimensionStream << array.getHeavyDataController(i)->getDimensions()[j]; dimensionStream << array.getHeavyDataController(i)->getDimensions()[j];
if (j < array.getHeavyDataController(i)->getDimensions().size() - 1) { if (j < array.getHeavyDataController(i)->getDimensions().size() - 1) {
dimensionStream << " "; dimensionStream << " ";
} }
} }
valuesStream.str(std::string());//clear the stream // clear the stream
valuesStream.str(std::string());
if (array.getNumberHeavyDataControllers() > 1) { if (array.getNumberHeavyDataControllers() > 1) {
valuesStream << heavyDataPath << ":" valuesStream << heavyDataPath << ":"
<< array.getHeavyDataController(i)->getDataSetPath() << array.getHeavyDataController(i)->getDataSetPath()
...@@ -366,7 +374,7 @@ XdmfWriter::visit(XdmfArray & array, ...@@ -366,7 +374,7 @@ XdmfWriter::visit(XdmfArray & array,
array.swap(arrayToWrite); array.swap(arrayToWrite);
mImpl->mXMLCurrentNode = mImpl->mXMLCurrentNode->last; mImpl->mXMLCurrentNode = mImpl->mXMLCurrentNode->last;
this->visit(dynamic_cast<XdmfItem &>(*arrayToWrite.get()), visitor); this->visit(dynamic_cast<XdmfItem &>(*arrayToWrite.get()), visitor);
for(unsigned int i = 0; i<xmlTextValues.size(); i++) { for(unsigned int i = 0; i<xmlTextValues.size(); ++i) {
xmlAddChild(mImpl->mXMLCurrentNode->last, xmlAddChild(mImpl->mXMLCurrentNode->last,
xmlNewText((xmlChar*)xmlTextValues[i].c_str())); xmlNewText((xmlChar*)xmlTextValues[i].c_str()));
} }
...@@ -375,7 +383,7 @@ XdmfWriter::visit(XdmfArray & array, ...@@ -375,7 +383,7 @@ XdmfWriter::visit(XdmfArray & array,
} }
else { else {
this->visit(dynamic_cast<XdmfItem &>(array), visitor); this->visit(dynamic_cast<XdmfItem &>(array), visitor);
for(unsigned int i = 0; i<xmlTextValues.size(); i++) { for(unsigned int i = 0; i<xmlTextValues.size(); ++i) {
xmlAddChild(mImpl->mXMLCurrentNode->last, xmlAddChild(mImpl->mXMLCurrentNode->last,
xmlNewText((xmlChar*)xmlTextValues[i].c_str())); xmlNewText((xmlChar*)xmlTextValues[i].c_str()));
} }
...@@ -415,7 +423,7 @@ XdmfWriter::visit(XdmfItem & item, ...@@ -415,7 +423,7 @@ XdmfWriter::visit(XdmfItem & item,
XdmfInformation & xpathinfo = dynamic_cast<XdmfInformation &>(item); XdmfInformation & xpathinfo = dynamic_cast<XdmfInformation &>(item);
if (xpathinfo.getKey() == "XIncludes") { if (xpathinfo.getKey() == "XIncludes") {
shared_ptr<XdmfInformation> outputinfo; shared_ptr<XdmfInformation> outputinfo;
for (unsigned int i = 0; i < xpathinfo.getNumberInformations(); i++) { for (unsigned int i = 0; i < xpathinfo.getNumberInformations(); ++i) {
mImpl->mXPathCount++; mImpl->mXPathCount++;
outputinfo = xpathinfo.getInformation(i); outputinfo = xpathinfo.getInformation(i);
mImpl->mXMLCurrentNode = xmlNewChild(mImpl->mXMLCurrentNode, mImpl->mXMLCurrentNode = xmlNewChild(mImpl->mXMLCurrentNode,
...@@ -509,6 +517,7 @@ XdmfWriter::visit(XdmfItem & item, ...@@ -509,6 +517,7 @@ XdmfWriter::visit(XdmfItem & item,
} }
else { else {
// Not inserted before --- need to write all data and traverse. // Not inserted before --- need to write all data and traverse.
mImpl->mXMLCurrentNode = xmlNewChild(mImpl->mXMLCurrentNode, mImpl->mXMLCurrentNode = xmlNewChild(mImpl->mXMLCurrentNode,
NULL, NULL,
(xmlChar *)tag.c_str(), (xmlChar *)tag.c_str(),
......
...@@ -50,7 +50,7 @@ int main(int, char **) ...@@ -50,7 +50,7 @@ int main(int, char **)
catch (XdmfError e) catch (XdmfError e)
{ {
//a print statement is redundant since the error message is sent to cout //a print statement is redundant since the error message is sent to cout
//printf("The error message is:\n%s\n", e.what()); //std::cout << "The error message is:\n" << e.what() << std::endl;
} }
return 0; return 0;
......
...@@ -189,7 +189,7 @@ int main(int, char **) ...@@ -189,7 +189,7 @@ int main(int, char **)
dimensionVector.push_back(5); dimensionVector.push_back(5);
dimensionVector.push_back(4); dimensionVector.push_back(4);
writtenArray->initialize<int>(dimensionVector); writtenArray->initialize<int>(dimensionVector);
for (int i = 0; i < 20; i++) for (int i = 0; i < 20; ++i)
{ {
writtenArray->insert(i, i + 1); writtenArray->insert(i, i + 1);
} }
...@@ -234,9 +234,9 @@ shared_ptr<XdmfArray> maximum(std::vector<shared_ptr<XdmfArray> > values) ...@@ -234,9 +234,9 @@ shared_ptr<XdmfArray> maximum(std::vector<shared_ptr<XdmfArray> > values)
else else
{ {
double maxVal = values[0]->getValue<double>(0); double maxVal = values[0]->getValue<double>(0);
for (int i = 0; i < values.size(); i++) for (int i = 0; i < values.size(); ++i)
{ {
for (int j = 0; j < values[i]->getSize(); j++) for (int j = 0; j < values[i]->getSize(); ++j)
{ {
if (maxVal < values[i]->getValue<double>(j)) if (maxVal < values[i]->getValue<double>(j))
{ {
......
This diff is collapsed.
...@@ -36,7 +36,7 @@ int main(int argc, char *argv[]) ...@@ -36,7 +36,7 @@ int main(int argc, char *argv[])
shared_ptr<XdmfArray> testArray = XdmfArray::New(); shared_ptr<XdmfArray> testArray = XdmfArray::New();
for (unsigned int i = 1; i <= 4; i++) for (unsigned int i = 1; i <= 4; ++i)
{ {
testArray->pushBack(i*id); testArray->pushBack(i*id);
} }
...@@ -95,7 +95,7 @@ int main(int argc, char *argv[]) ...@@ -95,7 +95,7 @@ int main(int argc, char *argv[])
testArray->insert(writeController); testArray->insert(writeController);
for (unsigned int i = 0; i<size; i++) for (unsigned int i = 0; i<size; ++i)
{ {
MPI_Barrier(comm); MPI_Barrier(comm);
if (i == id) if (i == id)
...@@ -106,26 +106,26 @@ int main(int argc, char *argv[]) ...@@ -106,26 +106,26 @@ int main(int argc, char *argv[])
std::cout << "filepath = " << testArray->getHeavyDataController(0)->getFilePath() << std::endl; std::cout << "filepath = " << testArray->getHeavyDataController(0)->getFilePath() << std::endl;
outputVector = testArray->getHeavyDataController(0)->getDataspaceDimensions(); outputVector = testArray->getHeavyDataController(0)->getDataspaceDimensions();
std::cout << "Data space dimensions" << std::endl; std::cout << "Data space dimensions" << std::endl;
for (int j=0; j<outputVector.size(); j++) for (int j=0; j<outputVector.size(); ++j)
{ {
std::cout << "[" << j << "] =" << outputVector[j] << std::endl; std::cout << "[" << j << "] =" << outputVector[j] << std::endl;
} }
std::cout << "Controller Dimensions" << std::endl; std::cout << "Controller Dimensions" << std::endl;
outputVector = testArray->getHeavyDataController(0)->getDimensions(); outputVector = testArray->getHeavyDataController(0)->getDimensions();
for (int j=0; j<outputVector.size(); j++) for (int j=0; j<outputVector.size(); ++j)
{ {
std::cout << "[" << j << "] =" << outputVector[j] << std::endl; std::cout << "[" << j << "] =" << outputVector[j] << std::endl;
} }
std::cout << "Controller size" << testArray->getHeavyDataController(0)->getSize() << std::endl; std::cout << "Controller size" << testArray->getHeavyDataController(0)->getSize() << std::endl;
std::cout << "Controller starts" << std::endl; std::cout << "Controller starts" << std::endl;
outputVector = testArray->getHeavyDataController(0)->getStart(); outputVector = testArray->getHeavyDataController(0)->getStart();
for (int j=0; j<outputVector.size(); j++) for (int j=0; j<outputVector.size(); ++j)
{ {
std::cout << "[" << j << "] =" << outputVector[j] << std::endl; std::cout << "[" << j << "] =" << outputVector[j] << std::endl;
} }
std::cout << "Controller strides" << std::endl; std::cout << "Controller strides" << std::endl;
outputVector = testArray->getHeavyDataController(0)->getStride(); outputVector = testArray->getHeavyDataController(0)->getStride();
for (int j=0; j<outputVector.size(); j++) for (int j=0; j<outputVector.size(); ++j)
{ {
std::cout << "[" << j << "] =" << outputVector[j] << "\n" << std::endl; std::cout << "[" << j << "] =" << outputVector[j] << "\n" << std::endl;
} }
...@@ -169,7 +169,7 @@ int main(int argc, char *argv[]) ...@@ -169,7 +169,7 @@ int main(int argc, char *argv[])
std::cout << "done testing read" << std::endl; std::cout << "done testing read" << std::endl;
for (unsigned int i = 0; i<size; i++) for (unsigned int i = 0; i<size; ++i)
{ {
MPI_Barrier(comm); MPI_Barrier(comm);
if (i == id) if (i == id)
...@@ -180,26 +180,26 @@ int main(int argc, char *argv[]) ...@@ -180,26 +180,26 @@ int main(int argc, char *argv[])
std::cout << "filepath = " << readArray->getHeavyDataController(0)->getFilePath() << std::endl; std::cout << "filepath = " << readArray->getHeavyDataController(0)->getFilePath() << std::endl;
outputVector = readArray->getHeavyDataController(0)->getDataspaceDimensions(); outputVector = readArray->getHeavyDataController(0)->getDataspaceDimensions();
std::cout << "Data space dimensions" << std::endl; std::cout << "Data space dimensions" << std::endl;
for (int j=0; j<outputVector.size(); j++) for (int j=0; j<outputVector.size(); ++j)
{ {
std::cout << "[" << j << "] =" << outputVector[j] << std::endl; std::cout << "[" << j << "] =" << outputVector[j] << std::endl;
} }
std::cout << "Controller Dimensions" << std::endl; std::cout << "Controller Dimensions" << std::endl;
outputVector = readArray->getHeavyDataController(0)->getDimensions(); outputVector = readArray->getHeavyDataController(0)->getDimensions();
for (int j=0; j<outputVector.size(); j++) for (int j=0; j<outputVector.size(); ++j)
{ {
std::cout << "[" << j << "] =" << outputVector[j] << std::endl; std::cout << "[" << j << "] =" << outputVector[j] << std::endl;
} }
std::cout << "Controller size" << readArray->getHeavyDataController(0)->getSize() << std::endl; std::cout << "Controller size" << readArray->getHeavyDataController(0)->getSize() << std::endl;
std::cout << "Controller starts" << std::endl; std::cout << "Controller starts" << std::endl;
outputVector = readArray->getHeavyDataController(0)->getStart(); outputVector = readArray->getHeavyDataController(0)->getStart();
for (int j=0; j<outputVector.size(); j++) for (int j=0; j<outputVector.size(); ++j)
{ {
std::cout << "[" << j << "] =" << outputVector[j] << std::endl; std::cout << "[" << j << "] =" << outputVector[j] << std::endl;
} }
std::cout << "Controller strides" << std::endl; std::cout << "Controller strides" << std::endl;
outputVector = readArray->getHeavyDataController(0)->getStride(); outputVector = readArray->getHeavyDataController(0)->getStride();
for (int j=0; j<outputVector.size(); j++) for (int j=0; j<outputVector.size(); ++j)
{ {
std::cout << "[" << j << "] =" << outputVector[j] << "\n" << std::endl; std::cout << "[" << j << "] =" << outputVector[j] << "\n" << std::endl;
} }
......
...@@ -190,7 +190,7 @@ int main(int, char **) ...@@ -190,7 +190,7 @@ int main(int, char **)
/* /*
the version of XdmfMap::New() used here returns a number of maps equal to the number of attributes it was provided with. the version of XdmfMap::New() used here returns a number of maps equal to the number of attributes it was provided with.
*/ */
for (int i = 0; i<mapcollection.size(); i++) for (int i = 0; i<mapcollection.size(); ++i)
{ {
gridHolder->insert(mapcollection[i]); gridHolder->insert(mapcollection[i]);
} }
...@@ -226,14 +226,14 @@ int main(int, char **) ...@@ -226,14 +226,14 @@ int main(int, char **)
primaryDomain->accept(exampleWriter); primaryDomain->accept(exampleWriter);
exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Append); exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Append);
for (int i = 0; i <= 408; i++) for (int i = 0; i <= 408; ++i)
{//overflow occurs a little after the end of this loop {//overflow occurs a little after the end of this loop
primaryDomain->accept(exampleHeavyWriter); primaryDomain->accept(exampleHeavyWriter);
} }
exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Default); exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Default);
primaryDomain->accept(exampleHeavyWriter); primaryDomain->accept(exampleHeavyWriter);
exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Append); exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Append);
for (int i = 0; i<5; i++) for (int i = 0; i<5; ++i)
{//this loop covers the overflow of the fileSizeLimit {//this loop covers the overflow of the fileSizeLimit
primaryDomain->accept(exampleHeavyWriter); primaryDomain->accept(exampleHeavyWriter);
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -222,28 +222,23 @@ int main(int, char **) ...@@ -222,28 +222,23 @@ int main(int, char **)
exampleHeavyWriter->setFileSizeLimit(1); exampleHeavyWriter->setFileSizeLimit(1);
primaryDomain->accept(exampleHeavyWriter); primaryDomain->accept(exampleHeavyWriter);
printf("default mode\n");
exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Overwrite);//do this so that the data isn't in the hdf5 file twice. exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Overwrite);//do this so that the data isn't in the hdf5 file twice.
printf("overwrite mode\n");
exampleHeavyWriter->setFileIndex(0); exampleHeavyWriter->setFileIndex(0);
exampleWriter->setLightDataLimit(1); exampleWriter->setLightDataLimit(1);
primaryDomain->accept(exampleWriter); primaryDomain->accept(exampleWriter);
exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Append); exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Append);
printf("append mode\n");
for (int i = 0; i <= 797; i++) for (int i = 0; i <= 797; i++)
{//overflow occurs at around 509 {//overflow occurs at around 509
primaryDomain->accept(exampleHeavyWriter); primaryDomain->accept(exampleHeavyWriter);
} }
/*exampleHeavyWriter->setMode(XdmfHeavyDataWriter::Default); exampleHeavyWriter->setMode(<