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

Consecutive errors - forrtl: severe (38): error during write

Nick2
New Contributor I
3,095 Views
In one scenario, I typically run 7 processes at a timethat each load the Fortran dll (essentially a batch queue), until eventually I finish running ~150 cases (each case runs in a new process). The particular machine has two quad Xeon CPUs.

I've noticed the occasional failurewhile the cases are writing to output files;it looks something like this:

Case XYZ4
Date and Time: 5/31/2010 6:21:45 PM
forrtl: severe (38): error during write, unit 89, file XYZ4.something

Case XYZ3
Date and Time: 5/31/2010 6:21:42 PM
forrtl: severe (38): error during write, unit 33, file XYZ3.something

Case XYZ1
Date and Time: 5/31/2010 6:21:31 PM
forrtl: severe (38): error during write, unit 31, file XYZ1.something

Case ZYX1
Date and Time: 5/31/2010 6:19:46 PM
forrtl: severe (38): error during write, unit 92, file ZYX1.something

This isjust aboutimpossible to repro; I only get one such failure out of 150 or so cases (18 clock hours).

Has anyone encountered anything similar?
0 Kudos
3 Replies
rasa
Beginner
3,095 Views
This is just a suggestion as the error can be due to a number of factors. You can use "ERR" and "IOMSG" specifers in the WRITE statement to pinpoint the error source.

You can also use ERR as a breakpoint and print the values for debugging purposes.

[fortran]subroutine test()
use, intrinsic :: ISO_FORTRAN_ENV, only: OUTPUT_UNIT
! define local variables
character (len = 200) :: iomessage
real :: a
integer :: ii

continue

! .. blah.. blah..

write(unit = 125, fmt = '(EN10.6,I5)', err = 101, iomsg = iomessage) a, ii

! .. blah .. blah...

return

! error catching
101 continue
! print the values of a and ii
write(OUTPUT_UNIT, *) a, ii, iomessage
stop 'ERROR: ERROR IN WRITE in subroutine test'
end subroutine test[/fortran]

Hope this helps!
0 Kudos
Steven_L_Intel1
Employee
3,095 Views
"Error during write" means that the OS returned an error during the write operation that didn't map onto a specific Fortran error message. This usually means some sort of media error. If you use IOSTAT to detect the error you can then call ERRSNS and look at the "sys_err" value.
0 Kudos
Nick2
New Contributor I
3,095 Views
Thanks for the help everyone! I still can't repro...but it looks like defrag fixed the problem.
0 Kudos
Reply