I had a pgf77 code that could not be used for large arrays. So, I went ahead and wrote a pgf90 code with dynamic allocation and modules. I have made sure that the overall number of arrays created have reduced drastically. For same array size, I found that the pgf90 code was taking much less memory compared to the pgf77 code. But when I increased my array size, I find that, although only 85% of memory is being used up, the code started to swap heavily. However, the pgf77 code for the same array size did not. Basically, it appears that the threshold beyond which the code starts to swap is lower for pgf90 than it is for pgf77.
We are compiling the codes on an AMD Dual-Opteron (not dual core) 64 bit with Red Hat Linux 2.4.2 with 4GB RAM and 4 GB swap per node. The codes are being compiled with the PG compilers (Ver. 6.0) (we have to install the latest 6.1 yet) with the following options:
pgf90 -O2 -Mextend -tp=k8-64 -mcmodel=medium
pgf77 -O2 -tp=k8-64 -mcmodel=medium
Firstly, is this a hardware issue (since the pgf77 code works fine, I am less inclined to attribute this to an issue with the hardware)
Are there any additional options that I can specify so that the memory allocation in the pgf90 version is done better to reduce swapping?
Can I use any tools to determine why the code is swapping and also to get an idea of how memory is being allocated?