and typically I loose up to 20% in performance. On big experiments (think 512^3) size matters, but it is a pain (and error prone) to maintain two code branches, when you are a small group with continious active development.
My question is: Do there exist a compiler directive, such that a hint can be given about the size of scalar variables? Say, something like:
such that the loop optimizer of the compiler (and in general the compiler) optimise the code under the assumption that nx,ny,nz take these values. Ie, such that the code runs at optimal speed for these specific values. Definetly, when optimising loops of the form:
do iz=1,nz ... enddo
the compiler, as it is now, somehow has to guess at some value for the trip count of the loop. The above directive would allow it to make an educated guess.
I would then have the convenience, when developing, of a flexible code, while at the same time gain full speed in a production run.
I have been looking for this kind of directive; am I looking in vain, or does it exist? (or can I do something similar, it is not an option to put a directive in front of every loop. We are talking 40.000 lines of code) If the directive doesn't exist. I suggest it would be a great option to have in future releases, at least from a performance point of view.