# Class Intracomm

java.lang.Object
mpi.Comm
mpi.Intracomm

All Implemented Interfaces:
  `Cloneable, Freeable`

Direct Known Subclasses:
  `CartComm, GraphComm`

public class Intracomm extends Comm
This class represents intracommunicator.

## Field Summary

### Fields inherited from class Comm

`handle, SELF, TYPE_SHARED, WORLD`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`Intracomm()`
`protected`
`Intracomm(long handle)`
`protected`
`Intracomm(long[] commRequest)`

## Method Summary

Modifier and Type
Method
Description
`final Intercomm`
`accept(String port, int root)`
Java binding of `MPI_COMM_ACCEPT` using `MPI_INFO_NULL`.
`final Intercomm`
`accept(String port, Info info, int root)`
Java binding of `MPI_COMM_ACCEPT`.
`Intracomm`
`clone()`
Duplicates this communicator.
`static void`
`closePort(String name)`
Java binding of `MPI_CLOSE_PORT`.
`final Intercomm`
`connect(String port, int root)`
Java binding of `MPI_COMM_CONNECT` using `MPI_INFO_NULL`.
`final Intercomm`
`connect(String port, Info info, int root)`
Java binding of `MPI_COMM_CONNECT`.
`final Intracomm`
`create(Group group)`
Create a new communicator.
`final CartComm`
`createCart(int[] dims, boolean[] periods, boolean reorder)`
Creates a communicator to which the Cartesian topology information is attached.
`final GraphComm`
`createDistGraph(int[] sources, int[] degrees, int[] destinations, int[] weights, Info info, boolean reorder)`
Creates a communicator to which the distributed graph topology information is attached.
`final GraphComm`
`createDistGraph(int[] sources, int[] degrees, int[] destinations, Info info, boolean reorder)`
Creates a communicator to which the distributed graph topology information is attached.
`final GraphComm`
`createDistGraphAdjacent(int[] sources, int[] sourceWeights, int[] destinations, int[] destWeights, Info info, boolean reorder)`
Creates a communicator to which the distributed graph topology information is attached.
`final GraphComm`
`createDistGraphAdjacent(int[] sources, int[] destinations, Info info, boolean reorder)`
Creates a communicator to which the distributed graph topology information is attached.
`final GraphComm`
`createGraph(int[] index, int[] edges, boolean reorder)`
Creates a communicator to which the graph topology information is attached.
`final Intracomm`
`createGroup(Group group, int tag)`
Create a new intracommunicator for the given group.
`Intracomm`
`dup()`
Duplicates this communicator.
`Intracomm`
`dupWithInfo(Info info)`
Duplicates this communicator with the info object used in the call.
`final void`
`exScan(Object buf, int count, Datatype type, Op op)`
Perform a prefix reduction on data distributed across the group.
`final void`
`exScan(Object sendbuf, Object recvbuf, int count, Datatype type, Op op)`
Perform a prefix reduction on data distributed across the group.
`Intracomm`
`iDup()`
Duplicates this communicator.
`final Request`
`iExScan(Buffer buf, int count, Datatype type, Op op)`
Perform a prefix reduction on data distributed across the group.
`final Request`
`iExScan(Buffer sendbuf, Buffer recvbuf, int count, Datatype type, Op op)`
Perform a prefix reduction on data distributed across the group.
`final Request`
`iScan(Buffer buf, int count, Datatype type, Op op)`
Perform a prefix reduction on data distributed across the group.
`final Request`
`iScan(Buffer sendbuf, Buffer recvbuf, int count, Datatype type, Op op)`
Perform a prefix reduction on data distributed across the group.
`static String`
`lookupName(String service)`
Java binding of `MPI_LOOKUP_NAME` using `MPI_INFO_NULL`.
`static String`
`lookupName(String service, Info info)`
Java binding of `MPI_LOOKUP_NAME`.
`static String`
`openPort()`
Java binding of `MPI_OPEN_PORT` using `MPI_INFO_NULL`.
`static String`
`openPort(Info info)`
Java binding of `MPI_OPEN_PORT`.
`static void`
`publishName(String service, String port)`
Java binding of `MPI_PUBLISH_NAME` using `MPI_INFO_NULL`.
`static void`
`publishName(String service, Info info, String port)`
Java binding of `MPI_PUBLISH_NAME`.
`final void`
`scan(Object recvbuf, int count, Datatype type, Op op)`
Perform a prefix reduction on data distributed across the group.
`final void`
`scan(Object sendbuf, Object recvbuf, int count, Datatype type, Op op)`
Perform a prefix reduction on data distributed across the group.
`final Intercomm`
`spawn(String command, String[] argv, int maxprocs, Info info, int root, int[] errcodes)`
Java binding of `MPI_COMM_SPAWN`.
`final Intercomm`
`spawnMultiple(String[] commands, String[][] argv, int[] maxprocs, Info[] info, int root, int[] errcodes)`
Java binding of `MPI_COMM_SPAWN_MULTIPLE`.
`final Intracomm`
`split(int colour, int key)`
Partition the group associated with this communicator and create a new communicator within each subgroup.
`final Intracomm`
`splitType(int splitType, int key, Info info)`
Partition the group associated with this communicator and create a new communicator within each subgroup.
`static void`
`unpublishName(String service, String port)`
Java binding of `MPI_UNPUBLISH_NAME` using `MPI_INFO_NULL`.
`static void`
`unpublishName(String service, Info info, String port)`
Java binding of `MPI_UNPUBLISH_NAME`.

