This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, fortran]PR25829 Add support for F2003 I/O features


Jerry DeLisle wrote:
Janne Blomqvist wrote:
IIRC on Linux AIO requires that the file is opened with O_DIRECT, and that all I/O is page size (typically 4 KB) aligned. The AIO syscalls do work if these conditions are not met, but internally they fall back to a normal synchronous I/O. I think there are some efforts to rectify this, but I don't think they have been committed to the mainline kernel yet. Just something to keep in mind when you want to benchmark the implementation.

Does this mean that we must do fixed size blocks of I/O that are a multiple of the system page size? or that the memory of our source buffer must be aligned on a page boundary?

Both of these, I believe. See


http://lwn.net/Articles/148755/

Actually, it seems the requirement is that I/O is block aligned, which at least on ext3 is typically 4 KB so it's the same as the page size.

I did not read this in the man pages. Where can I find more info on this.

Some general info about AIO, event completion etc. Mostly about network I/O, but still a good read:


http://www.kegel.com/c10k.html

Linux AIO:

http://lse.sourceforge.net/io/aio.html

http://www.linuxsymposium.org/proceedings/reprints/Reprint-Bhattacharya-OLS2004.pdf

Linux buffered AIO:

http://lwn.net/Articles/216200/

Threadlets/syslets/fibrils/wtf?:

http://lwn.net/Articles/223432/

General rant about AIO on Linux:

http://davmac.org/davpage/linux/async-io.html

Either way it does make our "accounting" code a bit more cumbersome.

Yes. OTOH fixing this should probably get rid of some unnecessary flushes and seeks that we now have as well. :)


Also, for folks who have non-linux systems, what kind of support do they have for AIO?

I think most Unixes have relatively robust select/poll implementations. Unfortunately these are not really useful for file I/O. POSIX AIO works for files, but it is a bit newer so support for that is not as widespread (and might suffer from various restrictions like the O_DIRECT + block alignment on Linux as explained above).


OTOH, on windows NT I understand this works much better, as NT was designed for AIO from day one (internally in the kernel all I/O is asynchronous, synchronous I/O is implemented as AIO + wait). The API is called "I/O Completion Port":

http://en.wikipedia.org/wiki/IOCP

--
Janne Blomqvist


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]