openmp의 parallel region과 nested parallel region차이가 궁금합니다.
글쓴이: Geniys / 작성시간: 수, 2006/08/30 - 11:39오전
인터넷에서 찾아보니 parallel region에 대한 설명 있었습니다.
parallel region에서 다른 thread들이 끝날때까지 기다린다고 설명이 되어 있고,
nested parallel region에 대해 나오는데 제가 이해하기에는 무슨 차이 인지 모르겠습니다.
영어 실력이 안되서 ^^;
어떤 차이기 있는건지 궁금합니다.
OpenMP uses a fork-join model of parallel execution. When a thread encounters a parallel construct, the thread creates a team composed of itself and some additional (possibly zero) number of threads. The encountering thread becomes the master of the new team. The other threads of the team are called slave threads of the team. All team members execute the code inside the parallel construct. When a thread finishes its work within the parallel construct, it waits at the implicit barrier at the end of the parallel construct. When all team members have arrived at the barrier, the threads can leave the barrier. The master thread continues execution of user code beyond the end of the parallel construct, while the slave threads wait to be summoned to join other teams. OpenMP parallel regions can be nested inside each other. If nested parallelism is disabled, then the new team created by a thread encountering a parallel construct inside a parallel region consists only of the encountering thread. If nested parallelism is enabled, then the new team may consist of more than one thread. The OpenMP runtime library maintains a pool of threads that can be used as slave threads in parallel regions. When a thread encounters a parallel construct and needs to create a team of more than one thread, the thread will check the pool and grab idle threads from the pool, making them slave threads of the team. The master thread might get fewer slave threads than it needs if there is not a sufficient number of the idle threads in the pool. When the team finishes executing the parallel region, the slave threads return to the pool.
Forums:
댓글 달기