PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Memory Requirements
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
andyh



Joined: 23 May 2005
Posts: 7

PostPosted: Fri May 27, 2005 12:12 pm    Post subject: Memory Requirements Reply with quote

I am currently evaluating on an Opteron 4 processor system.

With a large code written for one processor, the gcc compiler running a particular problem utilizes about 4GB memory. When compiling with pgcc the same application and data, the program uses nearly 20GB. We have set-up memory for node-interleave. The large overhead occurs whether compiling with just -g or various faster optimizations.

Is this overhead typical and will it remain (the system has 32 GB of memory).

Thanks,

Andy
Back to top
View user's profile
mkcolg



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

PostPosted: Fri May 27, 2005 1:02 pm    Post subject: Reply with quote

Hi Andy,

We have not seen this type of issue before, and don't have a good
explaination as of yet.

What is the output of commands 'size exe' and 'ldd exe' for the gcc and
pgcc built executables?

How are you determining memory usage?

Thanks,
Mat
Back to top
View user's profile
andyh



Joined: 23 May 2005
Posts: 7

PostPosted: Tue May 31, 2005 6:21 am    Post subject: Reply with quote

Mat,

You bring up a good point on how memory was checked - I used the gnome-system-moniter. It cannot access individual process memory usage above 2GB. However, I have found it reliable in determining system load. I will perform tests to crash the system with too much memory to make sure. The program itself is relatively small, but we are using allot of memory.

ldd results:

libthread.so.o => /lib64/tls/libthread.so.0 0x0000003845a00000
libc.so.6 => /lib64/tls/libc.so.6 0x0000003844b00000
=> 0x0000003844b00000
/lib64/ld-linux-x86-64.so.2 0x0000003844900000

and size results:

text 178707
data 25788
bss 37760
dec 242255
hex 3b24f

Andy
Back to top
View user's profile
andyh



Joined: 23 May 2005
Posts: 7

PostPosted: Tue May 31, 2005 6:37 am    Post subject: Reply with quote

As per last post, I double the data size for the job, and the process began to use swap space so I killed it. I think the g-s-m was correctly showing the amount of memory requested.

I was allocating memory in a peicemeal sloppy manner. For example:

x = (double **) calloc(dim1,sizeof(double *));
for (i=0; i<dim1; i++)
x[i] = (double *) calloc(dim2,sizeof(double));

I could allocate as a continuous block and then reference with multi-dimensional pointers. For example:

dataBlock = (double *) malloc(dim1 * dim2 * sizeof(double);

and then have x[i] rows of dim1 point to dataBlock columns of dim2.

Would that sort of memory allocation help?

Andy
Back to top
View user's profile
mkcolg



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

PostPosted: Tue May 31, 2005 12:09 pm    Post subject: Reply with quote

Hi Andy,

The compiler doesn't do the actual memory allocation. This is handled by the OS via the calloc and malloc system function calls so we're a bit perplexed. Is it possible for you to send us the code so we can try to determine what's going on?
Quote:
I could allocate as a continuous block and then reference with multi-dimensional pointers. For example:
dataBlock = (double *) malloc(dim1 * dim2 * sizeof(double);
and then have x[i] rows of dim1 point to dataBlock columns of dim2.
Would that sort of memory allocation help?

Either method should yield the same result. However, if you use the second method and the size given to malloc is greater that 2Gb, you'll need to compile with '-mcmodel=medium'. You should also add '#include <malloc.h>', if you haven't already, in order to ensure the correct 64-bit prototype is used for malloc.

- 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