Skip to content
Snippets Groups Projects
Commit 402258b5 authored by Lars Bilke's avatar Lars Bilke
Browse files

[CMake] Removed definition USE_MPI.

parent 99029f33
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#pragma once #pragma once
#ifdef USE_MPI #ifdef USE_PETSC
#include <mpi.h> #include <mpi.h>
#else #else
#include <chrono> #include <chrono>
...@@ -22,38 +22,37 @@ ...@@ -22,38 +22,37 @@
namespace BaseLib namespace BaseLib
{ {
/// Count the running time. /// Count the running time.
class RunTime class RunTime
{ {
public: public:
/// Start the timer. /// Start the timer.
void start() void start()
{ {
#ifdef USE_MPI #ifdef USE_PETSC
_start_time = MPI_Wtime(); _start_time = MPI_Wtime();
#else #else
_start_time = std::chrono::system_clock::now(); _start_time = std::chrono::system_clock::now();
#endif #endif
} }
/// Get the elapsed time in seconds. /// Get the elapsed time in seconds.
double elapsed() const double elapsed() const
{ {
#ifdef USE_MPI #ifdef USE_PETSC
return MPI_Wtime() - _start_time; return MPI_Wtime() - _start_time;
#else #else
using namespace std::chrono; using namespace std::chrono;
return duration<double>(system_clock::now() - _start_time).count(); return duration<double>(system_clock::now() - _start_time).count();
#endif #endif
} }
private: private:
#ifdef USE_MPI #ifdef USE_PETSC
double _start_time = std::numeric_limits<double>::quiet_NaN(); double _start_time = std::numeric_limits<double>::quiet_NaN();
#else #else
std::chrono::time_point<std::chrono::system_clock> _start_time; std::chrono::time_point<std::chrono::system_clock> _start_time;
#endif #endif
}; };
} // end namespace BaseLib } // end namespace BaseLib
...@@ -194,10 +194,6 @@ if(OGS_USE_MKL) ...@@ -194,10 +194,6 @@ if(OGS_USE_MKL)
include_directories(SYSTEM ${MKL_INCLUDE_DIR}) include_directories(SYSTEM ${MKL_INCLUDE_DIR})
endif() endif()
if(OGS_USE_MPI)
add_definitions(-DUSE_MPI)
endif()
# Eigen # Eigen
if(CMAKE_BUILD_TYPE STREQUAL "Debug") if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DEIGEN_INITIALIZE_MATRICES_BY_NAN) add_definitions(-DEIGEN_INITIALIZE_MATRICES_BY_NAN)
......
...@@ -13,20 +13,20 @@ ...@@ -13,20 +13,20 @@
#include "VtuInterface.h" #include "VtuInterface.h"
#include <vtkNew.h>
#include <vtkGenericDataObjectReader.h> #include <vtkGenericDataObjectReader.h>
#include <vtkNew.h>
#include <vtkXMLUnstructuredGridReader.h> #include <vtkXMLUnstructuredGridReader.h>
#include <vtkXMLUnstructuredGridWriter.h> #include <vtkXMLUnstructuredGridWriter.h>
#if defined(USE_PETSC) || defined(USE_MPI) #if defined(USE_PETSC)
#include <vtkXMLPUnstructuredGridWriter.h> #include <vtkXMLPUnstructuredGridWriter.h>
#endif #endif
#include <vtkSmartPointer.h> #include <vtkSmartPointer.h>
#include <vtkUnstructuredGrid.h> #include <vtkUnstructuredGrid.h>
#include "BaseLib/Logging.h"
#include <boost/algorithm/string/erase.hpp> #include <boost/algorithm/string/erase.hpp>
#include "BaseLib/Logging.h"
#ifdef USE_PETSC #ifdef USE_PETSC
#include <petsc.h> #include <petsc.h>
#endif #endif
...@@ -40,9 +40,9 @@ namespace MeshLib ...@@ -40,9 +40,9 @@ namespace MeshLib
{ {
namespace IO namespace IO
{ {
VtuInterface::VtuInterface(const MeshLib::Mesh* mesh, int dataMode,
VtuInterface::VtuInterface(const MeshLib::Mesh* mesh, int dataMode, bool compress) : bool compress)
_mesh(mesh), _data_mode(dataMode), _use_compressor(compress) : _mesh(mesh), _data_mode(dataMode), _use_compressor(compress)
{ {
if (_data_mode == vtkXMLWriter::Ascii && compress) if (_data_mode == vtkXMLWriter::Ascii && compress)
{ {
...@@ -50,9 +50,10 @@ VtuInterface::VtuInterface(const MeshLib::Mesh* mesh, int dataMode, bool compres ...@@ -50,9 +50,10 @@ VtuInterface::VtuInterface(const MeshLib::Mesh* mesh, int dataMode, bool compres
} }
} }
MeshLib::Mesh* VtuInterface::readVTUFile(std::string const &file_name) MeshLib::Mesh* VtuInterface::readVTUFile(std::string const& file_name)
{ {
if (!BaseLib::IsFileExisting(file_name)) { if (!BaseLib::IsFileExisting(file_name))
{
ERR("File '{:s}' does not exist.", file_name); ERR("File '{:s}' does not exist.", file_name);
return nullptr; return nullptr;
} }
...@@ -69,8 +70,10 @@ MeshLib::Mesh* VtuInterface::readVTUFile(std::string const &file_name) ...@@ -69,8 +70,10 @@ MeshLib::Mesh* VtuInterface::readVTUFile(std::string const &file_name)
return nullptr; return nullptr;
} }
std::string const mesh_name (BaseLib::extractBaseNameWithoutExtension(file_name)); std::string const mesh_name(
return MeshLib::VtkMeshConverter::convertUnstructuredGrid(vtkGrid, mesh_name); BaseLib::extractBaseNameWithoutExtension(file_name));
return MeshLib::VtkMeshConverter::convertUnstructuredGrid(vtkGrid,
mesh_name);
} }
MeshLib::Mesh* VtuInterface::readVTKFile(std::string const& file_name) MeshLib::Mesh* VtuInterface::readVTKFile(std::string const& file_name)
...@@ -161,6 +164,5 @@ int writeVtu(MeshLib::Mesh const& mesh, std::string const& file_name, ...@@ -161,6 +164,5 @@ int writeVtu(MeshLib::Mesh const& mesh, std::string const& file_name,
return 0; return 0;
} }
} // end namespace IO
} // end namespace IO } // end namespace MeshLib
} // end namespace MeshLib
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment