------------------------------------------------------------------------------
| 180 | |
| 181 | //------------------------------------------------------------------------------ |
| 182 | int vtkMPIMultiBlockPLOT3DReader::OpenFileForDataRead(void*& vfp, const char* fname) |
| 183 | { |
| 184 | if (!this->CanUseMPIIO()) |
| 185 | { |
| 186 | return this->Superclass::OpenFileForDataRead(vfp, fname); |
| 187 | } |
| 188 | |
| 189 | vtkMPICommunicator* mpiComm = |
| 190 | vtkMPICommunicator::SafeDownCast(this->Controller->GetCommunicator()); |
| 191 | assert(mpiComm); |
| 192 | |
| 193 | vtkMPIOpaqueFileHandle* handle = new vtkMPIOpaqueFileHandle(); |
| 194 | try |
| 195 | { |
| 196 | if (MPI_File_open(*mpiComm->GetMPIComm()->GetHandle(), const_cast<char*>(fname), |
| 197 | MPI_MODE_RDONLY, MPI_INFO_NULL, &handle->Handle) != MPI_SUCCESS) |
| 198 | { |
| 199 | this->SetErrorCode(vtkErrorCode::FileNotFoundError); |
| 200 | vtkErrorMacro("File: " << fname << " not found."); |
| 201 | throw MPIPlot3DException(); |
| 202 | } |
| 203 | } |
| 204 | catch (const MPIPlot3DException&) |
| 205 | { |
| 206 | delete handle; |
| 207 | vfp = nullptr; |
| 208 | return VTK_ERROR; |
| 209 | } |
| 210 | vfp = handle; |
| 211 | return VTK_OK; |
| 212 | } |
| 213 | |
| 214 | //------------------------------------------------------------------------------ |
| 215 | void vtkMPIMultiBlockPLOT3DReader::CloseFile(void* vfp) |
nothing calls this directly
no test coverage detected