PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

parallel computation by using pgcc compiler in dual core mac
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Sitha



Joined: 09 May 2006
Posts: 2

PostPosted: Tue May 09, 2006 1:47 am    Post subject: parallel computation by using pgcc compiler in dual core mac Reply with quote

I am using dual core workstation. it has 8 processors. can i control each processsors myself to do parallel computation?
Back to top
View user's profile
mkcolg



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

PostPosted: Wed May 10, 2006 9:37 am    Post subject: Reply with quote

Hi Sitha,

Which OS are you using? What type of parallel computation paradigm are you performing, MPI, OpenMP, Auto-parallelization, Threads?

I'm guessing your asking how to bind a OMP thread to a processor on Linux. If this is the case then you a variety of options. First you need ot set the environment variable "NCPUS" (or "OMP_NUM_THREADS") to the number of processors your application should use and must be set no matter how you bind your threads.

The first option, which most systems support, is "taskset" (see "man taskset" for more info) where you give it a hexadecimal bitmask (or numerical list if using "-c") corresponding to the CPUs your processes are allowed to use. However, it's not needed it your using all the processors unless you need them bound in a particular order.

On NUMA enabled systems, you should also investigate the use of "numactl". Like taskset, you are able to bind a set of threads to a set of processors. However, NUMA generally does a better job of memory management. It doesn't have as fine grain control as taskset so you can only assign threads by socket not CPU. This only matters for multi-core chips since with single-core chips the socket and CPU are analogous. For multi-core chips, you can use both "numactl" and "taskset" to get finer control.

With the recent releases of the PGI compilers (6.0 and newer) on both Linux and Windows, when linking with "-mp" option, the NUMA libraries are linked in with your application on systems which support NUMA. (With 6.0 you need to use "-mp=numa"). So instead of using "numactl" or "taskset", when linked with "-mp" you can do the same thing by simply setting the environment varaibles "MP_BIND" and "MP_BLIST". Setting "MP_BIND" to "yes", tells the runtime to bind your threads to a set of processors. "MP_BLIST" is the list of processors to bind to and the order in which they are bound. For example "setenv MP_BLIST 7,5,3,1,6,4,2,0", will bind your threads starting at CPU #7 (the 8th processor) and interleave them accross the rest of the CPUs. Unlike "numactl", the grainularity is by CPU not socket.

Binding MPI threads to particular CPUs is a bit more complex, but "doable". Let me know if you need help with this.

- Mat
Back to top
View user's profile
Sitha



Joined: 09 May 2006
Posts: 2

PostPosted: Thu May 11, 2006 1:06 am    Post subject: Reply with quote

Thank you very much for your useful information. but i need more help from you. I am using CENT OS in my workstation. and PGI compiler is release 6.1 I hope this is the latest version. My machine is called as dual core machine. But when I checked the cpu info it shows as 8 cpus it has. I dont understand well about it. When i run MPI program it shows only one node is there.
I am confusing well. Pls help me where were the problem in my machine.
Thank you.

Sitha

i
Back to top
View user's profile
mkcolg



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

PostPosted: Thu May 11, 2006 8:35 am    Post subject: Reply with quote

Hi Sitha,

Multi-core chips now being produced by AMD and Intel, contain 2 or more CPUs on the same chip and connect to the motherboard via a single socket. Although the CPUs on these chip do share some components, they can logically be thought as distinct. So while you may have a 4 socket, dual-core system, you can logically think of it as having 8 distinct and separate CPUs.

Code:
When i run MPI program it shows only one node is there.

Do you have your system only listed once in the machine.LINUX file? It should be listed 8 times in this file or have a ":8" after its name, i.e. "systemname:8".

- Mat
Back to top
View user's profile
whao



Joined: 26 Aug 2005
Posts: 2

PostPosted: Thu May 11, 2006 9:25 am    Post subject: Reply with quote

Hi Mat,

I am interested in knowing how to bind MPI threads to CPUs. Would you please show us how to do it? Thanks.

-Winston
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
Goto page 1, 2  Next
Page 1 of 2

 
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