next up previous
Next: Noncontiguous Reads and Up: ADIO Design Previous: Open and Close

Contiguous Reads and Writes

void ADIO_ReadContig(ADIO_File fd, void *buf, int len, int file_ptr_type, ADIO_Offset offset, ADIO_Status *status, int *error_code)

Similarly ADIO_WriteContig.

ADIO provides separate routines for contiguous and noncontiguous accesses. The contiguous read/write routines are used when data to be read or written is contiguous in both memory and file. ADIO_ReadContig and ADIO_WriteContig are independent and blocking versions of the contiguous read and write calls (independent means that a process may call the routine independent of other processes; blocking means that the resources specified in the call, such as buffers, may be reused after the routine returns). Nonblocking and collective versions of the contiguous read/write calls are described in Sections 3.4 and 3.5, respectively.

In the case of ADIO_ReadContig, buf is the address of the buffer in memory into which len contiguous bytes of data must be read from the file. The location in the file from which to read can be specified either in terms of an explicit offset from the start of the file or from the current location of the file pointer. ADIO supports individual file pointers for each process; shared file pointers are not directly supported because of performance reasons. Shared file pointers can be emulated on top of ADIO if necessary. The file_ptr_type parameter indicates whether the routine should use explicit offset or individual file pointer. If file_ptr_type specifies the use of explicit offset, the offset itself is provided in the offset parameter. The offset parameter is ignored when file_ptr_type specifies the use of individual file pointer. The file pointer can be moved by using the ADIO_SeekIndividual function, described in Section 3.6. The status parameter returns information about the operation, such as the amount of data actually read or written.



next up previous
Next: Noncontiguous Reads and Up: ADIO Design Previous: Open and Close

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