-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
computeTFactor parallelise computation with bulk (MC Local and Distri…
…buted) (#798)
- Loading branch information
Showing
5 changed files
with
396 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// Distributed Linear Algebra with Future (DLAF) | ||
// | ||
// Copyright (c) 2018-2023, ETH Zurich | ||
// All rights reserved. | ||
// | ||
// Please, refer to the LICENSE file in the root directory. | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
#pragma once | ||
|
||
#include <algorithm> | ||
#include <cmath> | ||
|
||
#include <pika/runtime.hpp> | ||
|
||
#include "dlaf/common/assert.h" | ||
#include "dlaf/tune.h" | ||
|
||
namespace dlaf::factorization::internal { | ||
|
||
inline size_t getTFactorNWorkers() noexcept { | ||
const size_t nworkers = getTuneParameters().tfactor_nworkers; | ||
|
||
// Note: precautionarily we leave at least 1 thread "free" to do other stuff | ||
const size_t max_workers = pika::resource::get_thread_pool("default").get_os_thread_count() - 1; | ||
|
||
// 1 <= number of workers < max_workers | ||
return std::max<std::size_t>(1, std::min<std::size_t>(max_workers, nworkers)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.