|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
<HTML>
|
|
Packit Service |
c5cf8c |
<HEAD>
|
|
Packit Service |
c5cf8c |
<META NAME="GENERATOR" CONTENT="DOCTEXT">
|
|
Packit Service |
c5cf8c |
<TITLE>MPI_Init</TITLE>
|
|
Packit Service |
c5cf8c |
</HEAD>
|
|
Packit Service |
c5cf8c |
<BODY BGCOLOR="FFFFFF">
|
|
Packit Service |
c5cf8c |
MPI_Init
|
|
Packit Service |
c5cf8c |
Initialize the MPI execution environment
|
|
Packit Service |
c5cf8c |
Synopsis
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
int MPI_Init(int *argc, char ***argv)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Input Parameters
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
argc Pointer to the number of arguments
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
argv Pointer to the argument vector
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Thread and Signal Safety
|
|
Packit Service |
c5cf8c |
This routine must be called by one thread only. That thread is called
|
|
Packit Service |
c5cf8c |
the main thread and must be the thread that calls <tt>MPI_Finalize</tt>.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Notes
|
|
Packit Service |
c5cf8c |
The MPI standard does not say what a program can do before an <tt>MPI_INIT</tt> or
|
|
Packit Service |
c5cf8c |
after an <tt>MPI_FINALIZE</tt>. In the MPICH implementation, you should do
|
|
Packit Service |
c5cf8c |
as little as possible. In particular, avoid anything that changes the
|
|
Packit Service |
c5cf8c |
external state of the program, such as opening files, reading standard
|
|
Packit Service |
c5cf8c |
input or writing to standard output.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Notes for C
|
|
Packit Service |
c5cf8c |
As of MPI-2, <tt>MPI_Init</tt> will accept NULL as input parameters. Doing so
|
|
Packit Service |
c5cf8c |
will impact the values stored in <tt>MPI_INFO_ENV</tt>.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Notes for Fortran
|
|
Packit Service |
c5cf8c |
The Fortran binding for <tt>MPI_Init</tt> has only the error return
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
subroutine MPI_INIT(ierr)
|
|
Packit Service |
c5cf8c |
integer ierr
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Errors
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
All MPI routines (except <tt>MPI_Wtime</tt> and <tt>MPI_Wtick</tt>) return an error value;
|
|
Packit Service |
c5cf8c |
C routines as the value of the function and Fortran routines in the last
|
|
Packit Service |
c5cf8c |
argument. Before the value is returned, the current MPI error handler is
|
|
Packit Service |
c5cf8c |
called. By default, this error handler aborts the MPI job. The error handler
|
|
Packit Service |
c5cf8c |
may be changed with <tt>MPI_Comm_set_errhandler</tt> (for communicators),
|
|
Packit Service |
c5cf8c |
<tt>MPI_File_set_errhandler</tt> (for files), and <tt>MPI_Win_set_errhandler</tt> (for
|
|
Packit Service |
c5cf8c |
RMA windows). The MPI-1 routine <tt>MPI_Errhandler_set</tt> may be used but
|
|
Packit Service |
c5cf8c |
its use is deprecated. The predefined error handler
|
|
Packit Service |
c5cf8c |
<tt>MPI_ERRORS_RETURN</tt> may be used to cause error values to be returned.
|
|
Packit Service |
c5cf8c |
Note that MPI does not guarentee that an MPI program can continue past
|
|
Packit Service |
c5cf8c |
an error; however, MPI implementations will attempt to continue whenever
|
|
Packit Service |
c5cf8c |
possible.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_SUCCESS No error; MPI routine completed successfully.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_ERR_OTHER This error class is associated with an error code that
|
|
Packit Service |
c5cf8c |
indicates that an attempt was made to call <tt>MPI_INIT</tt> a second time.
|
|
Packit Service |
c5cf8c |
<tt>MPI_INIT</tt> may only be called once in a program.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
See Also
|
|
Packit Service |
c5cf8c |
MPI_Init_thread, MPI_Finalize
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
</BODY></HTML>
|