46 template <
typename Fn,
typename... Args>
54 using retval_t = std::invoke_result_t<Fn, Args...>;
55 if constexpr (std::is_void_v<retval_t>) {
58 std::forward<Fn>(fn), std::forward<Args>(
args)...);
65 static_assert(std::is_trivially_copyable_v<retval_t>);
69 std::forward<Fn>(fn), std::forward<Args>(
args)...);
108 template <
typename Fn,
typename... Args>
114 using retval_t = std::invoke_result_t<Fn, Args...>;
115 if constexpr (std::is_void_v<retval_t>) {
127 auto ret = fn(
args...);
#define ITYR_CHECK(cond)
Definition: util.hpp:48
MPI_Comm mpicomm()
Definition: topology.hpp:206
va_list args
Definition: util.hpp:76
void mpi_barrier(MPI_Comm comm)
Definition: mpi_util.hpp:42
auto root_exec(Fn &&fn, Args &&... args)
Definition: ito.hpp:50
auto coll_exec(const Fn &fn, const Args &... args)
Definition: ito.hpp:72
bool is_root()
Definition: ito.hpp:66
bool is_spmd()
Definition: ito.hpp:61
constexpr with_callback_t with_callback
Definition: thread.hpp:11
void poll()
Definition: ori.hpp:224
void release()
Definition: ori.hpp:196
void acquire()
Definition: ori.hpp:206
Definition: allocator.hpp:16
auto coll_exec(const Fn &fn, const Args &... args)
Execute the same function collectively on all processes.
Definition: root_exec.hpp:109
auto root_exec(Fn &&fn, Args &&... args)
Spawn the root thread (collective).
Definition: root_exec.hpp:47