PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Unified binary for accelerators, serial?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
mkcolg



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

PostPosted: Wed Nov 06, 2013 1:02 pm    Post subject: Reply with quote

Quote:
Do you know of any workaround to achieve my goal or will I always have to produce two binaries, i.e. one compiled with -mp only and the other compiled with -acc only?
You don't need two binaries, but would need two different code paths, one OpenMP enabled and one OpenACC enabled. You then set a flag in your code to determine which code path to take.

Since you're using MPI, I could imagine scenarios where some processes run OpenMP and others run OpenACC depending upon the resources available and how the domain is decomposed.

- Mat
Back to top
View user's profile
lschneid



Joined: 22 Mar 2013
Posts: 7

PostPosted: Wed Nov 06, 2013 3:22 pm    Post subject: Reply with quote

Quote:

You don't need two binaries, but would need two different code paths, one OpenMP enabled and one OpenACC enabled. You then set a flag in your code to determine which code path to take.

OK, that would be a solution, however, it would come at the expense of code duplication if I understand you correctly:
Code:

if(accelerator_attachedd){
#pragma acc kernels ....
  /*
   loop nests
 */

}else{
#pragma omp parallel ...
  /*
   loop nests
 */
}


For larger kernel regions keeping the two paths in sync could be error prone.

Quote:

Since you're using MPI, I could imagine scenarios where some processes run OpenMP and others run OpenACC depending upon the resources available and how the domain is decomposed.


I would imagine that the load balancing could be tricky especially if you don't know the cluster composition of your customers.

Anyway, thanks a lot for your quick feedback. Really appreciated.

Best,
LS
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Nov 06, 2013 4:35 pm    Post subject: Reply with quote

Quote:
OK, that would be a solution, however, it would come at the expense of code duplication if I understand you correctly:
Correct. Not ideal, but will work.

Quote:
I would imagine that the load balancing could be tricky especially if you don't know the cluster composition of your customers.
Absolutely! There's a PhD candidate, Tom Scogland, at Virginia Tech who's looking at this problem as part of his thesis. (http://tom.scogland.com/).

- Mat
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 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