Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28996 Discussions

BACKSPACE issue with latest Intel Fortran compiler

Prasha
Novice
4,478 Views

Hello,

I am facing an issue with latest Intel 2019 fortran compiler.

I am attaching the fortran code, which reproduces the issue.

In our numerical application, sometimes the user wants to recompute the calculation from a particular step.

Here, we are essentially rewriting records, from that particular step. This is done by reading the output (result) file, till that step number is reached and then fortran BACKSPACE statement  is called, to position the file at the correct record, from which they are overwritten.

In the new Intel 2019, calling WRITE statement, after the BACKSPACE statement, crashes the application, with the following error:

forrtl: An attempt was made to move the file pointer before the beginning of the file.

forrtl: severe (38): error during write, unit 30, file D:\temp\fortran_file_reading\test.dat

The same code however works file in intel 16.0  and before. I will really appreciate any help in understanding this issue

Thanks

Prashanth

0 Kudos
1 Solution
mecej4
Honored Contributor III
4,340 Views

I am confident that the Intel compiler team will fix this bug, since it occurs in the latest OneAPI compilers, as well.

If you have a current license, you can file a bug report at the Intel Service Center . If not, we wait until an Intel representative reads this thread and files a bug report on your behalf.

I am not able to answer your questions, since the answers will depend on the algorithms and conventions used in the compiler and its RTL. You may, if you wish, experiment with some of the options such as /assume:buffered_io , and see if there are facilities (probably non-standard) in the OPEN statement to use a more fine-grain approach to buffering. That is, apply it only a portion of your program other than the one in which you do read-backspace-write operations. Or, if you wish to have your program work as is, you can accept the performance degradation that not specifying buffered I/O may entail.

View solution in original post

21 Replies
Prasha
Novice
427 Views

Ok, I found an alternative. I thought BACKSPACE was easy, since it is just offsetting the file position pointer. And record length to offset, is anyway written in file. Anyway thanks for the reply.

Regards

Prashanth

0 Kudos
Reply