PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

openmp

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
SWL_EGGBABY



Joined: 16 Dec 2009
Posts: 31

PostPosted: Sun Jul 08, 2012 11:25 pm    Post subject: openmp Reply with quote

PROGRAM MAIN
INTEGER I
INTEGER omp_get_thread_num
!$OMP PARALLEL PRIVATE(I)
!$OMP SINGLE
DO I = 1, 10
CALL SLEEP(MOD(I,2))
PRINT *,"TASK ",I," REGISTERED BY THREAD ",omp_get_thread_num()
!$OMP TASK FIRSTPRIVATE(I)
CALL SLEEP(MOD(I,5))
PRINT *,"TASK ",I," EXECUTED BY THREAD ",omp_get_thread_num()
!$OMP END TASK
ENDDO
!$OMP END SINGLE
!$OMP END PARALLEL
END



my cpu has eight core but the result is single-threaded why?


TASK 1 REGISTERED BY THREAD 0
TASK 1 EXECUTED BY THREAD 0
TASK 2 REGISTERED BY THREAD 0
TASK 2 EXECUTED BY THREAD 0
TASK 3 REGISTERED BY THREAD 0
TASK 3 EXECUTED BY THREAD 0
TASK 4 REGISTERED BY THREAD 0
TASK 4 EXECUTED BY THREAD 0
TASK 5 REGISTERED BY THREAD 0
TASK 5 EXECUTED BY THREAD 0
TASK 6 REGISTERED BY THREAD 0
TASK 6 EXECUTED BY THREAD 0
TASK 7 REGISTERED BY THREAD 0
TASK 7 EXECUTED BY THREAD 0
TASK 8 REGISTERED BY THREAD 0
TASK 8 EXECUTED BY THREAD 0
TASK 9 REGISTERED BY THREAD 0
TASK 9 EXECUTED BY THREAD 0
TASK 10 REGISTERED BY THREAD 0
TASK 10 EXECUTED BY THREAD 0
请按任意键继续. . .
Back to top
View user's profile
SWL_EGGBABY



Joined: 16 Dec 2009
Posts: 31

PostPosted: Mon Jul 09, 2012 1:36 am    Post subject: openmp Reply with quote

I have resolved it myself
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group