.TH MPI_Init 3 "2/9/2024" " " "MPI" .SH NAME MPI_Init \- Initialize the MPI execution environment .SH SYNOPSIS .nf .fi .nf int MPI_Init(int *argc, char ***argv) .fi .SH INPUT/OUTPUT PARAMETERS .PD 0 .TP .B argc - argc (None) .PD 1 .PD 0 .TP .B argv - argv (None) .PD 1 .SH NOTES The MPI standard does not say what a program can do before an .I MPI_INIT or after an .I MPI_FINALIZE \&. In the MPICH implementation, you should do as little as possible. In particular, avoid anything that changes the external state of the program, such as opening files, reading standard input or writing to standard output. .SH THREAD AND SIGNAL SAFETY This routine must be called by one thread only. That thread is called the .B main thread and must be the thread that calls .I MPI_Finalize \&. .SH NOTES FOR C As of MPI-2, .I MPI_Init will accept NULL as input parameters. Doing so will impact the values stored in .I MPI_INFO_ENV \&. .SH NOTES FOR FORTRAN The Fortran binding for .I MPI_Init has only the error return .nf subroutine MPI_INIT(ierr) integer ierr .fi .SH ERRORS All MPI routines (except .I MPI_Wtime and .I MPI_Wtick ) return an error value; C routines as the value of the function and Fortran routines in the last argument. Before the value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job. The error handler may be changed with .I MPI_Comm_set_errhandler (for communicators), .I MPI_File_set_errhandler (for files), and .I MPI_Win_set_errhandler (for RMA windows). The MPI-1 routine .I MPI_Errhandler_set may be used but its use is deprecated. The predefined error handler .I MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does .B not guarantee that an MPI program can continue past an error; however, MPI implementations will attempt to continue whenever possible. .PD 0 .TP .B MPI_SUCCESS - No error; MPI routine completed successfully. .PD 1 .PD 0 .TP .B MPI_ERR_OTHER - Other error; use .I MPI_Error_string to get more information about this error code. .PD 1 .SH SEE ALSO MPI_Init_thread, MPI_Finalize .br