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

Unformatted file I/O difference between Debug and Release

NotThatItMatters
Beginner
1,017 Views

I have code which has the option of dumping memory to a file and then later reading this file to repopulate memory for a later run.  I am noting that I can run the code in Release mode without error, and yet in Debug mode the READ statements crash with the claim, input beyond end of record.

The READ statements contain within the program two REWIND statements for the file.  I have put some tracking statements to a file to see where the problem lies, but there is no apparent reading out of sequence.

0 Kudos
1 Solution
Steven_L_Intel1
Employee
1,017 Views

You've got other /fpscomp options set in Debug and not release. These need to match. For example, you have /fpscomp:ioformat set in the Compatibility property page in Debug but not in release. General was set on the Compatibility page in Debug but as "Additional Options" in release. Make all these match.

View solution in original post

0 Kudos
5 Replies
Steven_L_Intel1
Employee
1,017 Views

There is likely an error in your code, perhaps an uninitialized variable. Without a test case there's no way to tell. File I/O is not handled any differently in debug or release modes, so the difference is almost certainly variable related.

0 Kudos
Steven_L_Intel1
Employee
1,017 Views

Thanks for sending the project file. You had /fpscomp:general set in the Debug configuration but not in Release, and this very definitely changes the structure of unformatted files.

0 Kudos
NotThatItMatters
Beginner
1,017 Views

If memory serves, the switch /fpscomp:general was set in the Debug configuration so that the output of my direct access files would be equivalent when running Debug or Release.  Without this switch, the fixed record length file created with the Debug configuration had LF as an end-of-line indicator whereas the Release had CR/LF.

The bonking line at present is something along the lines of

WRITE(IOCODE) (ARRAY(I), I = 1, IJD)

or

READ(IOCODE) (ARRAY(I), I = 1, IJD)

where IJD is 0.

0 Kudos
Steven_L_Intel1
Employee
1,018 Views

You've got other /fpscomp options set in Debug and not release. These need to match. For example, you have /fpscomp:ioformat set in the Compatibility property page in Debug but not in release. General was set on the Compatibility page in Debug but as "Additional Options" in release. Make all these match.

0 Kudos
NotThatItMatters
Beginner
1,017 Views

Steve,

Thank you for the help.  The options have pointed out some old unique ways the file dumps were being synchronized, including the reading of formatted direct-access files as sequential files.  This has improved several items, if only for code standardization.

Thank you again.

0 Kudos
Reply