IOBUF is an I/O buffering library that can reduce the I/O wait time for programs that read or write large files sequentially. IOBUF intercepts standard I/O calls such as read and open and replaces the stdio (glibc, libio) layer of buffering with an additional layer of buffering, thus improving program performance by enabling asynchronous prefetching and caching of file data. Note that by default, IOBUF intercepts standard I/O calls such as fopen, fread, fwrite, and fclose and all Fortran I/O. Therefore, C programs which use POSIX-style I/O calls like open, read, write, and close are not affected. The work-around is to replace the POSIX I/O calls in the C program by their equivalent iobuf-specific calls, i.e., iobuf_open, iobuf_creat, iobuf_close, iobuf_read, iobuf_write and etc (see iobuf.h for the complete list). Or include iobuf.h (should be after all other #include) in your source code to make this substitution automatically via C preprocessor macros (USE_IOBUF_MACROS).
IOBUF can also gather runtime statistics and print a summary report of I/O activity for each file.
In general, no program source changes are needed in order to take advantage of IOBUF. Instead, IOBUF is implemented by following these steps:
- Load the IOBUF module:
% module load iobuf
- Relink the program.
- Set the IOBUF_PARAMS environment variable as needed.
module avail iobuf module load iobuf ftn test.f OR cc test.c # automatically links in iobuf-cnl.o OR cc -DUSE_IOBUF_MACROS $IOBUF_INC -c test.c # iobuf.h needs to be included # in the source code to intercept # open()/read()/write()/close() calls.
This package has the following support level : Supported