[97] | 1 | .\"Copyright 2006-2008 Sun Microsystems, Inc. |
---|
| 2 | .\" Copyright (c) 1996 Thinking Machines Corporation |
---|
| 3 | .TH MPI_Init 3 "Dec 08, 2009" "1.4" "Open MPI" |
---|
| 4 | |
---|
| 5 | .SH NAME |
---|
| 6 | \fBMPI_Init\fP \- Initializes the MPI execution environment |
---|
| 7 | |
---|
| 8 | .SH SYNTAX |
---|
| 9 | .ft R |
---|
| 10 | |
---|
| 11 | .SH C Syntax |
---|
| 12 | .nf |
---|
| 13 | #include <mpi.h> |
---|
| 14 | int MPI_Init(int *\fIargc\fP, char ***\fIargv\fP) |
---|
| 15 | |
---|
| 16 | .SH Fortran Syntax |
---|
| 17 | .nf |
---|
| 18 | INCLUDE 'mpif.h' |
---|
| 19 | MPI_INIT(\fIIERROR\fP) |
---|
| 20 | INTEGER \fIIERROR\fP |
---|
| 21 | |
---|
| 22 | .SH C++ Syntax |
---|
| 23 | .nf |
---|
| 24 | #include <mpi.h> |
---|
| 25 | void MPI::Init(int& \fIargc\fP, char**& \fIargv\fP) |
---|
| 26 | void MPI::Init() |
---|
| 27 | |
---|
| 28 | .SH INPUT PARAMETERS |
---|
| 29 | .ft R |
---|
| 30 | .TP 1i |
---|
| 31 | argc |
---|
| 32 | C/C++ only: Pointer to the number of arguments. |
---|
| 33 | .TP 1i |
---|
| 34 | argv |
---|
| 35 | C/C++ only: Argument vector. |
---|
| 36 | |
---|
| 37 | .SH OUTPUT PARAMETER |
---|
| 38 | .ft R |
---|
| 39 | .TP 1i |
---|
| 40 | IERROR |
---|
| 41 | Fortran only: Error status (integer). |
---|
| 42 | |
---|
| 43 | .SH DESCRIPTION |
---|
| 44 | .ft R |
---|
| 45 | This routine, or MPI_Init_thread, must be called before any other MPI |
---|
| 46 | routine (apart from MPI_Initialized) is called. MPI can be initialized |
---|
| 47 | at most once; subsequent calls to MPI_Init or MPI_Init_thread are |
---|
| 48 | erroneous. |
---|
| 49 | .sp |
---|
| 50 | All MPI programs must contain a call to MPI_Init or |
---|
| 51 | MPI_Init_thread. Open MPI accepts the C/C++ \fIargc\fP and \fIargv\fP |
---|
| 52 | arguments to main, but neither modifies, interprets, nor distributes |
---|
| 53 | them: |
---|
| 54 | .sp |
---|
| 55 | .nf |
---|
| 56 | { |
---|
| 57 | /* declare variables */ |
---|
| 58 | MPI_Init(&argc, &argv); |
---|
| 59 | /* parse arguments */ |
---|
| 60 | /* main program */ |
---|
| 61 | MPI_Finalize(); |
---|
| 62 | } |
---|
| 63 | .fi |
---|
| 64 | |
---|
| 65 | .SH NOTES |
---|
| 66 | .ft R |
---|
| 67 | The Fortran version does not have provisions for \fIargc\fP and |
---|
| 68 | \fIargv\fP and takes only IERROR. |
---|
| 69 | .sp |
---|
| 70 | The MPI Standard does not say what a program can do before an MPI_Init |
---|
| 71 | or after an MPI_Finalize. In the Open MPI implementation, it should do |
---|
| 72 | as little as possible. In particular, avoid anything that changes the |
---|
| 73 | external state of the program, such as opening files, reading standard |
---|
| 74 | input, or writing to standard output. |
---|
| 75 | |
---|
| 76 | .SH ERRORS |
---|
| 77 | .ft R |
---|
| 78 | Almost all MPI routines return an error value; C routines as |
---|
| 79 | the value of the function and Fortran routines in the last argument. C++ |
---|
| 80 | functions do not return errors. If the default error handler is set to |
---|
| 81 | MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism |
---|
| 82 | will be used to throw an MPI:Exception object. |
---|
| 83 | .sp |
---|
| 84 | Before the error value is returned, the current MPI error handler is |
---|
| 85 | called. By default, this error handler aborts the MPI job, except for |
---|
| 86 | I/O function errors. The error handler may be changed with |
---|
| 87 | MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN |
---|
| 88 | may be used to cause error values to be returned. Note that MPI does not |
---|
| 89 | guarantee that an MPI program can continue past an error. |
---|
| 90 | .sp |
---|
| 91 | See the MPI man page for a full list of MPI error codes. |
---|
| 92 | |
---|
| 93 | .SH SEE ALSO |
---|
| 94 | .ft R |
---|
| 95 | .nf |
---|
| 96 | MPI_Init_thread |
---|
| 97 | MPI_Initialized |
---|
| 98 | MPI_Finalize |
---|
| 99 | |
---|