병렬 처리에 익숙하지 않고 C++로 HPX에 로프를 익히는 것에 익숙합니다.병렬 처리의 지역
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
내 질문은, 지역 X에 때 프로그램 출력 이다 : 나는 모든 지역의 모든 OS 스레드에 hello world
을 인쇄 할 특정 안녕하세요 단어 예제를 찾고 있어요, 일부 출력은 같을 것이다 정확히 지역적 의미는 무엇입니까? 나는 OS 쓰레드를 이해하고 있지만 어떤 프로그램이 어떤 지역에서 무엇을 의미하는지 잘 모르겠습니다.
일부 코드의 예는 HPX main
이지만 내 질문에는 반드시 필요한 것은 아니지만 주제와 관련된 지역을 찾는 전화가 여러 번 포함됩니다.
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();
}
그래서 코드가'hpx :: find_all_localities();'를 호출하면 프로그램에 사용할 수있는 모든 사용 가능한 프로세스를 찾고 있습니까? –
나는 그것을 발견했을 때부터 말하고 싶지 않다. 코드를 실행하는 이미 알려진 프로세스의 ID를 검사한다고 말하고 싶습니다. – evenro