------------------------------------------------------------------------------
| 1014 | |
| 1015 | //------------------------------------------------------------------------------ |
| 1016 | void vtkPStructuredGridConnectivity::SerializeGhostData( |
| 1017 | int sendGridID, int rcvGrid, int sndext[6], unsigned char*& buffer, unsigned int& size) |
| 1018 | { |
| 1019 | // Pre-conditions |
| 1020 | assert("pre: Grid to be serialized must be local" && this->IsGridLocal(sendGridID)); |
| 1021 | assert("pre: Receive grid should not be local" && !this->IsGridLocal(rcvGrid)); |
| 1022 | assert("pre: sendGridID out-of-bounds!" && |
| 1023 | (sendGridID >= 0 && sendGridID < static_cast<int>(this->NumberOfGrids))); |
| 1024 | assert("pre: rcvGridID is out-of-bounds!" && (rcvGrid >= 0) && |
| 1025 | rcvGrid < static_cast<int>(this->NumberOfGrids)); |
| 1026 | |
| 1027 | vtkMultiProcessStream bytestream; |
| 1028 | |
| 1029 | // STEP 0: Write the header |
| 1030 | bytestream << sendGridID << rcvGrid; |
| 1031 | bytestream.Push(sndext, 6); |
| 1032 | |
| 1033 | // STEP 1: Serialize the points |
| 1034 | this->SerializeGhostPoints(sendGridID, sndext, bytestream); |
| 1035 | |
| 1036 | // STEP 2: Serialize point data (if any) |
| 1037 | this->SerializeGhostPointData(sendGridID, sndext, bytestream); |
| 1038 | |
| 1039 | // STEP 3: Serialize cell data (if any) |
| 1040 | this->SerializeGhostCellData(sendGridID, sndext, bytestream); |
| 1041 | |
| 1042 | // STEP 4: Get the raw data buffer |
| 1043 | bytestream.GetRawData(buffer, size); |
| 1044 | |
| 1045 | // BEGIN DEBUG |
| 1046 | // std::ostringstream oss; |
| 1047 | // oss << "SendLog_" << this->Rank << ".txt"; |
| 1048 | // vtksys::ofstream ofs; |
| 1049 | // ofs.open( oss.str().c_str() ); |
| 1050 | // ofs << "SEND MESSAGE SIZE: " << size << "\n"; |
| 1051 | // ofs << sendGridID << " " << rcvGrid << std::endl; |
| 1052 | // for( int i=0; i < 6; ++i ) |
| 1053 | // { |
| 1054 | // ofs << sndext[ i ] << " "; |
| 1055 | // } |
| 1056 | // ofs << std::endl; |
| 1057 | // ofs.close(); |
| 1058 | // END DEBUG |
| 1059 | |
| 1060 | // Post-conditions |
| 1061 | assert("post: buffer should not be nullptr!" && (buffer != nullptr)); |
| 1062 | assert("post: size > 0" && (size > 0)); |
| 1063 | } |
| 1064 | |
| 1065 | //------------------------------------------------------------------------------ |
| 1066 | void vtkPStructuredGridConnectivity::DeserializeGhostData(int gridID, int neiGridID, |
no test coverage detected