From 56602057394042572454998c78a615ade79fc853 Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Mon, 14 Feb 2022 13:23:47 +0100 Subject: [PATCH 001/393] Add ginkgo mpi comm wrapper --- .../ExecutorHandler/ExecutorHandler.H | 18 ++++++++++++++---- HostMatrix/HostMatrix.H | 2 ++ third_party/ginkgo/CMakeLists.txt | 8 ++++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/DevicePersistent/ExecutorHandler/ExecutorHandler.H b/DevicePersistent/ExecutorHandler/ExecutorHandler.H index 1d0153402..ed98f656b 100644 --- a/DevicePersistent/ExecutorHandler/ExecutorHandler.H +++ b/DevicePersistent/ExecutorHandler/ExecutorHandler.H @@ -36,6 +36,8 @@ SourceFiles namespace Foam { struct ExecutorInitFunctor { + mutable std::shared_ptr comm_; + const label device_id_; const word executor_name_; @@ -44,9 +46,10 @@ struct ExecutorInitFunctor { const label verbose_; - ExecutorInitFunctor(const word executor_name, const label device_id, - const word field_name, const label verbose) - : device_id_(device_id), + ExecutorInitFunctor(const word executor_name, const word field_name, + const label verbose) + : comm_(std::make_shared(MPI_COMM_WORLD)), + device_id_(comm_->node_local_rank()), executor_name_(executor_name), field_name_(field_name), verbose_(verbose) @@ -88,6 +91,8 @@ struct ExecutorInitFunctor { class ExecutorHandler : public PersistentBase { private: + const std::shared_ptr comm_; + const word device_executor_name_; public: @@ -99,10 +104,10 @@ public: db, ExecutorInitFunctor( solverControls.lookupOrDefault("executor", word("reference")), - solverControls.lookupOrDefault("device_id", label(0)), field_name, solverControls.lookupOrDefault("verbose", label(0))), true, 0), + comm_(), device_executor_name_( solverControls.lookupOrDefault("executor", word("reference"))) {} @@ -118,6 +123,11 @@ public: } word get_exec_name() const { return device_executor_name_; } + + std::shared_ptr get_gko_mpi_comm_wrapper() + { + return this->comm_; + } }; using PersistentExecutor = ExecutorHandler; diff --git a/HostMatrix/HostMatrix.H b/HostMatrix/HostMatrix.H index eb105ef42..4afcbc1ea 100644 --- a/HostMatrix/HostMatrix.H +++ b/HostMatrix/HostMatrix.H @@ -44,6 +44,8 @@ private: // const ExecutorHandler exec_; + const std::shared_ptr comm_; + const label nCells_; const label nNeighbours_; diff --git a/third_party/ginkgo/CMakeLists.txt b/third_party/ginkgo/CMakeLists.txt index abc140091..d960f2d53 100644 --- a/third_party/ginkgo/CMakeLists.txt +++ b/third_party/ginkgo/CMakeLists.txt @@ -1,7 +1,8 @@ # TODO pass flags from main CMAKE file -ginkgo_load_git_package(ginkgo_external +ginkgo_load_git_package( + ginkgo_external "https://github.com/ginkgo-project/ginkgo.git" - "develop" + "ogl_develop" "-DGINKGO_BUILD_CUDA=${GINKGO_BUILD_CUDA}" "-DGINKGO_BUILD_HIP=${GINKGO_BUILD_HIP}" "-DGINKGO_BUILD_OMP=${GINKGO_BUILD_OMP}" @@ -12,5 +13,4 @@ ginkgo_load_git_package(ginkgo_external "-DCMAKE_BUILD_TYPE=Release" "-DGINKGO_BUILD_HWLOC=OFF" "-DCMAKE_INSTALL_PREFIX=$ENV{FOAM_USER_LIBBIN}/.." - "-DBUILD_SHARED_LIBS=ON" - ) + "-DBUILD_SHARED_LIBS=ON") From 19877933c8fcdde788c4989ce987715e31ebffc2 Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Mon, 14 Feb 2022 15:17:27 +0100 Subject: [PATCH 002/393] Build partition --- .../ExecutorHandler/ExecutorHandler.H | 2 +- lduLduBase/lduLduBase.H | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/DevicePersistent/ExecutorHandler/ExecutorHandler.H b/DevicePersistent/ExecutorHandler/ExecutorHandler.H index ed98f656b..4e252c964 100644 --- a/DevicePersistent/ExecutorHandler/ExecutorHandler.H +++ b/DevicePersistent/ExecutorHandler/ExecutorHandler.H @@ -124,7 +124,7 @@ public: word get_exec_name() const { return device_executor_name_; } - std::shared_ptr get_gko_mpi_comm_wrapper() + std::shared_ptr get_gko_mpi_comm_wrapper() const { return this->comm_; } diff --git a/lduLduBase/lduLduBase.H b/lduLduBase/lduLduBase.H index 434082cc6..16bd986e0 100644 --- a/lduLduBase/lduLduBase.H +++ b/lduLduBase/lduLduBase.H @@ -50,6 +50,7 @@ private: using idx_array = gko::Array