Package mpi

Class Win

  • All Implemented Interfaces:
    Freeable

    public final class Win
    extends java.lang.Object
    implements Freeable
    This class represents MPI_Win.
    • Constructor Summary

      Constructors 
      Constructor Description
      Win​(int size, int dispUnit, Info info, Comm comm, java.nio.Buffer base, int flavor)
      Java binding of MPI_WIN_ALLOCATE and MPI_WIN_ALLOCATE_SHARED.
      Win​(java.nio.Buffer base, int size, int dispUnit, Info info, Comm comm)
      Java binding of MPI_WIN_CREATE.
      Win​(Info info, Comm comm)
      Java binding of MPI_WIN_CREATE_DYNAMIC.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accumulate​(java.nio.Buffer origin, int orgCount, Datatype orgType, int targetRank, int targetDisp, int targetCount, Datatype targetType, Op op)
      Java binding of MPI_ACCUMULATE.
      void attach​(java.nio.Buffer base, int size)
      Java binding of MPI_WIN_ATTACH.
      void callErrhandler​(int errorCode)
      Java binding of the MPI operation MPI_WIN_CALL_ERRHANDLER.
      void compareAndSwap​(java.nio.Buffer origin, java.nio.Buffer compareAddr, java.nio.Buffer resultAddr, Datatype targetType, int targetRank, int targetDisp)
      Java binding of MPI_COMPARE_AND_SWAP.
      void complete()
      Java binding of the MPI operation MPI_WIN_COMPLETE.
      static int createKeyval()
      Create a new attribute key.
      void deleteAttr​(int keyval)
      Deletes an attribute value associated with a key.
      void detach​(java.nio.Buffer base)
      Java binding of MPI_WIN_DETACH.
      void fence​(int assertion)
      Java binding of MPI_WIN_FENCE.
      void fetchAndOp​(java.nio.Buffer origin, java.nio.Buffer resultAddr, Datatype dataType, int targetRank, int targetDisp, Op op)
      Java binding of MPI_FETCH_AND_OP.
      void flush​(int targetRank)
      Java binding of the MPI operation MPI_WIN_FLUSH.
      void flushAll()
      Java binding of the MPI operation MPI_WIN_FLUSH_ALL.
      void flushLocal​(int targetRank)
      Java binding of the MPI operation MPI_WIN_FLUSH_LOCAL.
      void flushLocalAll()
      Java binding of the MPI operation MPI_WIN_FLUSH_LOCAL_ALL.
      void free()
      Java binding of MPI_WIN_FREE.
      static void freeKeyval​(int keyval)
      Frees an attribute key.
      void get​(java.nio.Buffer origin, int orgCount, Datatype orgType, int targetRank, int targetDisp, int targetCount, Datatype targetType)
      Java binding of MPI_GET.
      void getAccumulate​(java.nio.Buffer origin, int orgCount, Datatype orgType, java.nio.Buffer resultAddr, int resultCount, Datatype resultType, int targetRank, int targetDisp, int targetCount, Datatype targetType, Op op)
      Java binding of MPI_GET_ACCUMULATE.
      java.lang.Object getAttr​(int keyval)
      Retrieves attribute value by key.
      Errhandler getErrhandler()
      Java binding of the MPI operation MPI_WIN_GET_ERRHANDLER.
      Group getGroup()
      Java binding of the MPI operation MPI_GET_GROUP.
      Info getInfo()
      Java binding of the MPI operation MPI_WIN_GET_INFO.
      java.lang.String getName()
      Java binding of the MPI operation MPI_WIN_GET_NAME.
      void lock​(int lockType, int rank, int assertion)
      Java binding of the MPI operation MPI_WIN_LOCK.
      void lockAll​(int assertion)
      Java binding of the MPI operation MPI_WIN_LOCK_ALL.
      void post​(Group group, int assertion)
      Java binding of the MPI operation MPI_WIN_POST.
      void put​(java.nio.Buffer origin, int orgCount, Datatype orgType, int targetRank, int targetDisp, int targetCount, Datatype targetType)
      Java binding of MPI_PUT.
      Request rAccumulate​(java.nio.Buffer origin, int orgCount, Datatype orgType, int targetRank, int targetDisp, int targetCount, Datatype targetType, Op op)
      Java binding of MPI_RACCUMULATE.
      Request rGet​(java.nio.Buffer origin, int orgCount, Datatype orgType, int targetRank, int targetDisp, int targetCount, Datatype targetType)
      Java binding of MPI_RGET.
      Request rGetAccumulate​(java.nio.Buffer origin, int orgCount, Datatype orgType, java.nio.Buffer resultAddr, int resultCount, Datatype resultType, int targetRank, int targetDisp, int targetCount, Datatype targetType, Op op)
      Java binding of MPI_RGET_ACCUMULATE.
      Request rPut​(java.nio.Buffer origin_addr, int origin_count, Datatype origin_datatype, int target_rank, int target_disp, int target_count, Datatype target_datatype)
      Java binding of the MPI operation MPI_RPUT.
      void setAttr​(int keyval, java.lang.Object value)
      Stores attribute value associated with a key.
      void setErrhandler​(Errhandler errhandler)
      Java binding of the MPI operation MPI_WIN_SET_ERRHANDLER.
      void setInfo​(Info info)
      Java binding of the MPI operation MPI_WIN_SET_INFO.
      void setName​(java.lang.String name)
      Java binding of the MPI operation MPI_WIN_SET_NAME.
      void start​(Group group, int assertion)
      Java binding of the MPI operation MPI_WIN_START.
      void sync()
      Java binding of the MPI operation MPI_WIN_SYNC.
      boolean test()
      Java binding of the MPI operation MPI_WIN_TEST.
      void unlock​(int rank)
      Java binding of the MPI operation MPI_WIN_UNLOCK.
      void unlockAll()
      Java binding of the MPI operation MPI_WIN_UNLOCK_ALL.
      void waitFor()
      Java binding of the MPI operation MPI_WIN_WAIT.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Win

        public Win​(java.nio.Buffer base,
                   int size,
                   int dispUnit,
                   Info info,
                   Comm comm)
            throws MPIException
        Java binding of MPI_WIN_CREATE.
        Parameters:
        base - initial address of window
        size - size of window (buffer elements)
        dispUnit - local unit size for displacements (buffer elements)
        info - info object
        comm - communicator
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • Win

        public Win​(int size,
                   int dispUnit,
                   Info info,
                   Comm comm,
                   java.nio.Buffer base,
                   int flavor)
            throws MPIException
        Java binding of MPI_WIN_ALLOCATE and MPI_WIN_ALLOCATE_SHARED.
        Parameters:
        size - size of window (buffer elements)
        dispUnit - local unit size for displacements (buffer elements)
        info - info object
        comm - communicator
        base - initial address of window
        flavor - FLAVOR_PRIVATE or FLAVOR_SHARED
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • Win

        public Win​(Info info,
                   Comm comm)
            throws MPIException
        Java binding of MPI_WIN_CREATE_DYNAMIC.
        Parameters:
        info - info object
        comm - communicator
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
    • Method Detail

      • attach

        public void attach​(java.nio.Buffer base,
                           int size)
                    throws MPIException
        Java binding of MPI_WIN_ATTACH.
        Parameters:
        base - initial address of window
        size - size of window (buffer elements)
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • detach

        public void detach​(java.nio.Buffer base)
                    throws MPIException
        Java binding of MPI_WIN_DETACH.
        Parameters:
        base - initial address of window
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • getGroup

        public Group getGroup()
                       throws MPIException
        Java binding of the MPI operation MPI_GET_GROUP.
        Returns:
        group of processes which share access to the window
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • put

        public void put​(java.nio.Buffer origin,
                        int orgCount,
                        Datatype orgType,
                        int targetRank,
                        int targetDisp,
                        int targetCount,
                        Datatype targetType)
                 throws MPIException
        Java binding of MPI_PUT.
        Parameters:
        origin - origin buffer
        orgCount - number of entries in origin buffer
        orgType - datatype of each entry in origin buffer
        targetRank - rank of target
        targetDisp - displacement from start of window to target buffer
        targetCount - number of entries in target buffer
        targetType - datatype of each entry in target buffer
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • get

        public void get​(java.nio.Buffer origin,
                        int orgCount,
                        Datatype orgType,
                        int targetRank,
                        int targetDisp,
                        int targetCount,
                        Datatype targetType)
                 throws MPIException
        Java binding of MPI_GET.
        Parameters:
        origin - origin buffer
        orgCount - number of entries in origin buffer
        orgType - datatype of each entry in origin buffer
        targetRank - rank of target
        targetDisp - displacement from start of window to target buffer
        targetCount - number of entries in target buffer
        targetType - datatype of each entry in target buffer
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • accumulate

        public void accumulate​(java.nio.Buffer origin,
                               int orgCount,
                               Datatype orgType,
                               int targetRank,
                               int targetDisp,
                               int targetCount,
                               Datatype targetType,
                               Op op)
                        throws MPIException
        Java binding of MPI_ACCUMULATE.
        Parameters:
        origin - origin buffer
        orgCount - number of entries in origin buffer
        orgType - datatype of each entry in origin buffer
        targetRank - rank of target
        targetDisp - displacement from start of window to target buffer
        targetCount - number of entries in target buffer
        targetType - datatype of each entry in target buffer
        op - reduce operation
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • fence

        public void fence​(int assertion)
                   throws MPIException
        Java binding of MPI_WIN_FENCE.
        Parameters:
        assertion - program assertion
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • start

        public void start​(Group group,
                          int assertion)
                   throws MPIException
        Java binding of the MPI operation MPI_WIN_START.
        Parameters:
        group - group of target processes
        assertion - program assertion
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • complete

        public void complete()
                      throws MPIException
        Java binding of the MPI operation MPI_WIN_COMPLETE.
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • post

        public void post​(Group group,
                         int assertion)
                  throws MPIException
        Java binding of the MPI operation MPI_WIN_POST.
        Parameters:
        group - group of origin processes
        assertion - program assertion
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • waitFor

        public void waitFor()
                     throws MPIException
        Java binding of the MPI operation MPI_WIN_WAIT.
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • test

        public boolean test()
                     throws MPIException
        Java binding of the MPI operation MPI_WIN_TEST.
        Returns:
        true if success
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • lock

        public void lock​(int lockType,
                         int rank,
                         int assertion)
                  throws MPIException
        Java binding of the MPI operation MPI_WIN_LOCK.
        Parameters:
        lockType - either MPI.LOCK_EXCLUSIVE or MPI.LOCK_SHARED
        rank - rank of locked window
        assertion - program assertion
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • unlock

        public void unlock​(int rank)
                    throws MPIException
        Java binding of the MPI operation MPI_WIN_UNLOCK.
        Parameters:
        rank - rank of window
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • setErrhandler

        public void setErrhandler​(Errhandler errhandler)
                           throws MPIException
        Java binding of the MPI operation MPI_WIN_SET_ERRHANDLER.
        Parameters:
        errhandler - new MPI error handler for window
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • getErrhandler

        public Errhandler getErrhandler()
                                 throws MPIException
        Java binding of the MPI operation MPI_WIN_GET_ERRHANDLER.
        Returns:
        MPI error handler currently associated with window
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • callErrhandler

        public void callErrhandler​(int errorCode)
                            throws MPIException
        Java binding of the MPI operation MPI_WIN_CALL_ERRHANDLER.
        Parameters:
        errorCode - error code
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • createKeyval

        public static int createKeyval()
                                throws MPIException
        Create a new attribute key.

        Java binding of the MPI operation MPI_WIN_CREATE_KEYVAL.

        Returns:
        attribute key for future access
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • freeKeyval

        public static void freeKeyval​(int keyval)
                               throws MPIException
        Frees an attribute key.

        Java binding of the MPI operation MPI_WIN_FREE_KEYVAL.

        Parameters:
        keyval - attribute key
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • setAttr

        public void setAttr​(int keyval,
                            java.lang.Object value)
                     throws MPIException
        Stores attribute value associated with a key.

        Java binding of the MPI operation MPI_WIN_SET_ATTR.

        Parameters:
        keyval - attribute key
        value - attribute value
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • getAttr

        public java.lang.Object getAttr​(int keyval)
                                 throws MPIException
        Retrieves attribute value by key.

        Java binding of the MPI operation MPI_WIN_GET_ATTR.

        Parameters:
        keyval - attribute key
        Returns:
        attribute value or null if no attribute is associated with the key.
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • deleteAttr

        public void deleteAttr​(int keyval)
                        throws MPIException
        Deletes an attribute value associated with a key.

        Java binding of the MPI operation MPI_WIN_DELETE_ATTR.

        Parameters:
        keyval - attribute key
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • free

        public void free()
                  throws MPIException
        Java binding of MPI_WIN_FREE.
        Specified by:
        free in interface Freeable
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • getInfo

        public Info getInfo()
                     throws MPIException
        Java binding of the MPI operation MPI_WIN_GET_INFO.
        Returns:
        Info Info object associated with this window
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • setInfo

        public void setInfo​(Info info)
                     throws MPIException
        Java binding of the MPI operation MPI_WIN_SET_INFO.
        Parameters:
        info - the new info
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • rPut

        public final Request rPut​(java.nio.Buffer origin_addr,
                                  int origin_count,
                                  Datatype origin_datatype,
                                  int target_rank,
                                  int target_disp,
                                  int target_count,
                                  Datatype target_datatype)
                           throws MPIException

        Java binding of the MPI operation MPI_RPUT.

        Parameters:
        origin_addr - initial address of origin buffer
        origin_count - number of entries in origin buffer
        origin_datatype - datatype of each entry in origin buffer
        target_rank - rank of target
        target_disp - displacement from start of window to target buffer
        target_count - number of entries in target buffer
        target_datatype - datatype of each entry in target buffer
        Returns:
        RMA request
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • rGet

        public final Request rGet​(java.nio.Buffer origin,
                                  int orgCount,
                                  Datatype orgType,
                                  int targetRank,
                                  int targetDisp,
                                  int targetCount,
                                  Datatype targetType)
                           throws MPIException
        Java binding of MPI_RGET.
        Parameters:
        origin - origin buffer
        orgCount - number of entries in origin buffer
        orgType - datatype of each entry in origin buffer
        targetRank - rank of target
        targetDisp - displacement from start of window to target buffer
        targetCount - number of entries in target buffer
        targetType - datatype of each entry in target buffer
        Returns:
        RMA request
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • rAccumulate

        public Request rAccumulate​(java.nio.Buffer origin,
                                   int orgCount,
                                   Datatype orgType,
                                   int targetRank,
                                   int targetDisp,
                                   int targetCount,
                                   Datatype targetType,
                                   Op op)
                            throws MPIException
        Java binding of MPI_RACCUMULATE.
        Parameters:
        origin - origin buffer
        orgCount - number of entries in origin buffer
        orgType - datatype of each entry in origin buffer
        targetRank - rank of target
        targetDisp - displacement from start of window to target buffer
        targetCount - number of entries in target buffer
        targetType - datatype of each entry in target buffer
        op - reduce operation
        Returns:
        RMA request
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • getAccumulate

        public void getAccumulate​(java.nio.Buffer origin,
                                  int orgCount,
                                  Datatype orgType,
                                  java.nio.Buffer resultAddr,
                                  int resultCount,
                                  Datatype resultType,
                                  int targetRank,
                                  int targetDisp,
                                  int targetCount,
                                  Datatype targetType,
                                  Op op)
                           throws MPIException
        Java binding of MPI_GET_ACCUMULATE.
        Parameters:
        origin - origin buffer
        orgCount - number of entries in origin buffer
        orgType - datatype of each entry in origin buffer
        resultAddr - result buffer
        resultCount - number of entries in result buffer
        resultType - datatype of each entry in result buffer
        targetRank - rank of target
        targetDisp - displacement from start of window to target buffer
        targetCount - number of entries in target buffer
        targetType - datatype of each entry in target buffer
        op - reduce operation
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • rGetAccumulate

        public Request rGetAccumulate​(java.nio.Buffer origin,
                                      int orgCount,
                                      Datatype orgType,
                                      java.nio.Buffer resultAddr,
                                      int resultCount,
                                      Datatype resultType,
                                      int targetRank,
                                      int targetDisp,
                                      int targetCount,
                                      Datatype targetType,
                                      Op op)
                               throws MPIException
        Java binding of MPI_RGET_ACCUMULATE.
        Parameters:
        origin - origin buffer
        orgCount - number of entries in origin buffer
        orgType - datatype of each entry in origin buffer
        resultAddr - result buffer
        resultCount - number of entries in result buffer
        resultType - datatype of each entry in result buffer
        targetRank - rank of target
        targetDisp - displacement from start of window to target buffer
        targetCount - number of entries in target buffer
        targetType - datatype of each entry in target buffer
        op - reduce operation
        Returns:
        RMA request
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • lockAll

        public void lockAll​(int assertion)
                     throws MPIException
        Java binding of the MPI operation MPI_WIN_LOCK_ALL.
        Parameters:
        assertion - program assertion
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • unlockAll

        public void unlockAll()
                       throws MPIException
        Java binding of the MPI operation MPI_WIN_UNLOCK_ALL.
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • sync

        public void sync()
                  throws MPIException
        Java binding of the MPI operation MPI_WIN_SYNC.
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • flush

        public void flush​(int targetRank)
                   throws MPIException
        Java binding of the MPI operation MPI_WIN_FLUSH.
        Parameters:
        targetRank - rank of target window
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • flushAll

        public void flushAll()
                      throws MPIException
        Java binding of the MPI operation MPI_WIN_FLUSH_ALL.
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • compareAndSwap

        public void compareAndSwap​(java.nio.Buffer origin,
                                   java.nio.Buffer compareAddr,
                                   java.nio.Buffer resultAddr,
                                   Datatype targetType,
                                   int targetRank,
                                   int targetDisp)
                            throws MPIException
        Java binding of MPI_COMPARE_AND_SWAP.
        Parameters:
        origin - origin buffer
        compareAddr - compare buffer
        resultAddr - result buffer
        targetType - datatype of each entry in target buffer
        targetRank - rank of target
        targetDisp - displacement from start of window to target buffer
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • fetchAndOp

        public void fetchAndOp​(java.nio.Buffer origin,
                               java.nio.Buffer resultAddr,
                               Datatype dataType,
                               int targetRank,
                               int targetDisp,
                               Op op)
                        throws MPIException
        Java binding of MPI_FETCH_AND_OP.
        Parameters:
        origin - origin buffer
        resultAddr - result buffer
        dataType - datatype of entry in origin, result, and target buffers
        targetRank - rank of target
        targetDisp - displacement from start of window to target buffer
        op - reduce operation
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • flushLocal

        public void flushLocal​(int targetRank)
                        throws MPIException
        Java binding of the MPI operation MPI_WIN_FLUSH_LOCAL.
        Parameters:
        targetRank - rank of target window
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • flushLocalAll

        public void flushLocalAll()
                           throws MPIException
        Java binding of the MPI operation MPI_WIN_FLUSH_LOCAL_ALL.
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • getName

        public java.lang.String getName()
                                 throws MPIException
        Java binding of the MPI operation MPI_WIN_GET_NAME.
        Returns:
        the name associated with this window
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.
      • setName

        public void setName​(java.lang.String name)
                     throws MPIException
        Java binding of the MPI operation MPI_WIN_SET_NAME.
        Parameters:
        name - the name to associate with this window
        Throws:
        MPIException - Signals that an MPI exception of some sort has occurred.