Package mpi

# Class Op

java.lang.Object
mpi.Op

All Implemented Interfaces:
  `Freeable`

public final class Op extends Object implements Freeable
This class represents `MPI_Op`.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected long`
`handle`
`protected final UserFunction`
`uf`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`Op(int type)`
``
`Op(UserFunction function, boolean commute)`
Bind a user-defined global reduction operation to an `Op` object.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`call(Object invec, Object inoutvec, int count)`
`void`
`free()`
Java binding of the MPI operation `MPI_OP_FREE`.
`boolean`
`isCommutative()`
Test if the operation is commutative.
`boolean`
`isNull()`
Test if operation object is null.
`protected void`
`setDatatype(Datatype t)`

### Methods inherited from class java.lang.Object

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

## Field Details

### uf

protected final UserFunction uf

### handle

protected long handle

## Constructor Details

### Op

protected Op(int type)

### Op

public Op(UserFunction function, boolean commute)
Bind a user-defined global reduction operation to an `Op` object.

Java binding of the MPI operation `MPI_OP_CREATE`.

Parameters:
  `function` - user defined function
  `commute` - `true` if commutative, `false` otherwise

## Method Details

### setDatatype

protected void setDatatype(Datatype t)

### call

protected void call(Object invec, Object inoutvec, int count) throws MPIException

Throws:
  `MPIException`

### isCommutative

public boolean isCommutative()
Test if the operation is commutative.

Java binding of the MPI operation `MPI_OP_COMMUTATIVE`.

Returns:
  `true` if commutative, `false` otherwise

### free

public void free() throws MPIException
Java binding of the MPI operation `MPI_OP_FREE`.

Specified by:
  `free` in interface `Freeable`
Throws:
  `MPIException` - Signals that an MPI error of some sort has occurred.

### isNull

public boolean isNull()
Test if operation object is null.

Returns:
  true if the operation object is null, false otherwise