Potential speed-up from using less shared memory: C + OpenMP

General OpenMP discussion

Potential speed-up from using less shared memory: C + OpenMP

Postby LUCA » Sat Dec 31, 2011 4:25 pm

I have a C-OMP program, with several large public arrays (two double arrays of 10x1000x1000, three double of 2x1000x1000, and four double 1000x1000, over a 1000x1000 simulation mesh). These arrays are relatively sparse, and only about 20% of the elements are actually involved in the calculation.
The current memory usage is :
Max Memory : 409 MB
Max Swap : 641 MB

I am thinking to change such arrays smaller for only the useful elements. Then in the calculation we have to map an array index and the actual domain location back and forth.

My question now are: is the large memory usage a major concern in OpenMP? Can we expect some speed-up by reducing the mamory usage?

Thanks in advance.
LUCA
 
Posts: 1
Joined: Sat Dec 31, 2011 3:30 pm

Re: Potential speed-up from using less shared memory: C + Op

Postby ftinetti » Mon Jan 09, 2012 11:31 am

My question now are: is the large memory usage a major concern in OpenMP? Can we expect some speed-up by reducing the mamory usage?

a) Memory usage is a major concern independently of OpenMP or any other spec/library.
b) Reducing and, better, eliminating swap memory access should always produce performance gains.

My first suggestion would be that you reduce memory usage or, at least, optimize memory access so that every time you have some data in RAM you use it as many times you can.

HTH.
ftinetti
 
Posts: 575
Joined: Wed Feb 10, 2010 2:44 pm

Re: Potential speed-up from using less shared memory: C + Op

Postby MarkB » Fri Feb 17, 2012 5:45 am

LUCA wrote:My question now are: is the large memory usage a major concern in OpenMP? Can we expect some speed-up by reducing the mamory usage?


If your code is swapping to disk, then yes, but your large arrays only occupy 8*30*1000*1000 = 240MB so I suspect this is not going to help much.
20% sparsity is very much around the point where the gains from not storing the unnecessary data are offset by the additional cost of indirect addressing.
If the large arrays are shared between the threads, then whether you are using OpenMP or not is largely irrelevant.
MarkB
 
Posts: 428
Joined: Thu Jan 08, 2009 10:12 am


Return to Using OpenMP

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests