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

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

Adding compiled files

File size: 9.8 KB
Line 
1.\"Copyright 2006-2008 Sun Microsystems, Inc.
2.\" Copyright (c) 1996 Thinking Machines Corporation
3.TH MPI_Comm_spawn 3 "Dec 08, 2009" "1.4" "Open MPI"
4.SH NAME
5\fBMPI_Comm_spawn\fP \- Spawns a number of identical binaries.
6
7.SH SYNTAX
8.ft R
9.SH C Syntax
10.nf
11#include <mpi.h>
12int MPI_Comm_spawn(char *\fIcommand\fP, char *\fIargv\fP[], int \fImaxprocs\fP,
13        MPI_Info \fIinfo\fP, int \fIroot\fP, MPI_Comm \fIcomm\fP,
14        MPI_Comm *\fIintercomm\fP, int \fIarray_of_errcodes\fP[])
15
16.SH Fortran Syntax
17.nf
18INCLUDE 'mpif.h'
19MPI_COMM_SPAWN(\fICOMMAND, ARGV, MAXPROCS, INFO, ROOT, COMM,
20        INTERCOMM, ARRAY_OF_ERRCODES, IERROR\fP)
21
22        CHARACTER*(*) \fICOMMAND, ARGV(*)\fP
23        INTEGER \fIINFO, MAXPROCS, ROOT, COMM, INTERCOMM,
24        ARRAY_OF_ERRORCODES(*), IERROR\fP
25
26.SH C++ Syntax
27.nf
28#include <mpi.h>
29MPI::Intercomm MPI::Intracomm::Spawn(const char* \fIcommand\fP,
30        const char* \fIargv\fP[], int \fImaxprocs\fP, const MPI::Info& \fIinfo\fP,
31        int \fIroot\fP, int \fIarray_of_errcodes\fP[]) const
32
33MPI::Intercomm MPI::Intracomm::Spawn(const char* \fIcommand\fP,
34        const char* \fIargv\fP[], int \fImaxprocs\fP, const MPI::Info& \fIinfo\fP,
35        int \fIroot\fP) const
36
37.SH INPUT PARAMETERS
38.ft R
39.TP 1i
40command
41Name of program to be spawned (string, significant only at \fIroot\fP).
42.TP 1i
43argv
44Arguments to \fIcommand\fP (array of strings, significant only at \fIroot\fP).
45.TP 1i
46maxprocs
47Maximum number of processes to start (integer, significant only at \fIroot\fP).
48.TP 1i
49info
50A set of key-value pairs telling the runtime system where and how to start the processes (handle, significant only at \fIroot\fP).
51.TP 1i
52root
53Rank of process in which previous arguments are examined (integer).
54.TP 1i
55comm
56Intracommunicator containing group of spawning processes (handle).
57
58.SH OUTPUT PARAMETER
59.ft R
60.TP 1i
61intercomm
62Intercommunicator between original group and the newly spawned group (handle).
63.TP 1i
64array_of_errcodes
65One code per process (array of integers).
66.TP 1i
67IERROR
68Fortran only: Error status (integer).
69
70.SH DESCRIPTION
71.ft R
72MPI_Comm_spawn tries to start \fImaxprocs\fP identical copies of the MPI program specified by \fIcommand\fP, establishing communication with them and returning an intercommunicator. The spawned processes are referred to as children. The children have their own MPI_COMM_WORLD, which is separate from that of the parents. MPI_Comm_spawn is collective over \fIcomm\fP, and also may not return until MPI_Init has been called in the children. Similarly, MPI_Init in the children may not return until all parents have called MPI_Comm_spawn. In this sense, MPI_Comm_spawn in the parents and MPI_Init in the children form a collective operation over the union of parent and child processes. The intercommunicator returned by MPI_Comm_spawn contains the parent processes in the local group and the child processes in the remote group. The ordering of processes in the local and remote groups is the same as the as the ordering of the group of the \fIcomm\fP in the parents and of MPI_COMM_WORLD of the children, respectively. This intercommunicator can be obtained in the children through the function MPI_Comm_get_parent.
73.sp
74The MPI standard allows an implementation to use the MPI_UNIVERSE_SIZE attribute of MPI_COMM_WORLD to specify the number of processes that will be active in a program.  Although this implementation of the MPI standard defines MPI_UNIVERSE_SIZE, it does not allow the user to set its value.  If you try to set the value of MPI_UNIVERSE_SIZE, you will get an error message.
75.sp
76The \fIcommand\fP Argument
77.sp
78The \fIcommand\fP argument is a string containing the name of a program to be spawned. The string is null-terminated in C. In Fortran, leading and trailing spaces are stripped. MPI looks for the file first in the working directory of the spawning process.
79.sp
80The \fIargv\fP Argument
81.sp
82\fIargv\fP is an array of strings containing arguments that are passed to the program. The first element of \fIargv\fP is the first argument passed to \fIcommand\fP, not, as is conventional in some contexts, the command itself. The argument list is terminated by NULL in C and C++ and an empty string in Fortran. In Fortran, leading and trailing spaces are always stripped, so that a string consisting of all spaces is considered an empty string. The constant MPI_ARGV_NULL may be used in C, C++ and Fortran to indicate an empty argument list. In C and C++, this constant is the same as NULL.
83.sp
84In C, the MPI_Comm_spawn argument \fIargv\fP differs from the \fIargv\fP argument of \fImain\fP in two respects. First, it is shifted by one element. Specifically, \fIargv\fP[0] of \fImain\fP  contains the name of the program (given by \fIcommand\fP). \fIargv\fP[1] of \fImain\fP corresponds to \fIargv\fP[0] in MPI_Comm_spawn, \fIargv\fP[2] of \fImain\fP to \fIargv\fP[1] of MPI_Comm_spawn, and so on. Second, \fIargv\fP of MPI_Comm_spawn must be null-terminated, so that its length can be determined. Passing an \fIargv\fP of MPI_ARGV_NULL to MPI_Comm_spawn results in \fImain\fP receiving \fIargc\fP of 1 and an \fIargv\fP whose element 0 is the name of the program.
85.sp
86The \fImaxprocs\fP Argument
87.sp
88Open MPI tries to spawn \fImaxprocs\fP processes. If it is unable to spawn \fImaxprocs\fP processes, it raises an error of class MPI_ERR_SPAWN. If MPI is able to spawn the specified number of processes, MPI_Comm_spawn returns successfully and the number of spawned processes, \fIm\fP, is given by the size of the remote group of \fIintercomm\fP.
89.sp
90A spawn call with the default behavior is called hard. A spawn call for which fewer than \fImaxprocs\fP processes may be returned is called soft.
91.sp
92The \fIinfo\fP Argument
93.sp
94The \fIinfo\fP argument is an opaque handle of type MPI_Info in C, MPI::Info in C++ and INTEGER in Fortran. It is a container for a number of user-speci ed (\fIkey,value\fP) pairs. \fIkey\fP and \fIvalue\fP are strings (null-terminated char* in C, character*(*) in Fortran). Routines to create and manipulate the \fIinfo\fP argument are described in Section 4.10 of the MPI-2 standard.
95.sp
96For the SPAWN calls, \fIinfo\fP provides additional, implementation-dependent instructions to MPI and the runtime system on how to start processes. An application may pass MPI_INFO_NULL in C or Fortran. Portable programs not requiring detailed control over process locations should use MPI_INFO_NULL.
97.sp
98The following keys for \fIinfo\fP are recognized in Open MPI. (The reserved values mentioned in Section 5.3.4 of the MPI-2 standard are not implemented.)
99.sp
100.nf
101Key                   Type      Description
102---                   ----      -----------
103
104host                  char *    Host on which the process should be spawned.
105                                See the \fIorte_host\fP man page for an
106                                explanation of how this will be used.
107hostfile              char *    Hostfile containing the hosts on which
108                                the processes are to be spawned. See
109                                the \fIorte_hostfile\fP man page for an
110                                explanation of how this will be used.
111wdir                  char *    Directory where the executable is located.
112ompi_prefix           char *    Same as the --prefix command line argument
113                                to mpirun.
114ompi_non_mpi          bool      If set to true, launching a non-MPI
115                                application; the returned communicator
116                                will be MPI_COMM_NULL. Failure to set
117                                this flag when launching a non-MPI
118                                application will cause both the child
119                                and parent jobs to "hang".
120.fi
121
122\fIbool\fP info keys are actually strings but are evaluated as
123follows: if the string value is a number, it is converted to an
124integer and cast to a boolean (meaning that zero integers are false
125and non-zero values are true).  If the string value is
126(case-insensitive) "yes" or "true", the boolean is true.  If the
127string value is (case-insensitive) "no" or "false", the boolean is
128false.  All other string values are unrecognized, and therefore false.
129 
130.sp
131The \fIroot\fP Argument
132.sp
133All arguments before the \fIroot\fP argument are examined only on the process whose rank in \fIcomm\fP is equal to \fIroot\fP. The value of these arguments on other processes is ignored.
134.sp
135The \fIarray_of_errcodes\fP Argument
136.sp
137The \fIarray_of_errcodes\fP is an array of length \fImaxprocs\fP in which MPI reports the status of the processes that MPI was requested to start. If all \fImaxprocs\fP processes were spawned, \fIarray_of_errcodes\fP is filled in with the value MPI_SUCCESS. If anyof the processes are \fInot\fP spawned, \fIarray_of_errcodes\fP is filled in with the value MPI_ERR_SPAWN. In C or Fortran, an application may pass MPI_ERRCODES_IGNORE if it is not interested in the error codes. In C++ this constant does not exist, and the \fIarray_of_errcodes\fP argument may be omitted from the argument list.
138
139.SH NOTES
140.ft R
141Completion of MPI_Comm_spawn in the parent does not necessarily mean that MPI_Init has been called in the children (although the returned intercommunicator can be used immediately).
142
143
144.SH ERRORS
145Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. C++ functions do not return errors. If the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism will be used to throw an MPI:Exception object.
146.sp
147Before the error value is returned, the current MPI error handler is
148called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error. 
149
150.SH SEE ALSO
151.ft R
152.sp
153.nf
154MPI_Comm_spawn_multiple(3)
155MPI_Comm_get_parent(3)
156mpirun(1)
157
Note: See TracBrowser for help on using the repository browser.