MPI_FILE_GET_INFO(3)
π NAME π
ok so this is MPI_File_get_info β from the Open MPI manual, section 3 (that's the library-calls girlies, iykyk). It hands you back a brand new info object stuffed with all the values for the hints that are currently chillin' with a file. fr fr, that's the whole plot.
β¨ SYNTAX β¨
π«Ά C Syntax
#include <mpi.h>
int MPI_File_get_info(MPI_File fh, MPI_Info *info_used)
πΈ Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_FILE_GET_INFO(FH, INFO_USED, IERROR)
INTEGER FH, INFO_USED, IERROR
π¦ Fortran 2008 Syntax
USE mpi_f08
MPI_File_get_info(fh, info_used, ierror)
TYPE(MPI_File), INTENT(IN) :: fh
TYPE(MPI_Info), INTENT(OUT) :: info_used
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π INPUT PARAMETER π
fhβ the file handle (a handle, bestie, that's the whole personality).
π OUTPUT PARAMETERS π
info_usedβ a whole new info object, freshly made (handle).ierrorβ Fortran only: error status, and it's aninteger.
π DESCRIPTION π
MPI_File_get_info returns a new info object containing all the hints that the system currently associates with the file fh. Like, the current setting of every hint the system is actually using in relation to this open file β that's what lands in info_used. And here's the thing: you are the one responsible for freeing info_used, via MPI_Info_free. Don't forget. She's your responsibility now. π
Also lowkey important: the set of hints you get back in info_used may be greater or smaller than the set you passed in to MPI_File_open, MPI_File_set_view, and MPI_File_set_info β because the system might not recognize some hints you set, and it might just automatically set other hints you never even asked for. Main character system behavior, honestly. If you wanna know which hints can be set, go look at the HINTS section below. π
π₯ HINTS π₯
These are the hints that can be used as values for the info_used argument. Slay.
β SETTABLE HINTS β
shared_file_timeoutβ how much time, in seconds, to wait for access to the shared file pointer before it gives up and exits withMPI_ERR_TIMEDOUT.rwlock_timeoutβ how much time, in seconds, to wait while trying to get a read or write lock on a contiguous chunk of a UNIX file before exiting withMPI_ERR_TIMEDOUT.noncoll_read_bufsizeβ the maximum size of the buffer that MPI I/O uses to satisfy read requests in the noncollective data-access routines.
Note, and this one matters: if the buffer size is smaller than the distance (in bytes) in a UNIX file between the first byte and the last byte of the access request, MPI I/O ends up iterating and doing multiple UNIXread()orwrite()calls. And if the request includes multiple noncontiguous chunks of data and the buffer size is greater than the size of those chunks, then the UNIXread()orwrite()β the one made at the MPI I/O level β will access data that this process did not request, just to reduce the total number ofwrite()calls being made. If that is not the behavior you want, then reduce this buffer size so it equals the size of the contiguous chunks within the aggregate request. No cap.
noncoll_write_bufsizeβ the maximum size of the buffer MPI I/O uses to satisfy write requests in the noncollective data-access routines.
See the note above in noncoll_read_bufsize. Same energy, just write-y.
coll_read_bufsizeβ the maximum size of the buffer MPI I/O uses to satisfy read requests in the collective data-access routines.
See the note above in noncoll_read_bufsize. π
coll_write_bufsizeβ the maximum size of the buffer MPI I/O uses to satisfy write requests in the collective data-access routines.
See the note above in noncoll_read_bufsize. You get it.
mpiio_concurrencyβ (boolean) controls whether nonblocking I/O routines can bind an extra thread to an LWP.mpiio_coll_contiguousβ (boolean) controls whether subsequent collective data accesses will request collectively contiguous regions of the file.
π NON-SETTABLE HINTS π
filenameβ access this hint to get the name of the file.
π ERRORS π
Almost all MPI routines return an error value, bestie β C routines give it back as the return result of the function, and Fortran routines stick it in the last argument.
Before that error value gets returned, the current MPI error handler associated with the communication object (think: communicator, window, file) is called. And if there's no communication object associated with the MPI call, then the call is considered attached to MPI_COMM_SELF and will call the associated MPI error handler. When MPI_COMM_SELF is not initialized β i.e., before MPI_Init/MPI_Init_thread, after MPI_Finalize, or when you're using the Sessions Model exclusively β the error raises the initial error handler. That initial error handler can be changed by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when you're using the World model, or by the mpi_initial_errhandler CLI argument to mpiexec, or by the info key to MPI_Comm_spawn/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. That's just how it is.
Open MPI ships three predefined error handlers you can use:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. yes, all of them. π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_Abortwas called on that communicator. If it's called on a window or file, it acts as ifMPI_Abortwas 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 back to the application. Respectful. π«Ά
MPI applications can also implement their own error handlers by calling:
MPI_Comm_create_errhandlerand thenMPI_Comm_set_errhandlerMPI_File_create_errhandlerand thenMPI_File_set_errhandlerMPI_Session_create_errhandlerand thenMPI_Session_set_errhandler, or atMPI_Session_initMPI_Win_create_errhandlerand thenMPI_Win_set_errhandler
Important, no joke: note that MPI does not guarantee that an MPI program can continue past an error. Like, at all. That's not a vibe, that's a warning. π
See the MPI man page for a full list of MPI error codes. And see the Error Handling section of the MPI-3.1 standard for more information.
π Copyright π
2003-2026, The Open MPI Community
okay that's the whole page, bestie!! π this was written up in the Open MPI docs and the page is dated Sep 10, 2026 β so go forth, get those file hints, and don't forget to MPI_Info_free your info_used or she will haunt you. love u, bye!! πβ¨π¦
π¦ 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