New to parallelism and learning the ropes to HPX with C++. I'm looking at a specific hello-word example that will print hello world
on every OS-thread on every locality, some output would look like:
hello world from OS-thread 1 on locality 0
hello world from OS-thread 1 on locality 1
hello world from OS-thread 0 on locality 0
hello world from OS-thread 0 on locality 1
My question is, when the program output on locality x, what exactly does locality mean? I understand OS-thread but I'm not quite sure what the program means by which locality.
Example of some code inside HPX main
this isn't necessarily required by my question, but it does include multiple calls to finding localities which relate to topic.
int hpx_main()
{
{
// Get a list of all available localities.
std::vector<hpx::naming::id_type> localities =
hpx::find_all_localities();
// Reserve storage space for futures, one for each locality.
std::vector<hpx::lcos::future<void> > futures;
futures.reserve(localities.size());
BOOST_FOREACH(hpx::naming::id_type const& node, localities)
{
// Asynchronously start a new task. The task is encapsulated in a
// future, which we can query to determine if the task has
// completed.
typedef hello_world_foreman_action action_type;
futures.push_back(hpx::async<action_type>(node));
}
// The non-callback version of hpx::lcos::wait takes a single parameter,
// a future of vectors to wait on. hpx::lcos::wait only returns when
// all of the futures have finished.
hpx::lcos::wait(futures);
}
// Initiate shutdown of the runtime system.
return hpx::finalize();
}