Welcome, Guest
Username: Password: Remember me

TOPIC: Skipping records in Serafin -- an unformatted sequential file

Skipping records in Serafin -- an unformatted sequential file 8 years 9 months ago #19637

  • jaj
  • jaj's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 69
  • Thank you received: 7
Hello,

I have just made a new topic by Intel Developer Zone concerning reading Serafin files with codes compiled with optimised Intel Fortran Compiler 15 and 16. Shortly: we have read errors everywhere we try to skip some Serafin file records to get to a place where we want to read (classical examples skipgeo, find_in_sel). There is a workaround, but it is rather all too simple. Improving things "for the compiler" would require providing work space to the read routines of BIEF, probably a lot of changes in interfaces.

Has anyone been confronted with this problem? Any other workarounds?

Best regards,
jaj

Post by Intel Developer Zone

For your convenience I repeat the text here and include the test file.

Hello,

I have troubles deploying code Telemac opentelemac.org with Intel Fortran Compiler 16. All routines applying an old trick to skip lengthy records in an unformatted sequential file in order to get to some place in which one wants to read, deliver read error when compiled with optimisation higher than O0. The trick is instead of reading thousands of numbers, just read one number from this record and skip to the next record with next READ, and so on until you get where you want. This trick (a typical old Fortran way of doing things...) stopped working with optimised Intel 16.

I have written a short program containing the original Telemac routines (skipgeo) and a routine being a simple workaround with allocating large enough buffers (skipgeo_improved). The code works well with Intel Fortran 14 and with gfortran (gcc 4.8.4) and yields a read error with optimised Intel 16, catched by a wrapper routine (lit) for the Fortran READ. If you use -warn all -catch all and/or -O0, everything goes well.

I wonder if this is not an optimisation bug. I have not found in the documentation anything about changes in unformatted sequential file treatment.

Please find included code and the file to be read (big endian).

Looking forward for your reactions, best regards,

jaj
Attachments:
The administrator has disabled public write access.

Skipping records in Serafin -- an unformatted sequential file 8 years 9 months ago #19638

  • jmhervouet
  • jmhervouet's Avatar
Hello Jacek,

Did you try with the latest version ? The way to read Selafin files is now changed to a "stream" mode (see the new module Hermes by Yoann Audouin), so this may bypass the Intel compiler bug. However wait for the next release R1, within a few days, because the first release did not work with files larger than 4 Go.

With best regards,

Jean-Michel
The administrator has disabled public write access.

Skipping records in Serafin -- an unformatted sequential file 8 years 9 months ago #19647

  • jaj
  • jaj's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 69
  • Thank you received: 7
Dear Jean-Michel,

in the time between a small discussion after my post by Intel Developer Zone has evolved, the error has been independently confirmed and even passed to the compiler developers. The Intel Fortran Compiler Run Time Libray is being presently suspected. Well, maybe something will happen, See:

my post by Intel Developer Zone

I have applied V6P3r2 because theis is the version the error occured and it is an issue of general interest (compiler!) anyway.

Best regards,
jaj

PS. Why I cannot download a *.tgz attachment I have included to my post? I have no permission... Can't other forums users do it as well? jaj
The administrator has disabled public write access.

Skipping records in Serafin -- an unformatted sequential file 8 years 8 months ago #20164

  • jaj
  • jaj's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 69
  • Thank you received: 7
Hello,

it seems it is (was) a compiler problem. In the time between it seems to be solved by Intel, according to Steve Lionel (Intel, see the link above):

I expect this to be fixed in Parallel Studio XE 2016 Update 3. The underlying problem was that the run-time library was incorrectly positioning the file when only part of a very long record was read, due to a bug in the buffering implementation.

Well, it is weird to me anyhow. Doesn't any Telemac user use newer Intel compilers? Why no-one has noticed this problem before?

Best regards,
jaj
The administrator has disabled public write access.
Moderators: borisb

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.