On Wed, Feb 18, 2009 at 02:24:03PM -0700, Ralph Castain wrote: > Hi Rob > > Guess I'll display my own ignorance here: > >>> MPI_File_open( MPI_COMM_WORLD, "foo.txt", >>> MPI_MODE_CREATE | MPI_MODE_WRONLY, >>> MPI_INFO_NULL, &fh ); > > > Since the file was opened with MPI_MODE_CREATE, shouldn't it have been > truncated so the prior contents were removed? I think that's the root of > the confusion here. It appears that MPI_MODE_CREATE doesn't cause the > opened file to be truncated, but instead just leaves it "as-is". > > Is that correct?
"The modes MPI_MODE_RDONLY, MPI_MODE_RDWR, MPI_MODE_WRONLY, MPI_MODE_CREATE, and MPI_MODE_EXCL have identical semantics to their POSIX counterparts" MPI_MODE_CREATE behaves like O_CREATE There is no MPI-IO flag corresponding to O_TRUNK. Guess you'd have to MPI_FILE_SET_SIZE after MPI_FILE_OPEN ==rob -- Rob Latham Mathematics and Computer Science Division A215 0178 EA2D B059 8CDF Argonne National Lab, IL USA B29D F333 664A 4280 315B