DeinoMPI

The Great and Terrible implementation of MPI-2

function index

MPI_File_preallocate

Preallocates storage space for a file
int MPI_File_preallocate(
  MPI_File mpi_fh,
  MPI_Offset size
);

Parameters

mpi_fh
[in] file handle (handle)
size
[in] size to preallocate (nonnegative integer)

Remarks

MPI_FILE_PREALLOCATE ensures that storage space is allocated for the first size bytes of the file associated with fh. MPI_FILE_PREALLOCATE is collective; all processes in the group must pass identical values for size. Regions of the file that have previously been written are unaffected. For newly allocated regions of the file, MPI_FILE_PREALLOCATE has the same effect as writing undefined data. If size is larger than the current file size, the file size increases to size. If size is less than or equal to the current file size, the file size is unchanged.

The treatment of file pointers, pending nonblocking accesses, and file consistency is the same as with MPI_FILE_SET_SIZE. If MPI_MODE_SEQUENTIAL mode was specified when the file was opened, it is erroneous to call this routine.


Advice to users.

In some implementations, file preallocation may be expensive.

Example Code

The following sample code illustrates MPI_File_preallocate.

Insert code here.