Skip to content

Commit

Permalink
[deprecated code 3] remove {OpenMP,HPX}::partition_master
Browse files Browse the repository at this point in the history
  • Loading branch information
dalg24 committed Oct 18, 2023
1 parent 3172fd1 commit 0505ce2
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 174 deletions.
12 changes: 0 additions & 12 deletions core/src/HPX/Kokkos_HPX.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,18 +248,6 @@ class HPX {
#endif
}

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3
template <typename F>
KOKKOS_DEPRECATED static void partition_master(
F const &, int requested_num_partitions = 0, int = 0) {
if (requested_num_partitions > 1) {
Kokkos::abort(
"Kokkos::Experimental::HPX::partition_master: can't partition an "
"HPX instance\n");
}
}
#endif

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
static int concurrency();
#else
Expand Down
12 changes: 0 additions & 12 deletions core/src/OpenMP/Kokkos_OpenMP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,6 @@ class OpenMP {
/// This always returns false on OpenMP
inline static bool is_asynchronous(OpenMP const& = OpenMP()) noexcept;

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3
/// \brief Partition the default instance and call 'f' on each new 'master'
/// thread
///
/// Func is a functor with the following signiture
/// void( int partition_id, int num_partitions )
template <typename F>
KOKKOS_DEPRECATED static void partition_master(
F const& f, int requested_num_partitions = 0,
int requested_partition_size = 0);
#endif

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
static int concurrency(OpenMP const& = OpenMP());
#else
Expand Down
44 changes: 0 additions & 44 deletions core/src/OpenMP/Kokkos_OpenMP_Instance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,50 +202,6 @@ std::vector<OpenMP> partition_space(OpenMP const& main_instance,
return Impl::create_OpenMP_instances(main_instance, weights);
}
} // namespace Experimental

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3
template <typename F>
KOKKOS_DEPRECATED void OpenMP::partition_master(F const& f, int num_partitions,
int partition_size) {
#if _OPENMP >= 201511
if (omp_get_max_active_levels() > 1) {
#else
if (omp_get_nested()) {
#endif
using Exec = Impl::OpenMPInternal;

Exec* prev_instance = &Impl::OpenMPInternal::singleton();

Exec::validate_partition_impl(prev_instance->m_pool_size, num_partitions,
partition_size);

OpenMP::memory_space space;

#pragma omp parallel num_threads(num_partitions)
{
Exec thread_local_instance(partition_size);
Impl::t_openmp_instance = &thread_local_instance;

size_t pool_reduce_bytes = 32 * partition_size;
size_t team_reduce_bytes = 32 * partition_size;
size_t team_shared_bytes = 1024 * partition_size;
size_t thread_local_bytes = 1024;

thread_local_instance.resize_thread_data(
pool_reduce_bytes, team_reduce_bytes, team_shared_bytes,
thread_local_bytes);

omp_set_num_threads(partition_size);
f(omp_get_thread_num(), omp_get_num_threads());
Impl::t_openmp_instance = nullptr;
}
} else {
// nested openmp not enabled
f(0, 1);
}
}
#endif

} // namespace Kokkos

#endif
1 change: 0 additions & 1 deletion core/unit_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,6 @@ endif()
if (Kokkos_ENABLE_OPENMP)
set(OpenMP_EXTRA_SOURCES
openmp/TestOpenMP_Task.cpp
openmp/TestOpenMP_PartitionMaster.cpp
)
KOKKOS_ADD_EXECUTABLE_AND_TEST(
CoreUnitTest_OpenMP
Expand Down
105 changes: 0 additions & 105 deletions core/unit_test/openmp/TestOpenMP_PartitionMaster.cpp

This file was deleted.

0 comments on commit 0505ce2

Please sign in to comment.