Communicator

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## no.uib.cipr.matrix.distributed
Class Communicator

    java.lang.Object
      no.uib.cipr.matrix.distributed.Communicator

    public class Communicator

extends java.lang.Object

Inter-thread communications. Supports point-to-point communications using barriers between the threads. Construct it using the `CollectiveCommunications.createCommunicator` method.

All `Object`s which are sent and recieved are arrays (for instance, `double[]` or `int[]`), and the types must be compatible. It follows that `Object[]` is an array of native arrays, such as `int[][]`.

Method Summary
`void` | `allGather(java.lang.Object sendbuf, java.lang.Object[] recvbuf)` Gathers data from all tasks and distribute it to all.
`void` | `allReduce(java.lang.Object sendbuf, java.lang.Object recvbuf, Reduction op)` Combines values from all processes and distribute the result back to all processes.
`void` | `allToAll(java.lang.Object[] sendbuf, java.lang.Object[] recvbuf)` Sends data from all to all processes.
`void` | `await(java.util.concurrent.Future f)` Waits for the given asynchronous operation to finish
`void` | `await(java.util.concurrent.Future[] future)` Waits for the given asynchronous operations to finish
`void` | `barrier()` Blocks until all process have reached this routine.
`void` | `broadcast(java.lang.Object buffer, int root)` Broadcasts a message from the process with rank "root" to all other processes of the group.
`void` | `gather(java.lang.Object sendbuf, java.lang.Object[] recvbuf, int root)` Gathers together values from a group of processes.
`java.util.concurrent.Future` | `irecv(java.lang.Object data, int peer)`
`java.util.concurrent.Future` | `irecv(java.lang.Object data, int offset, int length, int peer)`
`java.util.concurrent.Future` | `isend(java.lang.Object data, int peer)`
`java.util.concurrent.Future` | `isend(java.lang.Object data, int offset, int length, int peer)`
`int` | `rank()` Rank of this thread in the collective
`void` | `recv(java.lang.Object data, int peer)`
`void` | `recv(java.lang.Object data, int offset, int length, int peer)` Receives data[offset:offset+length] from peer
`void` | `reduce(java.lang.Object sendbuf, java.lang.Object recvbuf, Reduction op, int root)` Reduces values on all processes to a single value
`void` | `scatter(java.lang.Object[] sendbuf, java.lang.Object recvbuf, int root)` Sends data from one task to all other tasks in a group.
`void` | `send(java.lang.Object data, int peer)`
`void` | `send(java.lang.Object data, int offset, int length, int peer)` Sends data[offset:offset+length] to peer
`int` | `size()` Size of the collective

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### rank

    public int rank()

  Rank of this thread in the collective

### size

    public int size()

  Size of the collective

### allGather

    public void allGather(java.lang.Object sendbuf,
                          java.lang.Object[] recvbuf)

  Gathers data from all tasks and distribute it to all.

  Row corresponds to ranks, and columns corresponds to data.

  Input:

  A1 |  |  |
  B1 |  |  |
  C1 |  |  |
  D1 |  |  |

  Output:

  A1 | B1 | C1 | D1
  A1 | B1 | C1 | D1
  A1 | B1 | C1 | D1
  A1 | B1 | C1 | D1

### allReduce

    public void allReduce(java.lang.Object sendbuf,
                          java.lang.Object recvbuf,
                          Reduction op)

  Combines values from all processes and distribute the result back to all processes.

### allToAll

    public void allToAll(java.lang.Object[] sendbuf,
                         java.lang.Object[] recvbuf)

  Sends data from all to all processes.

  Row corresponds to ranks, and columns corresponds to data.

  Input:

  A1 | A2 | A3 | A4
  B1 | B2 | B3 | B4
  C1 | C2 | C3 | C4
  D1 | D2 | D3 | D4

  Output:

  A1 | B1 | C1 | D1
  A2 | B2 | C2 | D2
  A3 | B3 | C3 | D3
  A4 | B4 | C4 | D4

### barrier

    public void barrier()

  Blocks until all process have reached this routine.

### broadcast

    public void broadcast(java.lang.Object buffer,
                          int root)

  Broadcasts a message from the process with rank "root" to all other processes of the group.

  Row corresponds to ranks, and columns corresponds to data.

  Input:

  A1 |  |  |

  Output:

  A1 |  |  |
  A1 |  |  |
  A1 |  |  |
  A1 |  |  |

### gather

    public void gather(java.lang.Object sendbuf,
                       java.lang.Object[] recvbuf,
                       int root)

  Gathers together values from a group of processes.

  Row corresponds to ranks, and columns corresponds to data.

  Input:

  A1 |  |  |
  A2 |  |  |
  A3 |  |  |
  A4 |  |  |

  Output:

  A1 | A2 | A3 | A4

### reduce

    public void reduce(java.lang.Object sendbuf,
                       java.lang.Object recvbuf,
                       Reduction op,
                       int root)

  Reduces values on all processes to a single value

### scatter

    public void scatter(java.lang.Object[] sendbuf,
                        java.lang.Object recvbuf,
                        int root)

  Sends data from one task to all other tasks in a group.

  Row corresponds to ranks, and columns corresponds to data.

  Input:

  A1 | A2 | A3 | A4

  Output:

  A1 |  |  |
  A2 |  |  |
  A3 |  |  |
  A4 |  |  |

### send

    public void send(java.lang.Object data,
                     int offset,
                     int length,
                     int peer)

  Sends data[offset:offset+length] to peer

### recv

    public void recv(java.lang.Object data,
                     int offset,
                     int length,
                     int peer)

  Receives data[offset:offset+length] from peer

### isend

    public java.util.concurrent.Future isend(java.lang.Object data,
                                             int offset,
                                             int length,
                                             int peer)

### irecv

    public java.util.concurrent.Future irecv(java.lang.Object data,
                                             int offset,
                                             int length,
                                             int peer)

### send

    public void send(java.lang.Object data,
                     int peer)

### recv

    public void recv(java.lang.Object data,
                     int peer)

### isend

    public java.util.concurrent.Future isend(java.lang.Object data,
                                             int peer)

### irecv

    public java.util.concurrent.Future irecv(java.lang.Object data,
                                             int peer)

### await

    public void await(java.util.concurrent.Future[] future)

  Waits for the given asynchronous operations to finish

### await

    public void await(java.util.concurrent.Future f)

  Waits for the given asynchronous operation to finish

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD