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

namespace hpx


hpx::id_type find_here(error_code &ec = throws)

Return the global id representing this locality.

The function find_here() can be used to retrieve the global id usable to refer to the current locality.


Generally, the id of a locality can be used for instance to create new instances of components and to invoke plain actions (global functions).


The global id representing the locality this function has been called on.


As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.


This function will return meaningful results only if called from an HPX-thread. It will return hpx::invalid_id otherwise.


hpx::find_all_localities(), hpx::find_locality()

  • ec: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.