yes please, file a bug report and I will check it out in the next few days.
Thanks!
Edgar

From: devel <devel-boun...@lists.open-mpi.org> On Behalf Of Dave Taflin via 
devel
Sent: Thursday, December 3, 2020 1:05 PM
To: devel@lists.open-mpi.org
Cc: Dave Taflin <dtaf...@msn.com>
Subject: [OMPI devel] Apparent bug in MPI_File_seek() using MPI_SEEK_END

Hi,

I've observed what I think is buggy behavior in MPI_File_seek() when trying to 
seek to the end of the file using MPI_SEEK_END. Here is a code snippet showing 
a work-around that works, and the original code that does not work:

MPI_Offset mpiOffset;
#if defined THIS_WORKS
        MPI_File_get_size(fileHandle, &mpiOffset);
        MPI_File_seek(fileHandle, mpiOffset, MPI_SEEK_SET);
#else // This doesn't work:
        mpiOffset = 0;
        MPI_File_seek(fileHandle, mpiOffset, MPI_SEEK_END);
#endif

The "doesn't work" code sets the file position to exactly 0x400000 even though 
the file size is larger than that. A sample program that demonstrates the 
behavior is at 
https://gist.github.com/davetaflin/8841e22ad9cd7584249e613cadd3ea2f<https://urldefense.com/v3/__https:/gist.github.com/davetaflin/8841e22ad9cd7584249e613cadd3ea2f__;!!LkSTlj0I!SP3jGrLud9vqAGvC_ZaPh62wzBKCumi-3hZqWMoea5RdLKJA-THwU1Us4DLDBBKH5kg-$>

Shall I submit a bug report for this?

Dave

Reply via email to