MPI_FILE_DELETE(3)
π MPI_FILE_DELETE π
okay bestie, we're looking at the Open MPI page for MPI_FILE_DELETE(3) β yes it's a whole manual page, and yes it's actually fun once you get it. sit with me for a sec β¨
πΈ NAME πΈ
MPI_File_delete β deletes a file. that's it. that's the whole job. she removes a file and she does it with main character energy π
β¨ SYNTAX β¨
π C Syntax
#include <mpi.h>
int MPI_File_delete(const char *filename, MPI_Info info)
π Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_FILE_DELETE(FILENAME, INFO, IERROR)
CHARACTER*(*) FILENAME
INTEGER INFO, IERROR
π Fortran 2008 Syntax
USE mpi_f08
MPI_File_delete(filename, info, ierror)
CHARACTER(LEN=*), INTENT(IN) :: filename
TYPE(MPI_Info), INTENT(IN) :: info
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π¦ INPUT PARAMETERS π¦
- filename β the name of the file you wanna delete, as a string (that's string bestie, not a vibe).
- info β the Info object. it's a handle.
π OUTPUT PARAMETER π
- ierror β Fortran only: the error status, an integer. π«Ά
π DESCRIPTION π
so here's the tea, fr fr: MPI_File_delete deletes the file identified by the file name filename β but only if it's not currently open by any process.
and okay, this part is important, don't skip it: it is an error to delete the file with MPI_File_delete if some process has it open, but MPI_File_delete does not check this. likeβ¦ she will not warn you. she will not look. she just goes πββοΈπ¨
and if the file doesn't exist? MPI_File_delete returns an error in the class MPI_ERR_NO_SUCH_FILE. no cap. π
π ERRORS π
almost all MPI routines return an error value β C routines hand it back as the return result of the function, and Fortran routines stash it in that last argument. iconic behavior honestly.
before that error value comes back, the current MPI error handler associated with the communication object (think: communicator, window, file) gets called. and if no communication object is associated with the MPI call, then the call is considered attached to MPI_COMM_SELF and will call the associated MPI error handler. and when MPI_COMM_SELF is not initialized β like 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 via the mpi_initial_errhandler CLI argument to mpiexec, or the info key to MPI_Comm_spawn / MPI_Comm_spawn_multiple. and if no other appropriate error handler has been set? then the MPI_ERRORS_RETURN error handler is called for MPI I/O functions, and the MPI_ERRORS_ABORT error handler is called for all other MPI functions.
Open MPI ships three predefined error handlers you can use, periodt:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. dramatic and effective π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 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. if called on a session, it aborts only the local process.MPI_ERRORS_RETURNβ returns an error code to the application. chill of her honestly β¨
MPI applications can also implement their own error handlers, by calling:
MPI_Comm_create_errhandlerthenMPI_Comm_set_errhandlerMPI_File_create_errhandlerthenMPI_File_set_errhandlerMPI_Session_create_errhandlerthenMPI_Session_set_errhandler, or atMPI_Session_initMPI_Win_create_errhandlerthenMPI_Win_set_errhandler
β οΈ note that MPI does not guarantee that an MPI program can continue past an error. like, she said what she said. plan accordingly bestie π
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 even more info, iykyk π
π Copyright π
2003-2026, The Open MPI Community
and that's the whole page, bestie!! π§β¨ this was MPI_FILE_DELETE(3) from Open MPI, dated Sep 10, 2026 β go delete a file responsibly, don't do it while somebody has it open, and text me when you're done ππ¦πΈ
π¦ 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