Skip to content

Commit

Permalink
Always use hpx::mutex for work aggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
G-071 committed Oct 8, 2023
1 parent 733b870 commit 9470852
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 14 additions & 0 deletions include/aggregation_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#ifndef WORK_AGGREGATION_MANAGER
#define WORK_AGGREGATION_MANAGER

#ifndef CPPUDDLE_HAVE_HPX
#error "Work aggregation allocators/executors require CPPUDDLE_WITH_HPX=ON"
#endif

#include <stdexcept>
#define DEBUG_AGGREGATION_CALLS 1

Expand Down Expand Up @@ -48,6 +52,16 @@
#include "../include/stream_manager.hpp"
#include "../include/detail/config.hpp"

#ifndef CPPUDDLE_HAVE_HPX_MUTEX
#pragma message \
"Work aggregation will use hpx::mutex internally, despite CPPUDDLE_WITH_HPX_MUTEX=OFF"
#pragma message \
"Consider using CPPUDDLE_WITH_HPX_MUTEX=ON, to make the rest of CPPuddle also use hpx::mutex"
#endif
namespace recycler {
using aggregation_mutex_t = hpx::mutex;
}

//===============================================================================
//===============================================================================
// Helper functions/classes
Expand Down
2 changes: 0 additions & 2 deletions include/detail/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ namespace recycler {

#if defined(CPPUDDLE_HAVE_HPX) && defined(CPPUDDLE_HAVE_HPX_MUTEX)
using mutex_t = hpx::spinlock_no_backoff;
using aggregation_mutex_t = hpx::mutex;
#else
using mutex_t = std::mutex;
using aggregation_mutex_t = std::mutex;
#endif

// Recycling configuration
Expand Down

0 comments on commit 9470852

Please sign in to comment.