Skip to content

Commit

Permalink
Remove outdated pika version checks and workarounds
Browse files Browse the repository at this point in the history
  • Loading branch information
msimberg committed Feb 4, 2025
1 parent c6913a3 commit 8db5396
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 56 deletions.
5 changes: 2 additions & 3 deletions include/dlaf/eigensolver/reduction_to_band/impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
#include <dlaf/matrix/tile.h>
#include <dlaf/matrix/views.h>
#include <dlaf/schedulers.h>
#include <dlaf/sender/continues_on.h>
#include <dlaf/sender/traits.h>
#include <dlaf/types.h>
#include <dlaf/util_math.h>
Expand Down Expand Up @@ -323,7 +322,7 @@ void computePanelReflectors(MatrixLikeA& mat_a, MatrixLikeTaus& mat_taus, const
std::vector<common::internal::vector<T>>{}), // w (internally required)
mat_taus.readwrite(LocalTileIndex(j_sub, 0)),
ex::when_all_vector(std::move(panel_tiles))) |
di::continues_on(di::getBackendScheduler<Backend::MC>(thread_priority::high)) |
ex::continues_on(di::getBackendScheduler<Backend::MC>(thread_priority::high)) |
ex::bulk(nworkers, [nworkers, cols = panel_view.cols()](const std::size_t index, auto& barrier_ptr,
auto& w, auto& taus, auto& tiles) {
const auto barrier_busy_wait = getReductionToBandBarrierBusyWait();
Expand Down Expand Up @@ -651,7 +650,7 @@ void computePanelReflectors(TriggerSender&& trigger, comm::IndexT_MPI rank_v0,
mat_taus.readwrite(GlobalTileIndex(j_sub, 0)),
ex::when_all_vector(std::move(panel_tiles)),
std::forward<CommSender>(mpi_col_chain_panel), std::forward<TriggerSender>(trigger)) |
di::continues_on(di::getBackendScheduler<Backend::MC>(pika::execution::thread_priority::high)) |
ex::continues_on(di::getBackendScheduler<Backend::MC>(pika::execution::thread_priority::high)) |
ex::bulk(nworkers, [nworkers, rank_v0,
cols = panel_view.cols()](const std::size_t index, auto& barrier_ptr, auto& w,
auto& taus, auto& tiles, auto&& pcomm) {
Expand Down
13 changes: 5 additions & 8 deletions include/dlaf/eigensolver/tridiag_solver/merge.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
#include <dlaf/permutations/general.h>
#include <dlaf/permutations/general/impl.h>
#include <dlaf/schedulers.h>
#include <dlaf/sender/continues_on.h>
#include <dlaf/sender/make_sender_algorithm_overloads.h>
#include <dlaf/sender/policy.h>
#include <dlaf/sender/transform.h>
Expand Down Expand Up @@ -824,7 +823,7 @@ void solveRank1Problem(const SizeType i_begin, const SizeType i_end, KSender&& k
ex::when_all_vector(tc.readwrite(z)), ex::when_all_vector(tc.readwrite(evals)),
ex::when_all_vector(tc.read(i2)), ex::when_all_vector(tc.readwrite(evecs)),
ex::just(std::vector<memory::MemoryView<T, Device::CPU>>())) |
di::continues_on(di::getBackendScheduler<Backend::MC>(thread_priority::high)) |
ex::continues_on(di::getBackendScheduler<Backend::MC>(thread_priority::high)) |
ex::bulk(nthreads, [nthreads, n, nb](std::size_t thread_idx, auto& barrier_ptr, auto& k, auto& rho,
auto& d_tiles, auto& z_tiles, auto& eval_tiles,
const auto& i2_tile_arr, auto& evec_tiles, auto& ws_vecs) {
Expand Down Expand Up @@ -1032,12 +1031,11 @@ void multiplyEigenvectors(const SizeType sub_offset, const SizeType n, const Siz
// └───┴────────┴────┘ └────────────┴────┘

namespace ex = pika::execution::experimental;
using dlaf::internal::continues_on;
using pika::execution::thread_priority;

ex::start_detached(
ex::when_all(std::forward<KSender>(k), std::forward<UDLSenders>(n_udl)) |
continues_on(dlaf::internal::getBackendScheduler<Backend::MC>(thread_priority::high)) |
ex::continues_on(dlaf::internal::getBackendScheduler<Backend::MC>(thread_priority::high)) |
ex::then([sub_offset, n, n_upper, n_lower, e0 = e0.subPipeline(), e1 = e1.subPipelineConst(),
e2 = e2.subPipelineConst()](const SizeType k, std::array<std::size_t, 3> n_udl) mutable {
using dlaf::matrix::internal::MatrixRef;
Expand Down Expand Up @@ -1335,7 +1333,7 @@ void solveRank1ProblemDist(CommSender&& row_comm, CommSender&& col_comm, const S
// additional workspaces
ex::just(std::vector<memory::MemoryView<T, Device::CPU>>()),
ex::just(memory::MemoryView<T, Device::CPU>())) |
di::continues_on(hp_scheduler) |
ex::continues_on(hp_scheduler) |
ex::let_value([n, dist_sub, bcast_evals, all_reduce_in_place, hp_scheduler](
auto& row_comm_wrapper, auto& col_comm_wrapper, const SizeType k,
const SizeType k_lc, const auto& rho, const auto& d_tiles, auto& z_tiles,
Expand All @@ -1354,7 +1352,7 @@ void solveRank1ProblemDist(CommSender&& row_comm, CommSender&& col_comm, const S
return std::clamp(ideal_workers, min_workers, available_workers);
}();

return ex::just(std::make_unique<pika::barrier<>>(nthreads)) | di::continues_on(hp_scheduler) |
return ex::just(std::make_unique<pika::barrier<>>(nthreads)) | ex::continues_on(hp_scheduler) |
ex::bulk(nthreads, [&row_comm_wrapper, &col_comm_wrapper, k, k_lc, &rho, &d_tiles,
&z_tiles, &eval_tiles, &i4_tiles_arr, &i6_tiles_arr, &i2_tiles_arr,
&evec_tiles, &ws_cols, &ws_row, nthreads, n, dist_sub, bcast_evals,
Expand Down Expand Up @@ -1763,12 +1761,11 @@ void multiplyEigenvectors(const GlobalElementIndex sub_offset, const matrix::Dis
// └───┴────────┴────┘ └────────────┴────┘

namespace ex = pika::execution::experimental;
using dlaf::internal::continues_on;
using pika::execution::thread_priority;

ex::start_detached(
ex::when_all(std::forward<KLcSender>(k_lc), std::forward<UDLSenders>(n_udl)) |
continues_on(dlaf::internal::getBackendScheduler<Backend::MC>(thread_priority::high)) |
ex::continues_on(dlaf::internal::getBackendScheduler<Backend::MC>(thread_priority::high)) |
ex::then([dist_sub, sub_offset, n_upper, n_lower, e0 = e0.subPipeline(),
e1 = e1.subPipelineConst(), e2 = e2.subPipelineConst(),
sub_comm_row = row_task_chain.sub_pipeline(),
Expand Down
5 changes: 2 additions & 3 deletions include/dlaf/permutations/general/impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ void Permutations<B, D, T, C>::call(const SizeType i_begin, const SizeType i_end
namespace ex = pika::execution::experimental;
namespace dist_extra = dlaf::matrix::internal::distribution;
using dist_extra::local_element_distance_from_global_tile;
using dlaf::internal::continues_on;

if (i_begin == i_end)
return;
Expand Down Expand Up @@ -211,7 +210,7 @@ void Permutations<B, D, T, C>::call(const SizeType i_begin, const SizeType i_end
applyPermutationOnCPU<T, C>(i_perm, subm_dist, perm_arr, mat_in_tiles, mat_out_tiles);
};

ex::start_detached(std::move(sender) | continues_on(dlaf::internal::getBackendScheduler<B>()) |
ex::start_detached(std::move(sender) | ex::continues_on(dlaf::internal::getBackendScheduler<B>()) |
ex::bulk(nperms, std::move(permute_fn)));
}
else {
Expand Down Expand Up @@ -431,7 +430,7 @@ void applyPackingIndex(const matrix::Distribution& subm_dist, IndexMapSender&& i
applyPermutationOnCPU<T, C>(i_perm, subm_dist, perm_arr, mat_in_tiles, mat_out_tiles);
};

ex::start_detached(std::move(sender) | di::continues_on(di::getBackendScheduler<Backend::MC>()) |
ex::start_detached(std::move(sender) | ex::continues_on(di::getBackendScheduler<Backend::MC>()) |
ex::bulk(nperms, std::move(permute_fn)));
}
else {
Expand Down
20 changes: 0 additions & 20 deletions include/dlaf/sender/continues_on.h

This file was deleted.

3 changes: 1 addition & 2 deletions include/dlaf/sender/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <dlaf/common/unwrap.h>
#include <dlaf/init.h>
#include <dlaf/schedulers.h>
#include <dlaf/sender/continues_on.h>
#include <dlaf/sender/policy.h>
#include <dlaf/sender/typelist.h>
#include <dlaf/sender/when_all_lift.h>
Expand Down Expand Up @@ -54,7 +53,7 @@ template <TransformDispatchType Tag = TransformDispatchType::Plain, Backend B =
typename F = void, typename Sender = void,
typename = std::enable_if_t<pika::execution::experimental::is_sender_v<Sender>>>
[[nodiscard]] decltype(auto) transform(const Policy<B> policy, F&& f, Sender&& sender) {
using dlaf::internal::continues_on;
using pika::execution::experimental::continues_on;
using pika::execution::experimental::drop_operation_state;
using pika::execution::experimental::then;

Expand Down
1 change: 0 additions & 1 deletion include/dlaf/sender/transform_mpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <dlaf/common/unwrap.h>
#include <dlaf/communication/communicator.h>
#include <dlaf/communication/communicator_pipeline.h>
#include <dlaf/sender/continues_on.h>
#include <dlaf/sender/transform.h>

namespace dlaf::comm::internal {
Expand Down
2 changes: 0 additions & 2 deletions include/dlaf/tune.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,11 @@ struct TuneParameters {
// Some parameters require the pika runtime to be initialized since they depend on the number of
// threads used by the runtime. We initialize them separately in the constructor after checking that
// pika is initialized.
#if PIKA_VERSION_FULL >= 0x001600 // >= 0.22.0
if (!pika::is_runtime_initialized()) {
std::cerr
<< "[ERROR] Trying to initialize DLA-Future tune parameters but the pika runtime is not initialized. Make sure pika is initialized first.\n";
std::terminate();
}
#endif

const auto default_pool_thread_count =
pika::resource::get_thread_pool("default").get_os_thread_count();
Expand Down
6 changes: 0 additions & 6 deletions src/c_api/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ void dlaf_initialize(int argc_pika, const char** argv_pika, int argc_dlaf,
// pika initialization
pika::init_params params;
params.desc_cmdline = desc;
// After pika 0.21.0 pika::start reports errors only by exception and returns void
#if PIKA_VERSION_FULL >= 0x001500
pika::start(argc_pika, argv_pika, params);
#else
auto pika_started = pika::start(nullptr, argc_pika, argv_pika, params);
DLAF_ASSERT(pika_started, pika_started);
#endif

// DLA-Future initialization
dlaf::initialize(argc_dlaf, argv_dlaf);
Expand Down
12 changes: 1 addition & 11 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,8 @@ void initializeGpuPool(int device, std::size_t num_np_streams, std::size_t num_h
#else
0
#endif
#if PIKA_VERSION_FULL >= 0x001D00 // >= 0.29.0
,
num_blas_handles, num_lapack_handles
#endif
);
#if PIKA_VERSION_FULL < 0x001D00 // < 0.29.0
dlaf::internal::silenceUnusedWarningFor(num_blas_handles, num_lapack_handles);
#endif
num_blas_handles, num_lapack_handles);
}

void finalizeGpuPool() {
Expand Down Expand Up @@ -280,10 +274,6 @@ void updateConfiguration(const pika::program_options::variables_map& vm, configu
updateConfigurationValue(vm, cfg.umpire_device_memory_pool_coalescing_reallocation_ratio, "UMPIRE_DEVICE_MEMORY_POOL_COALESCING_REALLOCATION_RATIO", "umpire-device-memory-pool-coalescing-reallocation-ratio");
updateConfigurationValue(vm, cfg.num_gpu_blas_handles, "NUM_GPU_BLAS_HANDLES", "num-gpu-blas-handles");
updateConfigurationValue(vm, cfg.num_gpu_lapack_handles, "NUM_GPU_LAPACK_HANDLES", "num-gpu-lapack-handles");
#if PIKA_VERSION_FULL < 0x001D00 // < 0.29.0
warnUnusedConfigurationOption(vm, "NUM_GPU_BLAS_HANDLES", "num-gpu-blas-handles", "only supported with pika 0.29.0 or newer");
warnUnusedConfigurationOption(vm, "NUM_GPU_LAPACK_HANDLES", "num-gpu-lapack-handles", "only supported with pika 0.29.0 or newer");
#endif

// update tune parameters
//
Expand Down

0 comments on commit 8db5396

Please sign in to comment.