### Methods inherited from class Comm

`abort, allGather, allGather, allGatherv, allGatherv, allReduce, allReduce, allToAll, allToAllv, allToAllw, barrier, bcast, bSend, bSendInit, callErrhandler, compare, createIntercomm, createKeyval, deleteAttr, disconnect, dup, dupWithInfo, free, freeKeyval, gather, gather, gatherv, gatherv, gatherv, getAttr, getErrhandler, getGroup, getInfo, getName, getRank, getRequest, getSize, getTopology, iAllGather, iAllGather, iAllGatherv, iAllGatherv, iAllReduce, iAllReduce, iAllToAll, iAllToAllv, iAllToAllw, iBarrier, iBcast, ibSend, iDup, iGather, iGather, iGatherv, iGatherv, iGatherv, iNeighborAllGather, iNeighborAllGatherv, iNeighborAllToAll, iNeighborAllToAllv, iProbe, iRecv, iReduce, iReduce, iReduceScatter, iReduceScatter, iReduceScatterBlock, iReduceScatterBlock, irSend, iScatter, iScatter, iScatterv, iScatterv, iScatterv, iSend, isInter, isNull, isSend, neighborAllGather, neighborAllGatherv, neighborAllToAll, neighborAllToAllv, pack, packSize, probe, recv, recvInit, reduce, reduce, reduceLocal, reduceScatter, reduceScatter, reduceScatterBlock, reduceScatterBlock, rSend, rSendInit, scatter, scatter, scatterv, scatterv, scatterv, send, sendInit, sendRecv, sendRecvReplace, setAttr, setErrhandler, setInfo, setName, setType, sSend, sSendInit, unpack`

### Methods inherited from class Object

