PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

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



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

PostPosted: Thu May 18, 2006 3:39 pm    Post subject: Reply with quote

Hi Winston,

I was afraid someone would ask ;-) First, the cavet is that the process is highly dependent upon the flavor of MPI your working with. You will need to modify the following script and it may not work with all MPI implementations. Also, I'm assuming you're using a 4 CPU SMP systems.

The basic idea is that you create a wrapper script to launch your application and use "taskset" to bind each process to an individual processor. The processor used is dependant upon a MPI environment variable. Using LAM/MPI as an example, we would start-up lamboot and use mpirun to start-up our script.
Code:

 % lamboot -v hostfile
 % mpirun -np 4 run_script

"run_script" uses the LAM environment variable "LAMRANK" to determine which process to run on which processor.
Code:
#!/bin/csh -f

if ("$LAMRANK" == "0") then
 echo "RANK 0...."
 taskset 0x1 a.out
else if("$LAMRANK" == "1") then
 echo "RANK 1...."
 taskset 0x4 a.out
else if("$LAMRANK" == "2") then
 echo "RANK 2...."
 taskset 0x10 a.out
else
 echo "OTHER RANKS...."
 taskset 0x14 a.out
endif
exit 0


Again, you'll need to modify this for your individual needs and it may not work for all MPI versions.

Have Fun!
Mat
Back to top
View user's profile
whao



Joined: 26 Aug 2005
Posts: 2

PostPosted: Fri May 19, 2006 7:12 am    Post subject: Reply with quote

Hi Mat,

Thanks for the information.

Our application is using MPICH (1.2.6) on a dual dual-core Opteron cluster. I am wondering if you can provide some pointers on how to do this on MPICH set-up.

I was searching on the web and found Per Ekman's work ( http://www.pdc.kth.se/~pek/linux/ ) He posted code patch for MPICH/MPICH2 on ch_shmem device, but I thought what I need is the patch on ch_p4 device. I did not pursue that thread further.

Thanks again.

-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 Previous  1, 2
Page 2 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