HPX - High Performance ParalleX

PrevUpHomeNext

Function get_locality_id

hpx::get_locality_id — Return the number of the locality this function is being called from.

Synopsis

// In header: <hpx/hpx_fwd.hpp>


boost::uint32_t get_locality_id(error_code & ec = throws);

Description

This function returns the id of the current locality.

[Note] Note

The returned value is zero based and its maximum value is smaller than the overall number of localities the current application is running on (as returned by get_num_localities()).

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 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, if this is pre-initialized to hpx::throws the function will throw on error instead.


PrevUpHomeNext