# mpi4py.MPI.Op

class mpi4py.MPI.Op

  Bases: `object`

  Reduction operation.

  static __new__(cls, op=None)
    Parameters:

      op (Op | None)

    Return type:

      Self

  Methods Summary

  `Create`(function[, commute]) | Create a user-defined reduction operation.
  `Free`() | Free a user-defined reduction operation.
  `Is_commutative`() | Query reduction operations for their commutativity.
  `Reduce_local`(inbuf, inoutbuf) | Apply a reduction operation to local data.
  `f2py`(arg) |
  `free`() | Call `Free` if not null or predefined.
  `fromhandle`(handle) | Create object from MPI handle.
  `fromint`(arg, /) | Translate integer handle to object.
  `py2f`() |
  `toint`() | Translate object to integer handle.

  Attributes Summary

  `handle` | MPI handle.
  `is_commutative` | Is a commutative operation.
  `is_predefined` | Is a predefined operation.

  Methods Documentation

  classmethod Create(function, commute=False)

    Create a user-defined reduction operation.

    Parameters:

      - function (Callable[[Buffer, Buffer, Datatype], None])

      - commute (bool)

    Return type:

      Self

  Free()

    Free a user-defined reduction operation.

    Return type:

      None

  Is_commutative()

    Query reduction operations for their commutativity.

    Return type:

      bool

  Reduce_local(inbuf, inoutbuf)

    Apply a reduction operation to local data.

    Parameters:

      - inbuf (BufSpec)

      - inoutbuf (BufSpec)

    Return type:

      None

  classmethod f2py(arg)
    Parameters:

      arg (int)

    Return type:

      Op

  free()

    Call `Free` if not null or predefined.

    Return type:

      None

  classmethod fromhandle(handle)

    Create object from MPI handle.

    Parameters:

      handle (int)

    Return type:

      Op

  classmethod fromint(arg, /)

    Translate integer handle to object.

    Parameters:

      arg (int)

    Return type:

      Op

  py2f()
    Return type:

      int

  toint()

    Translate object to integer handle.

    Return type:

      int

  Attributes Documentation

  handle

    MPI handle.

  is_commutative

    Is a commutative operation.

  is_predefined

    Is a predefined operation.