Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Two asynchronous io questions

Grady_Schofield
Beginner
550 Views

First, is there a way to cancel asynchronous IO reads and writes? In C with Linux you have aio_cancel and in Windows, you have CancelIoEx. Is there a fortranfunction that can cancel a transfer given the unit number and ID?

Second, is there a way to open a file in direct / raw / no buffering mode? In Linux you can call open with O_DIRECT, and in Windows you pass CreateFile the flags FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH. This turns the kernel's file cache off for that file. I havetwo testprograms. Each issues an asynchronous read of 32 MB on an existing file and overlaps thatwith anarray operation on 3 arrays of 32 MB each. The difference between a fortran program using basic asyncrhonous IO and a C program using asynchronous IO without file cachingis that the computation takes 10% longer in the Fortran program ( which is no big deal )butthe effective hard drive bandwidth goes down to 35 MB/s from75 MB/s. The C program behaves similarly with the file cache on.

0 Kudos
1 Reply
Steven_L_Intel1
Employee
550 Views
There's no provision for canceling an asynchronous I/O. It sounds to me as if you want to use low-level OS primitives rather than a language-level abstraction. I will note that you can use a USEROPEN routine to open the file yourself with CreateFile, passing whatever flags you want, and then using Fortran I/O. However, the Win32 API is so easy to use, I don't see that it's worth it.
0 Kudos
Reply