PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

How does one compile numa code in PGI 11 and newer?
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
David Gunter



Joined: 15 Sep 2005
Posts: 25

PostPosted: Thu Apr 19, 2012 12:29 pm    Post subject: How does one compile numa code in PGI 11 and newer? Reply with quote

Here's another problem we've run into. This code should query the numa system but we cannot get it to work.

Code:
#include <numa>
#include <stdio>

int main(){

   int max;

   max = numa_max_node();
   printf("Max nodes: %d\n", max);

   if (numa_available() < 0) {
      printf("Your system DOES NOT support the NUMA API.\n");
   } else {
      printf("Your system DOES support the NUMA API.\n");
   }
   return 0;
}


Compiled with

Code:
 pgcc -o numa_test numa_test.c -lnuma


Whether we put the "-lnuma" option in or not, the output of the program is always

Code:
Max nodes: 6451072
Your system DOES NOT support the NUMA API.
Back to top
View user's profile
David Gunter



Joined: 15 Sep 2005
Posts: 25

PostPosted: Thu Apr 19, 2012 12:31 pm    Post subject: Reply with quote

More info about this problem (the forum software wouldn't let me add this to the original post without really screwing up the format).


$ ldd numa_test
linux-vdso.so.1 => (0x00007fff3e393000)
libnuma.so.1 => /usr/lib64/libnuma.so.1 (0x00002b10d878d000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b10d8996000)
libm.so.6 => /lib64/libm.so.6 (0x00002b10d8bb2000)
libc.so.6 => /lib64/libc.so.6 (0x00002b10d8e36000)
/lib64/ld-linux-x86-64.so.2 (0x00002b10d856b000)
[/code]

This happens on all of the versions of PGI we have > 11. So PGI 11.10, 12.1 and 12.4.

This is on many of our systems, the newest being a RHEL 6.2 system, base gcc 4.4.6 and glibc-2.12-1.47.
Back to top
View user's profile
mkcolg



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

PostPosted: Thu Apr 19, 2012 2:18 pm    Post subject: Reply with quote

Hi David,

Starting with 11.x compilers, the PGI drivers will link by default with the PGI OpenMP libraries. For non-OpenMP codes, this includes linking with a NUMA stub object "nonuma.o". So what's happening here is that "numa_available:" is being resolved by the stub version not the library version.

You can work around this issue by adding to the link the flag "-mp" or "-nomp -lnuma". The default is to use the "-mp=nonuma" option.

Hope this helps,
Mat
Code:
% pgcpp numa.o -V12.4 ; a.out
Max nodes: 0
Your system DOES NOT support the NUMA API.

% pgcpp numa.o -V12.4 -mp ; a.out
Max nodes: 0
Your system DOES support the NUMA API.

% pgcpp numa.o -V12.4 -nomp -lnuma ; a.out
Max nodes: 0
Your system DOES support the NUMA API.
Back to top
View user's profile
David Gunter



Joined: 15 Sep 2005
Posts: 25

PostPosted: Fri Apr 20, 2012 10:26 am    Post subject: Reply with quote

And where has this been documented?
Back to top
View user's profile
mkcolg



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

PostPosted: Fri Apr 20, 2012 4:09 pm    Post subject: Reply with quote

PGI 2011 release notes under Chapter 2 "New or Modified Features".

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