PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Easy way for portability

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
valenbg



Joined: 09 May 2013
Posts: 5

PostPosted: Wed May 15, 2013 11:07 am    Post subject: Easy way for portability Reply with quote

Hi, I'm looking for a way to compile and execute code for another machine, in which I can't install anything. Both are Linux with x86 processors, and I'm using PGI with openACC directives 12.10. I want to use something like statically-linked libraries, or what I need to execute a PGI compiled binary in other system, without installing anything on it?
Thanks for your time.
Back to top
View user's profile
mkcolg



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

PostPosted: Wed May 15, 2013 12:11 pm    Post subject: Reply with quote

Hi valenbg,

You wont be able to compile a completely static binary, but can add the flag "-Bstatic_pgi" so that at least the PGI run time is statically linked.

For the OS, this should be fine if the two systems have the same GLIBC version, or the target system's GLIBC is newer than the build system. Older systems wont be able to run newer GLIBC versions.

You will need the NVIDIA driver installed on the target system in order to run an OpenACC code on an NVIDIA gpu. However, we wrap up multiple compute capability targets in a single binary so you don't need to worry if the CC of the device varies between systems. You can also compile with "-ta=nvidia,host" so that a host version of the OpenACC sections are created. The binary will then still run on a system without a GPU, albeit slower.

For the host side generated code, you can either compile to a particular target architecture (see "pgfortran -help -tp" for a list of target systems), or you can string any number of targets on the same "-tp" option to create a Unified Binary. This will ensure that the code will run on most x86 target architectures.

Hope this helps,
Mat
Back to top
View user's profile
valenbg



Joined: 09 May 2013
Posts: 5

PostPosted: Thu May 16, 2013 7:44 am    Post subject: Reply with quote

I'm having this problem when compiling with this options:

pgcc -acc -ta=nvidia,host -Bstatic_pgi -Minfo=all main.c

When I try to execute the generated binary (in the same computer), it shows me this error:

./a.out: error while loading shared libraries: libnuma.so: cannot open shared object file: No such file or directory
Back to top
View user's profile
mkcolg



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

PostPosted: Thu May 16, 2013 10:16 am    Post subject: Reply with quote

Quote:
./a.out: error while loading shared libraries: libnuma.so: cannot open shared object file: No such file or directory
Sorry, forgot that one. We link with the OpenMP libraries by default in order to support core binding. At link, you can add the flag "-nomp" or "-mp=nonuma" to not link in the NUMA libraries.

- Mat
Back to top
View user's profile
valenbg



Joined: 09 May 2013
Posts: 5

PostPosted: Thu May 16, 2013 1:31 pm    Post subject: Reply with quote

It finally seems to work with the "-mp=nonuma" flag, although with the "-nomp" flag it shows an error about calls to the pthread library. Thank you so much for your feedback.
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
Page 1 of 1

 
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