hpx::get_thread_pool_num

hpx::get_thread_pool_num#

Defined in header hpx/runtime.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

See also:

std::size_t hpx::get_thread_pool_num() noexcept#

Return the number of the current thread pool the current HPX-thread is executed with.

This function returns the zero based index of the thread pool which executes the current HPX-thread.

Note

The returned value is zero based and its maximum value is smaller than the number of thread pools started by the runtime. It will return -1 if the current thread pool is not a known thread pool or if the runtime is not in running state.

Note

This function needs to be executed on a HPX-thread. It will fail otherwise (it will return -1).

std::size_t hpx::get_thread_pool_num(error_code &ec) noexcept#

Return the number of the current thread pool the current HPX-thread is executed with.

This function returns the zero based index of the thread pool which executes the current HPX-thread.

Note

The returned value is zero based and its maximum value is smaller than the number of thread pools started by the runtime. It will return -1 if the current thread pool is not a known thread pool or if the runtime is not in running state.

Note

This function needs to be executed on a HPX-thread. It will fail otherwise (it will return -1).

Parameters:

ec – [in,out] this represents the error status on exit (obsolete, ignored).