MPI_FILE_GET_BYTE_OFFSET(3)
πΈ NAME πΈ
MPI_File_get_byte_offset β bestie, this one converts a view-relative offset into an absolute byte position. That's the whole gig. Iconic, honestly.
β¨ SYNTAX β¨
C Syntax
#include <mpi.h>
int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset,
MPI_Offset *disp)
Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_FILE_GET_BYTE_OFFSET(FH, OFFSET, DISP, IERROR)
INTEGER FH, IERROR
INTEGER(KIND=MPI_OFFSET_KIND) OFFSET, DISP
Fortran 2008 Syntax
USE mpi_f08
MPI_File_get_byte_offset(fh, offset, disp, ierror)
TYPE(MPI_File), INTENT(IN) :: fh
INTEGER(KIND=MPI_OFFSET_KIND), INTENT(IN) :: offset
INTEGER(KIND=MPI_OFFSET_KIND), INTENT(OUT) :: disp
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π₯ INPUT PARAMETERS π₯
fhβ the file handle (handle). Your lil portal to the file, yk?offsetβ the offset (integer). The view-relative one, the one you wanna translate.
π€ OUTPUT PARAMETERS π€
dispβ the absolute byte position ofoffset(integer). This is the glow-up result β¨ierrorβ Fortran only: the error status (integer).
π DESCRIPTION π
So the way that this works: MPI_File_get_byte_offset takes an offset that you specified for the current view and converts it into its corresponding displacement value β aka the absolute byte position from the very beginning of the file. Not the view, the file. Fr fr.
Then the absolute byte position of offset relative to the current view of fh gets returned in disp. That's it, that's the tea π«
π¨ ERRORS π¨
Okay so like, almost every MPI routine returns an error value β C routines hand it back as the return result of the function, and Fortran routines stick it in the last argument. No cap.
Before that error value comes back to you, the current MPI error handler that's associated with the communication object (think: communicator, window, file) gets called. And if there's no communication object associated with the MPI call? Then the call is considered attached to MPI_COMM_SELF, and it'll call the error handler associated with that. Now β when MPI_COMM_SELF is not initialized (meaning before MPI_Init <#mpi-init> / MPI_Init_thread <#mpi-init-thread>, after MPI_Finalize <#mpi-finalize>, or when you're using the Sessions Model exclusively), the error raises the initial error handler instead. The initial error handler can be changed by calling MPI_Comm_set_errhandler <#mpi-comm-set-errhandler> on MPI_COMM_SELF when you're using the World model, or via the mpi_initial_errhandler CLI argument to mpiexec or the info key to MPI_Comm_spawn <#mpi-comm-spawn> / MPI_Comm_spawn_multiple <#mpi-comm-spawn-multiple>. And if no other appropriate error handler has been set, then MPI_ERRORS_RETURN gets called for MPI I/O functions, while MPI_ERRORS_ABORT gets called for all other MPI functions. π
Open MPI ships three predefined error handlers you can use:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes.MPI_ERRORS_ABORTβ an error handler that can be invoked on a communicator, window, file, or session. When it's called on a communicator, it acts as ifMPI_Abort <#mpi-abort>was called on that communicator. If it's called on a window or file, it acts as ifMPI_Abort <#mpi-abort>was called on a communicator containing the group of processes in the corresponding window or file. And if it's called on a session, it aborts only the local process.MPI_ERRORS_RETURNβ returns an error code to the application.
MPI applications can also implement their own error handlers, by calling:
MPI_Comm_create_errhandler <#mpi-comm-create-errhandler>and thenMPI_Comm_set_errhandler <#mpi-comm-set-errhandler>MPI_File_create_errhandler <#mpi-file-create-errhandler>and thenMPI_File_set_errhandler <#mpi-file-set-errhandler>MPI_Session_create_errhandler <#mpi-session-create-errhandler>and thenMPI_Session_set_errhandler <#mpi-session-set-errhandler>or atMPI_Session_init <#mpi-session-init>MPI_Win_create_errhandler <#mpi-win-create-errhandler>and thenMPI_Win_set_errhandler <#mpi-win-set-errhandler>
Heads up bestie: note that MPI does not guarantee that an MPI program can continue past an error. So likeβ¦ don't count on it. π
See the MPI man page <#open-mpi> for a full list of MPI error codes <#open-mpi-errors>.
See the Error Handling section of the MPI-3.1 standard for more information.
π Copyright π
2003-2026, The Open MPI Community
And that's the whole page, babe β MPI_FILE_GET_BYTE_OFFSET(3) from Open MPI, dated Sep 10, 2026, copyright 2003-2026, The Open MPI Community. Go convert those offsets, you absolute main character π¦π periodt.
π¦ where this page comes from
- ubuntu stonking: openmpi-doc 5.0.10-6 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms