source: proiecte/hpl/openmpi_compiled/share/man/man3/MPI_Init_thread.3 @ 97

Last change on this file since 97 was 97, checked in by (none), 14 years ago

Adding compiled files

File size: 3.8 KB
Line 
1.\"Copyright 2006-2008 Sun Microsystems, Inc.
2.\" Copyright (c) 1996 Thinking Machines Corporation
3.TH MPI_Init_thread 3 "Dec 08, 2009" "1.4" "Open MPI"
4
5.SH NAME
6\fBMPI_Init_thread\fP \- Initializes the MPI execution environment
7
8.SH SYNTAX
9.ft R
10
11.SH C Syntax
12.nf
13#include <mpi.h>
14int MPI_Init_thread(int *\fIargc\fP, char ***\fIargv\fP,
15        int \fIrequired\fP, int *\fIprovided\fP)
16
17.SH Fortran Syntax
18.nf
19INCLUDE 'mpif.h'
20MPI_INIT(\fIREQUIRED, PROVIDED, IERROR\fP)
21        INTEGER \fIREQUIRED, PROVIDED, IERROR\fP
22
23.SH C++ Syntax
24.nf
25#include <mpi.h>
26int MPI::Init_thread(int& \fIargc\fP, char**& \fIargv\fP, int \fIrequired\fP)
27int MPI::Init_thread(int \fIrequired\fP)
28
29.SH INPUT PARAMETERS
30.ft R
31.TP 1i
32argc
33C/C++ only: Pointer to the number of arguments.
34.TP 1i
35argv
36C/C++ only: Argument vector.
37.TP 1i
38required
39Desired level of thread support (integer).
40
41.SH OUTPUT PARAMETERS
42.ft R
43.TP 1i
44provided
45Available level of thread support (integer).
46.TP 1i
47IERROR
48Fortran only: Error status (integer).
49
50.SH DESCRIPTION
51.ft R
52This routine, or MPI_Init, must be called before any other MPI routine
53(apart from MPI_Initialized) is called. MPI can be initialized at most
54once; subsequent calls to MPI_Init or MPI_Init_thread are erroneous.
55.sp
56MPI_Init_thread, as compared to MPI_Init, has a provision to request a
57certain level of thread support in \fIrequired\fP:
58.TP 2.4i
59MPI_THREAD_SINGLE
60Only one thread will execute.
61.TP 2.4i
62MPI_THREAD_FUNNELED
63If the process is multithreaded, only the thread that called
64MPI_Init_thread will make MPI calls.
65.TP 2.4i
66MPI_THREAD_SERIALIZED
67If the process is multithreaded, only one thread will make MPI library
68calls at one time.
69.TP 2.4i
70MPI_THREAD_MULTIPLE
71If the process is multithreaded, multiple threads may call MPI at once
72with no restrictions.
73.SH
74The level of thread support available to the program is set in
75\fIprovided\fP, except in C++, where it is the return value of the
76function. In Open MPI, the value is dependent on how the library was configured and built. Note that there is no guarantee that \fIprovided\fP will be greater than or equal to
77\fIrequired\fP.
78.sp
79All MPI programs must contain a call to MPI_Init or
80MPI_Init_thread. Open MPI accepts the C/C++ \fIargc\fP and \fIargv\fP
81arguments to main, but neither modifies, interprets, nor distributes
82them:
83.sp
84.nf
85        {
86                /* declare variables */
87                MPI_Init_thread(&argc, &argv, req, &prov);
88                /* parse arguments */
89                /* main program */
90                MPI_Finalize();
91        }
92.fi
93
94.SH NOTES
95.ft R
96The Fortran version does not have provisions for \fIargc\fP and
97\fIargv\fP and takes only IERROR.
98.sp
99It is the caller's responsibility to check the value of \fIprovided\fP,
100as it may be less than what was requested in \fIrequired\fP.
101.sp
102The MPI Standard does not say what a program can do before an
103MPI_Init_thread or after an MPI_Finalize. In the Open MPI
104implementation, it should do as little as possible. In particular,
105avoid anything that changes the external state of the program, such as
106opening files, reading standard input, or writing to standard output.
107
108.SH ERRORS
109.ft R
110Almost all MPI routines return an error value; C routines as
111the value of the function and Fortran routines in the last argument. C++
112functions do not return errors. If the default error handler is set to
113MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism
114will be used to throw an MPI:Exception object.
115.sp
116Before the error value is returned, the current MPI error handler is
117called. By default, this error handler aborts the MPI job, except for
118I/O function errors. The error handler may be changed with
119MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN
120may be used to cause error values to be returned. Note that MPI does not
121guarantee that an MPI program can continue past an error.
122
123.SH SEE ALSO
124.ft R
125.nf
126MPI_Init
127MPI_Initialized
128MPI_Finalize
129
Note: See TracBrowser for help on using the repository browser.