Re: [OMPI devel] Apparent bug in MPI_File_seek() using MPI_SEEK_END

2020-12-03 Thread Gabriel, Edgar via devel
yes please, file a bug report and I will check it out in the next few days.
Thanks!
Edgar

From: devel  On Behalf Of Dave Taflin via 
devel
Sent: Thursday, December 3, 2020 1:05 PM
To: devel@lists.open-mpi.org
Cc: Dave Taflin 
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 0x40 even though 
the file size is larger than that. A sample program that demonstrates the 
behavior is at 
https://gist.github.com/davetaflin/8841e22ad9cd7584249e613cadd3ea2f

Shall I submit a bug report for this?

Dave


[OMPI devel] Apparent bug in MPI_File_seek() using MPI_SEEK_END

2020-12-03 Thread Dave Taflin via devel
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 0x40 even though 
the file size is larger than that. A sample program that demonstrates the 
behavior is at 
https://gist.github.com/davetaflin/8841e22ad9cd7584249e613cadd3ea2f

Shall I submit a bug report for this?

Dave