PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

omp_set_num_threads error

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



Joined: 22 Mar 2006
Posts: 3

PostPosted: Wed Mar 22, 2006 7:58 am    Post subject: omp_set_num_threads error Reply with quote

Hello,

I am porting some OpenMP code to a 4P AMD Opteron box which we bought the PGI compilers for. The code runs fine on our Sun box. When I call omp_set_num_threads( int ) routine, it causes an error. It turns out that if I set the number of threads to anything other than 1, it fails (which is obviously not useful)

omp_get_num_procs returns 4, but omp_get_max_threads returns 1. I tried setting OMP_NUM_THREADS, and I get similar results. Is there something I need to do on the compile line other than -mp? Is there something I should set with the OS? (SuSE 9.x)?

Thanks,
Jim
Back to top
View user's profile
jklucar



Joined: 22 Mar 2006
Posts: 3

PostPosted: Wed Mar 22, 2006 11:17 am    Post subject: I may have answered my own question Reply with quote

Turns out that the Sun platform has 4 dual core processors, and the nubmer of threads was being set to 8 somewhere I hadn't checked. When I back then number of threads down to 4, things seemed to work. I know setting the number of threads > num procs is bad, but I thought it would let you do it anyways. Is this a bug or is there some way to have it just warn me about this problem?

Thanks,
Jim
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6129
Location: The Portland Group Inc.

PostPosted: Wed Mar 22, 2006 12:32 pm    Post subject: Reply with quote

Hi Jim,

Settting the environment variable "MP_WARN" to "no" will disable the warning message you get when you try to run more threads then you have processors. Though with or without the warning, the number of threads you set is the number of threads that would be run.

What you may be encountering is that the basic PGI Workstation license restricts you a max of 4 sockets (a dual-core CPU is considered a single socket). Which type of product do you have, Workstation, Server, or CDK? Are the Opterons dual-core?

Thanks,
Mat
Back to top
View user's profile
jklucar



Joined: 22 Mar 2006
Posts: 3

PostPosted: Fri Mar 24, 2006 7:17 am    Post subject: Reply with quote

Mat,

I checked with our admin and we do have the Workstation license, and our Opterons are of the single core variety. I am also using C++, so I guess what is happening is that omp_set_num_threads() is throwing an exception that I'm not catching. I can do some experimentation with this at some point to see if that's what's really happening.
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