3F function and MPI

Hi,

one user reported a problem using 3F functions.

Using the normal pgi comipler everything is fine.
using mpif90 (from pgi) the 3F functions are NOT working.

Whats wrong ?

mpif90 -o read_test read_test.f90
./read_test
0
0

Aber mit pgf90 compiliert funktioniert es richtig:

pgf90 -o read_test read_test.f90
./read_test
0
40


code:
program read_test

implicit none

integer :: ftell

integer :: ihead(8)

open(11, FILE=“landsea.srv”, STATUS=‘old’, FORM=‘unformatted’)
write(,) ftell(11)
read(11) ihead
write(,) ftell(11)
close(11)

end

Hi pekompi,

It looks like a library ordering issue. The mpif90 driver is adding the F77 runtime before the F90 runtime library so ftell is pick-up up the F77 I/O. Since the F77 and F90 I/O are completely separate, ftell shows that the file hasn’t moved.

The workaround is to add “-lpgf90rtl” to the mpif90 link so that the ftell uses the F90 I/O.

% mpif90 mp.f90 ; a.out
            0
            0
% mpif90 mp.f90 -lpgf90rtl ; a.out
            0
           24

I have submitted a problem report (TPR#18598) requesting the mpif90 that we ship be updated.

  • Mat

This TPR was fixed in our 12.5 release.

Sorry about the late word.

dave