diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index ecacbd2a3ca6..076c125fc9ac 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -9574,17 +9574,17 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { points which are distributed throughout the file in blocks of nVar_Restart data. ---*/ int *blocklen = new int[GetnPointDomain()]; - int *displace = new int[GetnPointDomain()]; + MPI_Aint *displace = new MPI_Aint[GetnPointDomain()]; counter = 0; for (iPoint_Global = 0; iPoint_Global < GetGlobal_nPointDomain(); iPoint_Global++ ) { if (GetGlobal_to_Local_Point(iPoint_Global) > -1) { blocklen[counter] = nFields; - displace[counter] = iPoint_Global*nFields; + displace[counter] = iPoint_Global*nFields*sizeof(passivedouble); counter++; } } - MPI_Type_indexed(GetnPointDomain(), blocklen, displace, MPI_DOUBLE, &filetype); + MPI_Type_create_hindexed(GetnPointDomain(), blocklen, displace, MPI_DOUBLE, &filetype); MPI_Type_commit(&filetype); /*--- Set the view for the MPI file write, i.e., describe the location in diff --git a/SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp index 31ea8e6fc211..1ae409076851 100644 --- a/SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp @@ -107,9 +107,9 @@ void CParaviewXMLFileWriter::Write_Data(){ */ if (!bigEndian){ - WriteMPIString("\n", MASTER_NODE); + WriteMPIString("\n", MASTER_NODE); } else { - WriteMPIString("\n", MASTER_NODE); + WriteMPIString("\n", MASTER_NODE); } WriteMPIString("\n", MASTER_NODE); @@ -329,9 +329,6 @@ void CParaviewXMLFileWriter::Write_Data(){ void CParaviewXMLFileWriter::WriteDataArray(void* data, VTKDatatype type, unsigned long arraySize, unsigned long globalSize, unsigned long offset){ - - int totalByteSize, byteSize; - std::string typeStr; unsigned long typeSize = 0; @@ -339,15 +336,16 @@ void CParaviewXMLFileWriter::WriteDataArray(void* data, VTKDatatype type, unsign /*--- Compute the size of the data to write in bytes ---*/ + int byteSize; byteSize = arraySize*typeSize; /*--- The total data size ---*/ - + unsigned long totalByteSize; totalByteSize = globalSize*typeSize; /*--- Only the master node writes the total size in bytes as int32 in front of the array data ---*/ - if (!WriteMPIBinaryData(&totalByteSize, sizeof(int), MASTER_NODE)){ + if (!WriteMPIBinaryData(&totalByteSize, sizeof(unsigned long), MASTER_NODE)){ SU2_MPI::Error("Writing array size failed", CURRENT_FUNCTION); } @@ -391,6 +389,6 @@ void CParaviewXMLFileWriter::AddDataArray(VTKDatatype type, string name, string(" offset=") + offsetStr + string(" format=\"appended\"/>\n"), MASTER_NODE); - dataOffset += totalByteSize + sizeof(int); + dataOffset += totalByteSize + sizeof(unsigned long); } diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index 804007466a82..3430ca882f3a 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -3831,16 +3831,16 @@ void CSolver::Read_SU2_Restart_Binary(CGeometry *geometry, CConfig *config, stri points which are distributed throughout the file in blocks of nVar_Restart data. ---*/ int *blocklen = new int[geometry->GetnPointDomain()]; - int *displace = new int[geometry->GetnPointDomain()]; + MPI_Aint *displace = new MPI_Aint[geometry->GetnPointDomain()]; int counter = 0; for (iPoint_Global = 0; iPoint_Global < geometry->GetGlobal_nPointDomain(); iPoint_Global++ ) { if (geometry->GetGlobal_to_Local_Point(iPoint_Global) > -1) { blocklen[counter] = nFields; - displace[counter] = iPoint_Global*nFields; + displace[counter] = iPoint_Global*nFields*sizeof(passivedouble); counter++; } } - MPI_Type_indexed(geometry->GetnPointDomain(), blocklen, displace, MPI_DOUBLE, &filetype); + MPI_Type_create_hindexed(geometry->GetnPointDomain(), blocklen, displace, MPI_DOUBLE, &filetype); MPI_Type_commit(&filetype); /*--- Set the view for the MPI file write, i.e., describe the location in