|
| 1 | +# Name |
| 2 | + |
| 3 | +`MPI_Intercomm_create_from_groups` - Creates a new inter-communicator from a local and remote group and stringtag |
| 4 | + |
| 5 | +# Syntax |
| 6 | + |
| 7 | +## C Syntax |
| 8 | + |
| 9 | +```c |
| 10 | +#include <mpi.h> |
| 11 | + |
| 12 | +int MPI_Intercomm_create_from_groups(MPI_Group local_group, int local_leader, MPI_Group remote_group, int remote_leader, const char *stringtag, MPI_Info info, MPI_Errhandler errhandler, MPI_Comm *newintercomm) |
| 13 | +``` |
| 14 | +
|
| 15 | +## Fortran Syntax |
| 16 | +
|
| 17 | +```fortran |
| 18 | +USE MPI |
| 19 | +! or the older form: INCLUDE 'mpif.h' |
| 20 | +
|
| 21 | +MPI_INTERCOMM_CREATE_FROM_GROUPS(LOCAL_GROUP, LOCAL_LEADER, REMOTE_GROUP, REMOTE_LEADER, STRINGTAG, INFO, ERRHANDLER, NEWINTERCOMM, IERROR) |
| 22 | + INTEGER LOCAL_GROUP, LOCAL_LEADER, REMOTE_GROUP, REMOTE_LEADER, INFO, ERRHANDLER, NEWINTERCOMM, IERROR |
| 23 | + CHARACTER*(*) STRINGTAG |
| 24 | +``` |
| 25 | + |
| 26 | +## Fortran 2008 Syntax |
| 27 | + |
| 28 | +```fortran |
| 29 | +USE mpi_f08 |
| 30 | +
|
| 31 | +MPI_Intercomm_create_from_groups(local_group, local_leader, remote_group, remote_leader, stringtag, info, errhandler, newintercomm, ierror) |
| 32 | + TYPE(MPI_Group), INTENT(IN) :: local_group, remote_group |
| 33 | + INTEGER, INTENT(IN) :: local_leader, remote_leader |
| 34 | + CHARACTER(LEN=*), INTENT(IN) :: stringtag |
| 35 | + TYPE(MPI_Info), INTENT(IN) :: info |
| 36 | + TYPE(MPI_Errhandler), INTENT(IN) :: errhandler |
| 37 | + TYPE(MPI_Comm), INTENT(OUT) :: newintercomm |
| 38 | + INTEGER, OPTIONAL, INTENT(OUT) :: ierror |
| 39 | +``` |
| 40 | + |
| 41 | +# Input Parameters |
| 42 | + |
| 43 | +* `local_group` : Local group (handler) |
| 44 | +* `local_leader` : rank of local group leader in local_group (integer) |
| 45 | +* `remote_group` : Remote group (handler) |
| 46 | +* `remote_leader` : rank of remote leader in remote_group, significant only at local_leader (integer) |
| 47 | +* `stringtag` : Unique identifier for this operation (string) |
| 48 | +* `info` : info object (handler) |
| 49 | +* `errhandler` : error handler to be attached to the new inter-communicator (handle) |
| 50 | + |
| 51 | +# Output Parameters |
| 52 | + |
| 53 | +* `newintercomm` : New inter-communicator (handle). |
| 54 | +* `IERROR` : Fortran only: Error status (integer). |
| 55 | + |
| 56 | +# Description |
| 57 | + |
| 58 | +`MPI_Intercomm_create_from_groups` creates an inter-communicator. Unlike `MPI_Intercomm_create`, this function |
| 59 | +uses as input previously defined, disjoint local and remote groups. The calling MPI |
| 60 | +process must be a member of the local group. The call is collective over the union of |
| 61 | +the local and remote groups. All involved MPI processes shall provide an identical value |
| 62 | +for the `stringtag` argument. Within each group, all MPI processes shall provide identical |
| 63 | +`local_group`, `local_leader` arguments. Wildcards are not permitted for the |
| 64 | +`remote_leader` or `local_leader` arguments. The `stringtag` argument serves the same purpose |
| 65 | +as the `stringtag` used in the `MPI_Comm_create_from_group` function; it differentiates |
| 66 | +concurrent calls in a multithreaded environment. The `stringtag` shall not exceed |
| 67 | +`MPI_MAX_STRINGTAG_LEN` characters in length. For C, this includes space for a null terminating |
| 68 | +character. In the event that MPI_GROUP_EMPTY is supplied as the `local_group` or `remote_group1 or both, then the |
| 69 | +call is a local operation and MPI_COMM_NULL is returned as the newintercomm`. |
| 70 | + |
| 71 | +# Notes |
| 72 | + |
| 73 | +The `errhandler` argument specifies an error handler to be attached to the new inter-communicator. |
| 74 | +The `info` argument provides hints and assertions, possibly MPI implementation dependent, which |
| 75 | +indicate desired characteristics and guide communicator creation. MPI_MAX_STRINGTAG_LEN shall have a value |
| 76 | +of at least 63. |
| 77 | + |
| 78 | + |
| 79 | +# Errors |
| 80 | + |
| 81 | +Almost all MPI routines return an error value; C routines as the value |
| 82 | +of the function and Fortran routines in the last argument. |
| 83 | +Before the error value is returned, the current MPI error handler is |
| 84 | +called. By default, this error handler aborts the MPI job, except for |
| 85 | +I/O function errors. The error handler may be changed with |
| 86 | +`MPI_Comm_set_errhandler`; the predefined error handler `MPI_ERRORS_RETURN` |
| 87 | +may be used to cause error values to be returned. Note that MPI does not |
| 88 | +guarantee that an MPI program can continue past an error. |
| 89 | + |
| 90 | +# See Also |
| 91 | + |
| 92 | +[`MPI_Comm_create_from_group`(3)](MPI_Comm_create_from_group.html) |
0 commit comments