libsysve
3.1.0
|
Asynchronous I/O operation for VE (VE AIO) enables to develop VE programs which can do their own tasks during data transfer between VE and VH, and actual I/O.
SX-Aurora TSUBASA provides VE AIO function that enables VE programs to do following:
The files must be opened without O_DIRECT flag. It cannot request to read or write an ordinary file opened with O_DIRECT flag. It cannot also request to read or write socket and pipe.
To develop VE programs using VE AIO, please install libsysve-devel package, which has veaio.h header delcaring VE AIO API functions.
For example, execute the forllowing command as root. On ve1
On ve3
If you execute a program using VE AIO only, no extra packages are required.
A VE program using VE AIO needs to include "veaio.h". In the header, the following API functions are declared.
ve_aio_init()
initializes and returns new context for VE AIO.ve_aio_fini()
release the context for VE AIO.ve_aio_read()
starts asynchronous read operation for VE.ve_aio_write()
starts asynchronous write operation for VE.ve_aio_query()
gets state of read/write operation. If state is complete, result of read/write request can be got.ve_aio_wait()
waits and gets result of read/write request.Basic use of VE AIO read/write is following steps.
A simple program with VE AIO reading is following.
Save the above code as simple_aio.c and compile it on VE side as shown below.
Please note the VE AIO API functions are in libveio library. So, "-lveio -pthread" option is required.
Execute compiled VE program.
There are some environment variables to change IO performance in VE AIO. Please find Note for more detail.