diff --git a/CMakeLists.txt b/CMakeLists.txt index f46e2c8..893ac91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,9 @@ include(clang_format) if (${POLYHEDRAL_GRAVITY_PARALLELIZATION} STREQUAL "TBB") include(tbb) thrust_set_TBB_target(TBB::tbb) + add_compile_definitions(POLYHEDRAL_GRAVITY_TBB) +elseif (${POLYHEDRAL_GRAVITY_PARALLELIZATION} STREQUAL "OMP") + add_compile_definitions(POLYHEDRAL_GRAVITY_OMP) endif () # Thrust set-up i.e. the parallelization library, create targets according to the users specification diff --git a/src/main.cpp b/src/main.cpp index 4692e2c..356456f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,9 +4,14 @@ #include "polyhedralGravity/model/GravityModel.h" #include "polyhedralGravity/output/Logging.h" #include "polyhedralGravity/output/CSVWriter.h" +#include "polyhedralGravity/Version.h" int main(int argc, char *argv[]) { using namespace polyhedralGravity; + + SPDLOG_LOGGER_INFO(PolyhedralGravityLogger::DEFAULT_LOGGER.getLogger(), "Polyhedral Gravity Model Version " + std::string(POLYHEDRAL_GRAVITY_VERSION)); + SPDLOG_LOGGER_INFO(PolyhedralGravityLogger::DEFAULT_LOGGER.getLogger(), "Polyhedral Gravity Model Parallelization Backend: " + std::string(POLYHEDRAL_GRAVITY_PARALLELIZATION)); + if (argc != 2) { SPDLOG_LOGGER_INFO(PolyhedralGravityLogger::DEFAULT_LOGGER.getLogger(), "Wrong program call! " "Please use the program like this:\n" diff --git a/src/polyhedralGravity/Version.h b/src/polyhedralGravity/Version.h index 49e57d9..1c668cb 100644 --- a/src/polyhedralGravity/Version.h +++ b/src/polyhedralGravity/Version.h @@ -11,5 +11,19 @@ namespace polyhedralGravity { */ constexpr std::string_view POLYHEDRAL_GRAVITY_VERSION = "3.2.1"; + /** + * The API parallelization backend of the polyhedral gravity model's interface. + * This value depends on the CMake configuration. + */ + constexpr std::string_view POLYHEDRAL_GRAVITY_PARALLELIZATION = +#ifdef POLYHEDRAL_GRAVITY_TBB + "TBB" +#elifdef POLYHEDRAL_GRAVITY_OMP + "OMP" +#else + "CPP" +#endif + ; + }// namespace polyhedralGravity diff --git a/src/polyhedralGravityPython/PolyhedralGravityPython.cpp b/src/polyhedralGravityPython/PolyhedralGravityPython.cpp index 1386baf..b5212f3 100644 --- a/src/polyhedralGravityPython/PolyhedralGravityPython.cpp +++ b/src/polyhedralGravityPython/PolyhedralGravityPython.cpp @@ -103,6 +103,7 @@ PYBIND11_MODULE(polyhedral_gravity, m) { Accordingly, the second derivative tensor is defined as the derivative of :math:`\textbf{g}`. )mydelimiter"; m.attr("__version__") = POLYHEDRAL_GRAVITY_VERSION; + m.attr("__parallelization__") = POLYHEDRAL_GRAVITY_PARALLELIZATION; py::enum_(m, "NormalOrientation", R"mydelimiter( The orientation of the plane unit normals of the polyhedron.