PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Programming multi-gpus with accelerator directives
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
sslgamess



Joined: 23 Nov 2009
Posts: 35

PostPosted: Fri Jan 06, 2012 2:11 am    Post subject: Programming multi-gpus with accelerator directives Reply with quote

Are there any examples available of using openmp and accelerator directives to program multiple gpus?

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



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

PostPosted: Fri Jan 06, 2012 11:09 am    Post subject: Reply with quote

Hi Sarom,

Off hand, I don't have one that I can share. I've done it before, but in the context of proprietary customer code. I do have a good example using MPI with the PGI Accelerator Model that I'm planning on using for my next PGinsider Article that you can have.

Personally, I find MPI much easier to work with when using Multi-GPUs. Not that you can't use OpenMP, it's just that OpenMP often requires more rewriting of code. Your basic outline of would be something like:
Code:

1) start an OpenMP parallel region
2) associate each thread with a particular device (the context)
3) manually divide the problem among threads.
4) create the acceleration region for this threads segment of the problem.
5) shut down the device context
6) exit the OpenMP region

Granted, this is no different than MPI, but this is normally how MPI is programmed. With OpenMP most users just let the compiler figure things out, but with the compiler doesn't yet have the ability to automatically manage multiple discrete memories. On an SMP system, there's only the one memory system.

- Mat
Back to top
View user's profile
sslgamess



Joined: 23 Nov 2009
Posts: 35

PostPosted: Fri Jan 06, 2012 2:05 pm    Post subject: Reply with quote

Hi Mat,

I'm willing to give MPI a try. May I have access to this PGInsider Article?

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



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

PostPosted: Fri Jan 06, 2012 2:56 pm    Post subject: Reply with quote

Quote:
May I have access to this PGInsider Article?
Well, I haven't written the article yet, but I'll send you the code via email. It's the source from my SEISMIC_CPML presentations I gave at SC11.

- Mat
Back to top
View user's profile
sslgamess



Joined: 23 Nov 2009
Posts: 35

PostPosted: Sat Jan 07, 2012 3:33 pm    Post subject: Reply with quote

Thanks Mat,

I managed to get a multi-gpu code working using OpenMP.

It took a while to figure out that I can't compile using the 'time' suboption in the target accelerator flag.

A wishlist item may be an additional suboption to pin the timing to a specific device number?
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming 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