Slow TRANSFER performance with PGI


I’m a software developer at MeteoSwiss, where we are currently in the process of moving our numerical weather model from Cray to PGI compiler. We were having a few performance problems, though most are solved now. One thing we noticed, is that the Fortran TRANSFER function is really slow with pgi. We use this function in a critical part of our output, to cast an array to a stream of bits, and we observe a 10-20x slowdown in that part compared to cray compiler. We were wondering if we are missing some option that we didn’t set during compilation, or why the PGI implementation is so much slower.

To isolate this I prepared an example:

Compiling with ‘pgfortran -O3 -o transfer transfer.f90’ and running this on our machine I get a time of around 10s per call to TRANSFER, for a total runtime of ~20s. Comparing this to gnu and cray, I get 1.3s and 1.1s total runtime, respectively. This means the PGI version is a factor of 10-20x slower.


Thanks Yannick. I was able to reproduce the problem here so have added a problem report, TPR #27876, and sent it to our engineers for further investigation.


Hi Mat, thanks for the quick response! Keep me in the loop if you have a fix or workaround. This could possibly save us 2-3min of total runtime (~5%) in our model.