`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Intracomm

protected Intracomm()

### Intracomm

protected Intracomm(long handle)

### Intracomm

protected Intracomm(long[] commRequest)

## Method Details

### clone

public Intracomm clone()
Duplicates this communicator.

Java binding of `MPI_COMM_DUP`.

It is recommended to use `dup()` instead of `clone()` because the last can't throw an `MPIException`.

Overrides:
  `clone` in class `Comm`
Returns:
  copy of this communicator

### dup

public Intracomm dup() throws MPIException
Duplicates this communicator.

Java binding of `MPI_COMM_DUP`.

Overrides:
  `dup` in class `Comm`
Returns:
  copy of this communicator
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### iDup

public Intracomm iDup() throws MPIException
Duplicates this communicator.

Java binding of `MPI_COMM_IDUP`.

The new communicator can't be used before the operation completes. The request object must be obtained calling `Comm.getRequest()`.

Overrides:
  `iDup` in class `Comm`
Returns:
  copy of this communicator
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### dupWithInfo

public Intracomm dupWithInfo(Info info) throws MPIException
Duplicates this communicator with the info object used in the call.

Java binding of `MPI_COMM_DUP_WITH_INFO`.

Overrides:
  `dupWithInfo` in class `Comm`
Parameters:
  `info` - info object to associate with the new communicator
Returns:
  copy of this communicator
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### split

public final Intracomm split(int colour, int key) throws MPIException
Partition the group associated with this communicator and create a new communicator within each subgroup.

Java binding of the MPI operation `MPI_COMM_SPLIT`.

Parameters:
  `colour` - control of subset assignment
  `key` - control of rank assignment
Returns:
  new communicator
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### splitType

public final Intracomm splitType(int splitType, int key, Info info) throws MPIException
Partition the group associated with this communicator and create a new communicator within each subgroup.

Java binding of the MPI operation `MPI_COMM_SPLIT_TYPE`.

Parameters:
  `splitType` - type of processes to be grouped together
  `key` - control of rank assignment
  `info` - info argument
Returns:
  new communicator
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### create

public final Intracomm create(Group group) throws MPIException
Create a new communicator.

Java binding of the MPI operation `MPI_COMM_CREATE`.

Parameters:
  `group` - group which is a subset of the group of this communicator
Returns:
  new communicator
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### createGroup

public final Intracomm createGroup(Group group, int tag) throws MPIException
Create a new intracommunicator for the given group.

Java binding of the MPI operation `MPI_COMM_CREATE_GROUP`.

Parameters:
  `group` - group which is a subset of the group of this communicator
  `tag` - an integer tag
Returns:
  new communicator
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### createCart

public final CartComm createCart(int[] dims, boolean[] periods, boolean reorder) throws MPIException
Creates a communicator to which the Cartesian topology information is attached. Create a cartesian topology communicator whose group is a subset of the group of this communicator.

Java binding of the MPI operation `MPI_CART_CREATE`.

The number of dimensions of the Cartesian grid is taken to be the size of the `dims` argument. The array `periods` must be the same size.

Parameters:
  `dims` - the number of processes in each dimension
  `periods` - `true` if grid is periodic, `false` if not, in each dimension
  `reorder` - `true` if ranking may be reordered, `false` if not
Returns:
  new cartesian topology communicator
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### createGraph

public final GraphComm createGraph(int[] index, int[] edges, boolean reorder) throws MPIException
Creates a communicator to which the graph topology information is attached.

Java binding of the MPI operation `MPI_GRAPH_CREATE`.

The number of nodes in the graph, nnodes, is taken to be size of the `index` argument.

Parameters:
  `index` - node degrees
  `edges` - graph edges
  `reorder` - `true` if ranking may be reordered, `false` if not
Returns:
  new graph topology communicator
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### createDistGraph

public final GraphComm createDistGraph(int[] sources, int[] degrees, int[] destinations, int[] weights, Info info, boolean reorder) throws MPIException
Creates a communicator to which the distributed graph topology information is attached.

Java binding of the MPI operation `MPI_DIST_GRAPH_CREATE`.

The number of source nodes is the size of the `sources` argument.

Parameters:
  `sources` - source nodes for which this process specifies edges
  `degrees` - number of destinations for each source node
  `destinations` - destination nodes for the source nodes
  `weights` - weights for source to destination edges
  `info` - hints on optimization and interpretation of weights
  `reorder` - the process may be reordered (true) or not (false)
Returns:
  communicator with distributed graph topology
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### createDistGraph

public final GraphComm createDistGraph(int[] sources, int[] degrees, int[] destinations, Info info, boolean reorder) throws MPIException
Creates a communicator to which the distributed graph topology information is attached.

Java binding of the MPI operation `MPI_DIST_GRAPH_CREATE` using `MPI_UNWEIGHTED`.

The number of source nodes is the size of the `sources` argument.

Parameters:
  `sources` - source nodes for which this process specifies edges
  `degrees` - number of destinations for each source node
  `destinations` - destination nodes for the source nodes
  `info` - hints on optimization and interpretation of weights
  `reorder` - the process may be reordered (true) or not (false)
Returns:
  communicator with distributed graph topology
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### createDistGraphAdjacent

public final GraphComm createDistGraphAdjacent(int[] sources, int[] sourceWeights, int[] destinations, int[] destWeights, Info info, boolean reorder) throws MPIException
Creates a communicator to which the distributed graph topology information is attached.

Java binding of the MPI operation `MPI_DIST_GRAPH_CREATE_ADJACENT`.

The number of source/destination nodes is the size of the `sources`/`destinations` argument.

Parameters:
  `sources` - ranks of processes for which the calling process is a destination
  `sourceWeights` - weights of the edges into the calling process
  `destinations` - ranks of processes for which the calling process is a source
  `destWeights` - weights of the edges out of the calling process
  `info` - hints on optimization and interpretation of weights
  `reorder` - the process may be reordered (true) or not (false)
Returns:
  communicator with distributed graph topology
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### createDistGraphAdjacent

public final GraphComm createDistGraphAdjacent(int[] sources, int[] destinations, Info info, boolean reorder) throws MPIException
Creates a communicator to which the distributed graph topology information is attached.

Java binding of the MPI operation `MPI_DIST_GRAPH_CREATE_ADJACENT` using `MPI_UNWEIGHTED`.

The number of source/destination nodes is the size of the `sources`/`destinations` argument.

Parameters:
  `sources` - ranks of processes for which the calling process is a destination
  `destinations` - ranks of processes for which the calling process is a source
  `info` - hints on optimization and interpretation of weights
  `reorder` - the process may be reordered (true) or not (false)
Returns:
  communicator with distributed graph topology
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### scan

public final void scan(Object sendbuf, Object recvbuf, int count, Datatype type, Op op) throws MPIException
Perform a prefix reduction on data distributed across the group.

Java binding of the MPI operation `MPI_SCAN`.

Parameters:
  `sendbuf` - send buffer array
  `recvbuf` - receive buffer array
  `count` - number of items in input buffer
  `type` - data type of each item in input buffer
  `op` - reduce operation
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### scan

public final void scan(Object recvbuf, int count, Datatype type, Op op) throws MPIException
Perform a prefix reduction on data distributed across the group.

Java binding of the MPI operation `MPI_SCAN` using `MPI_IN_PLACE` instead of the send buffer.

Parameters:
  `recvbuf` - receive buffer array
  `count` - number of items in input buffer
  `type` - data type of each item in input buffer
  `op` - reduce operation
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### iScan

public final Request iScan(Buffer sendbuf, Buffer recvbuf, int count, Datatype type, Op op) throws MPIException
Perform a prefix reduction on data distributed across the group.

Java binding of the MPI operation `MPI_ISCAN`.

Parameters:
  `sendbuf` - send buffer array
  `recvbuf` - receive buffer array
  `count` - number of items in input buffer
  `type` - data type of each item in input buffer
  `op` - reduce operation
Returns:
  communication request
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### iScan

public final Request iScan(Buffer buf, int count, Datatype type, Op op) throws MPIException
Perform a prefix reduction on data distributed across the group.

Java binding of the MPI operation `MPI_ISCAN` using `MPI_IN_PLACE` instead of the send buffer.

Parameters:
  `buf` - send/receive buffer array
  `count` - number of items in buffer
  `type` - data type of each item in buffer
  `op` - reduce operation
Returns:
  communication request
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### exScan

public final void exScan(Object sendbuf, Object recvbuf, int count, Datatype type, Op op) throws MPIException
Perform a prefix reduction on data distributed across the group.

Java binding of the MPI operation `MPI_EXSCAN`.

Parameters:
  `sendbuf` - send buffer array
  `recvbuf` - receive buffer array
  `count` - number of items in input buffer
  `type` - data type of each item in input buffer
  `op` - reduce operation
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### exScan

public final void exScan(Object buf, int count, Datatype type, Op op) throws MPIException
Perform a prefix reduction on data distributed across the group.

Java binding of the MPI operation `MPI_EXSCAN` using `MPI_IN_PLACE` instead of the send buffer.

Parameters:
  `buf` - receive buffer array
  `count` - number of items in input buffer
  `type` - data type of each item in input buffer
  `op` - reduce operation
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### iExScan

public final Request iExScan(Buffer sendbuf, Buffer recvbuf, int count, Datatype type, Op op) throws MPIException
Perform a prefix reduction on data distributed across the group.

Java binding of the MPI operation `MPI_IEXSCAN`.

Parameters:
  `sendbuf` - send buffer array
  `recvbuf` - receive buffer array
  `count` - number of items in input buffer
  `type` - data type of each item in input buffer
  `op` - reduce operation
Returns:
  communication request
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### iExScan

public final Request iExScan(Buffer buf, int count, Datatype type, Op op) throws MPIException
Perform a prefix reduction on data distributed across the group.

Java binding of the MPI operation `MPI_IEXSCAN` using `MPI_IN_PLACE` instead of the send buffer.

Parameters:
  `buf` - receive buffer array
  `count` - number of items in input buffer
  `type` - data type of each item in input buffer
  `op` - reduce operation
Returns:
  communication request
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### openPort

public static String openPort() throws MPIException
Java binding of `MPI_OPEN_PORT` using `MPI_INFO_NULL`.

Returns:
  port name
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### openPort

public static String openPort(Info info) throws MPIException
Java binding of `MPI_OPEN_PORT`.

Parameters:
  `info` - implementation-specific information
Returns:
  port name
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### closePort

public static void closePort(String name) throws MPIException
Java binding of `MPI_CLOSE_PORT`.

Parameters:
  `name` - port name
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### accept

public final Intercomm accept(String port, int root) throws MPIException
Java binding of `MPI_COMM_ACCEPT` using `MPI_INFO_NULL`.

Parameters:
  `port` - port name
  `root` - rank in comm of root node
Returns:
  intercommunicator with client as remote group
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### accept

public final Intercomm accept(String port, Info info, int root) throws MPIException
Java binding of `MPI_COMM_ACCEPT`.

Parameters:
  `port` - port name
  `info` - implementation-specific information
  `root` - rank in comm of root node
Returns:
  intercommunicator with client as remote group
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### connect

public final Intercomm connect(String port, int root) throws MPIException
Java binding of `MPI_COMM_CONNECT` using `MPI_INFO_NULL`.

Parameters:
  `port` - port name
  `root` - rank in comm of root node
Returns:
  intercommunicator with server as remote group
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### connect

public final Intercomm connect(String port, Info info, int root) throws MPIException
Java binding of `MPI_COMM_CONNECT`.

Parameters:
  `port` - port name
  `info` - implementation-specific information
  `root` - rank in comm of root node
Returns:
  intercommunicator with server as remote group
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### publishName

public static void publishName(String service, String port) throws MPIException
Java binding of `MPI_PUBLISH_NAME` using `MPI_INFO_NULL`.

Parameters:
  `service` - service name
  `port` - port name
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### publishName

public static void publishName(String service, Info info, String port) throws MPIException
Java binding of `MPI_PUBLISH_NAME`.

Parameters:
  `service` - service name
  `info` - implementation-specific information
  `port` - port name
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### unpublishName

public static void unpublishName(String service, String port) throws MPIException
Java binding of `MPI_UNPUBLISH_NAME` using `MPI_INFO_NULL`.

Parameters:
  `service` - service name
  `port` - port name
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### unpublishName

public static void unpublishName(String service, Info info, String port) throws MPIException
Java binding of `MPI_UNPUBLISH_NAME`.

Parameters:
  `service` - service name
  `info` - implementation-specific information
  `port` - port name
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### lookupName

public static String lookupName(String service) throws MPIException
Java binding of `MPI_LOOKUP_NAME` using `MPI_INFO_NULL`.

Parameters:
  `service` - service name
Returns:
  port name
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### lookupName

public static String lookupName(String service, Info info) throws MPIException
Java binding of `MPI_LOOKUP_NAME`.

Parameters:
  `service` - service name
  `info` - implementation-specific information
Returns:
  port name
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### spawn

public final Intercomm spawn(String command, String[] argv, int maxprocs, Info info, int root, int[] errcodes) throws MPIException
Java binding of `MPI_COMM_SPAWN`. This intracommunicator will contain the group of spawned processes.

Parameters:
  `command` - name of program to be spawned
  `argv` - arguments to command; if this parameter is null, `MPI_ARGV_NULL` will be used.
  `maxprocs` - maximum number of processes to start
  `info` - info object telling the runtime where and how to start the processes
  `root` - rank of process in which previous arguments are examined
  `errcodes` - one code per process; if this parameter is null, `MPI_ERRCODES_IGNORE` will be used.
Returns:
  intercommunicator between original group and the newly spawned group
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### spawnMultiple

public final Intercomm spawnMultiple(String[] commands, String[][] argv, int[] maxprocs, Info[] info, int root, int[] errcodes) throws MPIException
Java binding of `MPI_COMM_SPAWN_MULTIPLE`. This intracommunicator will contain the group of spawned processes.

Parameters:
  `commands` - programs to be executed
  `argv` - arguments for commands; if this parameter is null, `MPI_ARGVS_NULL` will be used.
  `maxprocs` - maximum number of processes to start for each command
  `info` - info objects telling the runtime where and how to start the processes
  `root` - rank of process in which previous arguments are examined
  `errcodes` - one code per process; if this parameter is null, `MPI_ERRCODES_IGNORE` will be used.
Returns:
  intercommunicator between original group and the newly spawned group
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.