NAME
MMPPIIFFiilleesseettssiizzee - Resizes a file (collective).
SSYYNNTTAAXX C Syntax#include
int MPIFilesetsize(MPIFile fh, MPIOffset size)Fortran Syntax (see FORTRAN 77 NOTES)
INCLUDE 'mpif.h'MPIFILESETSIZE(FH, SIZE, IERROR)
INTEGER FH, IERROR
INTEGER(KIND=MPIOFFSETKIND) SIZE CC++++ SSyynnttaaxx#include
void MPI::File::Setsize(MPI::Offset size) IINNPPUUTT PPAARRAAMMEETTEERRSS fh File handle (handle). size Size to truncate or expand file (integer). OOUUTTPPUUTT PPAARRAAMMEETTEERRIERROR Fortran only: Error status (integer).
DESCRIPTION
MPIFilesetsize resizes the file associated with the file handle fh, truncating UNIX files as necessary. MPIFilesetsize is collective; all processes in the group must pass identical values for size. When using MPIFilesetsize on a UNIX file, if size is larger than the current file size, the file size becomes size. If size is smaller than the current file size, the file is truncated at the position defined by size (from the beginning of the file and measured in bytes). Regions of the file which have been previously written are unaffected. MPIFilesetsize does not affect the individual file pointers or the shared file pointer. Note that the actual amount of storage space cannot be allocated by MPIFilesetsize. Use MPIFilepreallocate to accomplish this. It is erroneous to call this function if MPIMODESEQUENTIAL mode was specified when the file was opened. FFOORRTTRRAANN 7777 NNOOTTEESSThe MPI standard prescribes portable Fortran syntax for the SIZE argu-
ment only for Fortran 90. FORTRAN 77 users may use the non-portable
syntax INTEGER*MPIOFFSETKIND SIZE where MPIOFFSETKIND is a constant defined in mpif.h and gives the length of the declared integer in bytes. EERRRROORRSS Almost all MPI routines return an error value; C routines as the valueof the function and Fortran routines in the last argument. C++ func-
tions do not return errors. If the default error handler is set toMPI::ERRORSTHROWEXCEPTIONS, then on error the C++ exception mechanism
will be used to throw an MPI:Exception object. Before the error value is returned, the current MPI error handler is called. For MPI I/O function errors, the default error handler is setto MPIERRORSRETURN. The error handler may be changed with
MPIFileseterrhandler; the predefined error handlerMPIERRORSAREFATAL may be used to make I/O errors fatal. Note that
MPI does not guarantee that an MPI program can continue past an error. Open MPI 1.2 September 2006 MPIFilesetsize(3OpenMPI)