Our parallel Fortran program is running more than twice slower after updating the OS to Ubuntu 14.04 and rebuilding with Gfortran 4.8.2. To measure which parts of the code were slowed down is unfortunately not possible any more (not without downgrading the OS) since I did not save any profiling information for gprof when compiling under the old OS.
Because the program does lots of matrix inversions, my guess is that one library (LAPACK?) or programming interface (OpenMP?) has been updated between Ubuntu 12 and 14 in a way that slows down everything. I believe this is a general problem which could be already known to somebody here. Which is the solution to get back to a fast Fortran code, besides downgrading back to Ubuntu 12 or 13?
All libraries were installed from the repositories with apg-get and thus,they should have be also upgraded when I upgraded the system with apt-get dist-upgrade
, I could, however, check if they are indeed the latest versions and/or build them from scratch.
I followed Steabert's advice and profiled the present code: I recompiled with gfortran -pg
and checked the performance with gprof
. The program was suspiciously slow when calling some old F77 subroutines, which I translated to f90 without performance improvement. I played with the suggested flags and compared the time of one program iteration: Flags -fno-aggressive-loop-optimizations
, -llapack
and -lblas
did not yield any significant performance improvement. Flags -latlas
, -llapack_latlas
and -lf77blas
did not compile (/usr/bin/ld: cannot find -lf77blas
, etc.), even though the libraries exist and are in the right path. Both the compiler flags playing and performance analysis suggest that my first guess (the slowing down being related to matrix inversions, LAPACK, etc.) was wrong. It rather seems that the slowing down is in a part of the code where no heavy linear algebra is performed. Using objdump my_exec -s
I have found out that my program was originally compiled with gfortran 4.6.3 before the OS upgrade. Instead of using the present gfortran (4.8.2). I could try now to compile the code with the old compiler.