Operating System - HP-UX
1833323 Members
2978 Online
110051 Solutions
New Discussion

Setting number of threads in OpenMP

 
Praveen urs M.K
Occasional Contributor

Setting number of threads in OpenMP

HI,
I am using HP-UX C compiler (ver:B.11.11.02) and In that I am intreseted in setting the number of threads while using openmp.

In HP-UX C compiler version (B.11.11.04), the above can be set using the env. variable or library function. If am trying to use the same for my current version of C compiler (B.11.11.02), it will not work ....!!!!

Please give the solution for the above mentioed problem, as how to set the number of threads in HP-UX (C compiler ver: B.11.11.02) using OpenMp?


thanks in advance,
Praveen

2 REPLIES 2

Re: Setting number of threads in OpenMP

B.11.11.02 has only a partial implementation of OpenMP. Version B.11.11.04 onwards has the full OpenMP 1.0 implementation. It is better to upgrade to the latest version of the compiler which at the time of this writing is B.11.11.06.

A better forum to ask questions on the HP-UX C Compiler is the hpux-devtools mailing list. You can subscribe to this list by sending mail to majordomo@cxx.cup.hp.com with the following in the body of the message:

subscribe hpux-devtools

Regards,
Lal
With God, all things are possible
Paddy_1
Valued Contributor

Re: Setting number of threads in OpenMP

I am sure you have included omp.h.
The function you want would be
omp_set_num_threads(int n);

For example to have two threads you need to declare it as
omp_set_num_threads(2);
in your program

Hope this helps
The sufficiency of my merit is to know that my merit is NOT sufficient