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

Asynchronous I/O

Jon_D
New Contributor I
385 Views
Hello,

I am looking into using the new F2003 feature, asynchronous output. My question is this:

You make an asynchronous WRITE, then continue doing computations and make another asynchronous WRITE to the same file. If the output from the previous WRITE is not complete, what happens to the data that are being output with the second WRITE? Do they safely get queued and printed after the first WRITE is over, or do they mess up the whole output? Should there be a WAIT or FLUSH command between the two WRITEs?

Thanks,
Jon
0 Kudos
4 Replies
Steven_L_Intel1
Employee
385 Views
The second asynchronous WRITE queues the data and it is written after the first one completes. But the second one must use different variables than are in the I/O list of the first, unless you do a WAIT before the second WRITE.
0 Kudos
Jon_D
New Contributor I
385 Views
Steve,

Consider the output of a large matrix in the following way:

do i =1,n
write (100,*,asynchronous='yes') (a(i,j),j=1,m)
end do

Would this require WAIT in the DO-loop before each WRITE?

Thanks,
Jon
0 Kudos
Steven_L_Intel1
Employee
385 Views
No, though I'll also tell you that this operation will be done synchronously in our implementation (and I wager on most others.) The benefit of asynchronous I/O is in unformatted reads and writes of large, single arrays. You can ask for asynch for formatted and list-directed, and for multiple item I/O lists, but you probably won't get it.
0 Kudos
jimdempseyatthecove
Honored Contributor III
385 Views

If you want asynchronous formatted read or write consider using a seperate thread.

Jim Dempsey


0 Kudos
Reply