*allowing* array overflow

I have a very odd problem. I am trying to run a code that relies on array overflow to work properly. I did not write this code! The originators had to compile it with the flag “tp=piii” to force the compiler to refrain from optimizations that defeated the array overflow. I guess the idea is that compilers written for the old P3 were too primitive to do this sort of thing. Now, when I try to do the same thing, I get the message “pgf90-Fatal --tp piii is not supported in this installation.” So I can’t do the same thing.

So: Does pgf90 in its default operation defeat the sort of array overflow the code needs? The people I am working with obviously think it does. And, if it does, could there be some other flag(s) I could use to get what I need from the “-tp=piii” flag?

Bet you never thought you would get a question like this! Just think how I feel.

Hi Cablesb,

Does pgf90 in its default operation defeat the sort of array overflow the code needs?

First, by “overflow”, I’m assuming you mean reading/writing beyond an array’s bounds. Unless you add bounds checking (-Mbounds, -C) the compiler isn’t going to prevent the program from writing/reading outside the bounds of an array. I suspect that the problem is that the original authors made some assumptions about data layout?

How does the code fail? Most likely it’s more to do with an optimization that isn’t performed when targeting a Pentium 3 (-tp=piii), or that we target SSE for all targets except for a P3 which uses the old x87 FPU. What happens if you compile at “-O0 -tp=px-64” (i.e. no optimization and target a generic 64-bit system)?

Note that we do still support the “-tp=piii” option. However, I suspect that your system does not have the OS’s 32-bit compatibility libraries installed. Hence, when you installed the PGI compilers, our 32-bit compilers were not install. So if there is no other way to get this code working, please go back and get the 32-bit compilers installed.

  • Mat

Yes, I mean writing beyond the array’s bounds. And, yes, it look slike I don’t have the 32-bit libraries in place. Question: When I re-install PGI, I don’t want to lose anything, especially the CUDA capabilities that we paid for. Is there a particularly safe way to re-install, or will everything be taken care of automatically? Thanks.

Is there a particularly safe way to re-install, or will everything be taken care of automatically?

It shouldn’t a problem. The installer would just overwrite existing PGI files with the identical file. The one configuration file, localrc, would be regenerated but would just produce the same file.

  • Mat