next up previous
Next: File Control Up: ADIO Design Previous: Seek

Test and Wait

It is necessary to test the completion of nonblocking operations before any of the resources specified in the nonblocking routine can be reused. ADIO provides three kinds of routines for this purpose: a quick test for completion that requires no further action (ADIO_xxxxDone), a test-and-complete (ADIO_xxxxIcomplete), and a wait-for-completion (ADIO_xxxxComplete). Separate routines exist for read and write operations.

int ADIO_ReadDone(ADIO_Request *request)
Similarly ADIO_WriteDone.

These routines check the request handle to determine whether the operation is complete and requires no further action. They return true if complete, and false otherwise.

int ADIO_ReadIcomplete(ADIO_Request *request, ADIO_Status *status, int *error_code)
Similarly ADIO_WriteIcomplete.

If an operation is not complete, the above routines can be used. Note that these routines do not block waiting for the operation to complete. Instead, they perform some additional processing necessary to complete the operation. If the operation is completed, they return true and set the status variable; otherwise, they return false. If an error is detected, they return true and set the error_code appropriately.

void ADIO_ReadComplete(ADIO_Request *request, ADIO_Status *status, int *error_code).
Similarly ADIO_WriteComplete.

These routines block until the specified operation is completed and set the status variable. If an error is detected, they set the error_code appropriately and return.

Rajeev Thakur
Mon Oct 14 18:36:34 CDT 1996