From 503b3160cd276d8a8380fba1bdbef7e4224c8b79 Mon Sep 17 00:00:00 2001 From: Tobias Meisel <tobias.meisel@ufz.de> Date: Tue, 27 Oct 2020 08:32:58 +0100 Subject: [PATCH] [Me/P] Parallel XDMF is not supported msg Stub for parallel xdmf implementation is removed --- MeshLib/IO/XDMF/writeXdmf.cpp | 19 ------------------- ProcessLib/Output/CreateOutput.cpp | 20 ++++++++++++++------ 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/MeshLib/IO/XDMF/writeXdmf.cpp b/MeshLib/IO/XDMF/writeXdmf.cpp index f7f1ba601ae..1cde24e76ac 100644 --- a/MeshLib/IO/XDMF/writeXdmf.cpp +++ b/MeshLib/IO/XDMF/writeXdmf.cpp @@ -14,7 +14,6 @@ #include "writeXdmf.h" #include <vtkNew.h> -#include <vtkPXdmf3Writer.h> #include <vtkSmartPointer.h> #include <vtkXdmf3Writer.h> @@ -26,33 +25,15 @@ namespace IO { bool writeXdmf3(const MeshLib::Mesh& mesh, std::string const& file_name) { -#ifdef USE_PETSC - int rank; - MPI_Comm_rank(PETSC_COMM_WORLD, &rank); - int mpi_size; - MPI_Comm_size(PETSC_COMM_WORLD, &mpi_size); - vtkSmartPointer<vtkPXdmf3Writer> writer = - vtkSmartPointer<vtkPXdmf3Writer>::New(); // open file handle - -#else vtkSmartPointer<vtkXdmf3Writer> writer = vtkSmartPointer<vtkXdmf3Writer>::New(); // open file handle -#endif writer->SetFileName(file_name.c_str()); vtkNew<MeshLib::VtkMappedMeshSource> vtkSource; vtkSource->SetMesh(&mesh); vtkSource->Update(); writer->SetInputData(vtkSource->GetOutput()); - -#ifdef USE_PETSC - writer->SetGhostLevel(1); - writer->SetNumberOfPieces(num_partitions); - writer->SetStartPiece(rank); - writer->SetEndPiece(rank); -#endif writer->Write(); - // close file handle return 0; } } // end namespace IO diff --git a/ProcessLib/Output/CreateOutput.cpp b/ProcessLib/Output/CreateOutput.cpp index c8723549fdd..54fde42a56b 100644 --- a/ProcessLib/Output/CreateOutput.cpp +++ b/ProcessLib/Output/CreateOutput.cpp @@ -31,20 +31,28 @@ std::unique_ptr<Output> createOutput( { DBUG("Parse output configuration:"); - OutputTypes const output_type = [](auto type) + OutputTypes const output_type = [](auto output_type) { try { - - const std::map<std::string, OutputTypes> outputType_to_enum= - {{"VTK",OutputTypes::vtk}, {"XDMF", OutputTypes::xdmf}}; - return outputType_to_enum.at(type); + const std::map<std::string, OutputTypes> outputType_to_enum = { + {"VTK", OutputTypes::vtk}, {"XDMF", OutputTypes::xdmf}}; + auto type = outputType_to_enum.at(output_type); + +#ifdef USE_PETSC + if (type == ProcessLib::OutputTypes::xdmf) + { + OGS_FATAL("Parallel XDMF output is not supported (yet)."); + } +#endif + + return type; } catch (std::out_of_range& e) { OGS_FATAL("No supported file type provided. Read `{:s}' from <output><type> \ in prj File. Supported: VTK, XDMF.", - type); + output_type); } //! \ogs_file_param{prj__time_loop__output__type} }(config.getConfigParameter<std::string>("type")); -- GitLab