Commit ab7bff7c authored by Jerry Clarke's avatar Jerry Clarke
Browse files

don't call SetDsmBuffer() if no MPI

parent 243583c3
......@@ -254,7 +254,9 @@ if( this->AttributeType == XDMF_ATTRIBUTE_TYPE_NONE ){
ValuesNode = this->DOM->FindDataElement( 0, Element );
if( ValuesNode ){
ValueReader.SetDOM( this->DOM );
#ifndef XDMF_NO_MPI
ValueReader.SetDsmBuffer(this->DsmBuffer);
#endif
if( this->ValuesAreMine && this->Values ){
delete this->Values;
this->Values = NULL;
......
......@@ -115,7 +115,9 @@ XdmfDataItem::Copy(XdmfElement *Source){
// this->SetDOM(ds->GetDOM());
this->SetFormat(ds->GetFormat());
this->SetHeavyDataSetName(ds->GetHeavyDataSetName());
#ifndef XDMF_NO_MPI
this->SetDsmBuffer(ds->GetDsmBuffer());
#endif
this->DataDesc->CopyType(ds->GetDataDesc());
this->DataDesc->CopyShape(ds->GetDataDesc());
this->DataDesc->CopySelection(ds->GetDataDesc());
......@@ -466,7 +468,9 @@ XdmfInt32 XdmfDataItem::Update(){
this->Values->SetDebug(this->GetDebug());
// this->SetDsmBuffer(this->Values->GetDsmBuffer());
// cout << "Setting Values Dsm to " << this->DsmBuffer << endl;
#ifndef XDMF_NO_MPI
this->Values->SetDsmBuffer(this->DsmBuffer);
#endif
if(!((XdmfValuesHDF *)this->Values)->Read(this->Array)){
XdmfErrorMessage("Reading Values Failed");
return(XDMF_FAIL);
......@@ -568,7 +572,9 @@ XdmfInt32 XdmfDataItem::Build(){
case XDMF_FORMAT_HDF :
XdmfDebug("Writing Values in HDF Format");
Values->SetHeavyDataSetName(this->GetHeavyDataSetName());
#ifndef XDMF_NO_MPI
Values->SetDsmBuffer(this->GetDsmBuffer());
#endif
if(((XdmfValuesHDF *)Values)->Write(this->Array) != XDMF_SUCCESS){
XdmfErrorMessage("Writing Values Failed");
return(XDMF_FAIL);
......
......@@ -321,7 +321,9 @@ if( ( this->GeometryType == XDMF_GEOMETRY_X_Y_Z ) ||
if(PointsItem.SetDOM( this->DOM ) == XDMF_FAIL) return(XDMF_FAIL);
if(PointsItem.SetElement(PointsElement, 0) == XDMF_FAIL) return(XDMF_FAIL);
if(PointsItem.UpdateInformation() == XDMF_FAIL) return(XDMF_FAIL);
#ifndef XDMF_NO_MPI
PointsItem.SetDsmBuffer(this->DsmBuffer);
#endif
if(PointsItem.Update() == XDMF_FAIL) return(XDMF_FAIL);
TmpArray = PointsItem.GetArray();
if( TmpArray ){
......@@ -390,7 +392,9 @@ if( ( this->GeometryType == XDMF_GEOMETRY_X_Y_Z ) ||
if( this->GeometryType == XDMF_GEOMETRY_ORIGIN_DXDYDZ ) {
XdmfDataItem PointsItem;
PointsItem.SetDOM(this->DOM);
#ifndef XDMF_NO_MPI
PointsItem.SetDsmBuffer(this->DsmBuffer);
#endif
XdmfDebug("Reading Origin and Dx, Dy, Dz" );
PointsElement = this->DOM->FindDataElement(0, this->Element );
if( PointsElement ){
......
......@@ -214,7 +214,9 @@ XdmfGrid::AssignAttribute( XdmfAttribute *attribute ){
XdmfInt32 Status = 0;
if( attribute ){
#ifndef XDMF_NO_MPI
if(!attribute->GetDsmBuffer()) attribute->SetDsmBuffer(this->DsmBuffer);
#endif
attribute->Update();
// Status = attribute->SetBaseAttribute( this, this->BaseGrid );
this->AssignedAttribute = attribute;
......@@ -481,7 +483,9 @@ if((this->GridType & XDMF_GRID_MASK) != XDMF_GRID_UNIFORM){
XdmfInt32 i;
// SubSet, Tree or Collection
for(i=0; i < this->NumberOfChildren ; i++){
#ifndef XDMF_NO_MPI
if(!this->Children[i]->GetDsmBuffer()) this->Children[i]->SetDsmBuffer(this->DsmBuffer);
#endif
if(this->Children[i]->Update() == XDMF_FAIL){
XdmfErrorMessage("Error in Update() of Child Grid " << i);
return(XDMF_FAIL);
......@@ -552,12 +556,16 @@ if((this->GridType & XDMF_GRID_MASK) != XDMF_GRID_UNIFORM){
}
return(XDMF_SUCCESS);
}
#ifndef XDMF_NO_MPI
if(!this->Topology->GetDsmBuffer()) this->Topology->SetDsmBuffer(this->DsmBuffer);
#endif
if(this->Topology->Update() == XDMF_FAIL){
XdmfErrorMessage("Error in Update() of Topology");
return(XDMF_FAIL);
}
#ifndef XDMF_NO_MPI
if(!this->Geometry->GetDsmBuffer()) this->Geometry->SetDsmBuffer(this->DsmBuffer);
#endif
if(this->Geometry->Update() == XDMF_FAIL){
XdmfErrorMessage("Error in Update() of Geometry");
return(XDMF_FAIL);
......
......@@ -54,7 +54,9 @@ XdmfValuesHDF::Read(XdmfArray *anArray){
}
XDMF_WORD_TRIM(DataSetName);
//! Possible Read from DSM. Make sure we're connected.
#ifndef XDMF_NO_MPI
if(!this->DsmBuffer) this->SetDsmBuffer(anArray->GetDsmBuffer());
#endif
XdmfDebug("Opening HDF5 Data for Reading : " << DataSetName);
// Allocate Array if Necessary
if(!RetArray){
......@@ -68,7 +70,9 @@ XdmfValuesHDF::Read(XdmfArray *anArray){
RetArray->CopySelection(this->DataDesc);
RetArray->Allocate();
}
#ifndef XDMF_NO_MPI
H5.SetDsmBuffer(this->DsmBuffer);
#endif
if( H5.Open( DataSetName, "r" ) == XDMF_FAIL ) {
XdmfErrorMessage("Can't Open Dataset " << DataSetName);
if(!anArray) delete RetArray;
......@@ -128,7 +132,9 @@ XdmfValuesHDF::Write(XdmfArray *anArray, XdmfConstString aHeavyDataSetName){
}
}
// Possible Write to DSM. Make sure we're connected
#ifndef XDMF_NO_MPI
if(!this->DsmBuffer) this->SetDsmBuffer(anArray->GetDsmBuffer());
#endif
XdmfDebug("Writing Values to " << aHeavyDataSetName);
if(!this->DataDesc ){
XdmfErrorMessage("DataDesc has not been set");
......@@ -144,7 +150,9 @@ XdmfValuesHDF::Write(XdmfArray *anArray, XdmfConstString aHeavyDataSetName){
H5.CopyType(this->DataDesc);
H5.CopyShape(this->DataDesc);
H5.CopySelection(this->DataDesc);
#ifndef XDMF_NO_MPI
H5.SetDsmBuffer(this->DsmBuffer);
#endif
if(H5.Open(hds, "rw") == XDMF_FAIL){
XdmfErrorMessage("Error Opening " << hds << " for Writing");
delete [] hds ;
......
Supports Markdown
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