HPX - High Performance ParalleX

PrevUpHomeNext

Function find_locality

hpx::find_locality — Return the global id representing an arbitrary locality which supports the given component type.

Synopsis

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


naming::id_type 
find_locality(components::component_type type, error_code & ec = throws);

Description

The function find_locality() can be used to retrieve the global id of an arbitrary locality currently available to this application which supports the creation of instances of the given component type.

[Note] Note

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

[Note] Note

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::naming::invalid_id otherwise.

See Also:

hpx::find_here(), hpx::find_all_localities()

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.

type

[in] The type of the components for which the function should return any available locality.

Returns:

The global id representing an arbitrary locality currently available to this application which supports the creation of instances of the given component type. If no locality supporting the given component type is currently available, this function will return hpx::naming::invalid_id.


PrevUpHomeNext