Package com.upmem.dpu

Class DpuSystem

  • All Implemented Interfaces:
    DpuSet, java.lang.AutoCloseable

    public final class DpuSystem
    extends java.lang.Object
    implements DpuSet, java.lang.AutoCloseable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALLOCATE_ALL
      Constant used in the allocation methods to allocate all DPUs.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static DpuSystem allocate()
      Allocate a DpuSystem with the default profile.
      static DpuSystem allocate​(int nrDpus, java.lang.String profile)
      Allocate a number of DPUs with the given profile.
      static DpuSystem allocate​(int nrDpus, java.lang.String profile, java.io.PrintStream logStream)
      Allocate a number of DPUs with the given profile and a default log stream.
      static DpuSystem allocate​(DpuProfile profile)
      Allocate a DpuSystem with the given profile.
      static DpuSystem allocateRanks​(int nrRanks, java.lang.String profile)
      Allocate a number of DPU ranks with the given profile.
      static DpuSystem allocateRanks​(int nrRanks, java.lang.String profile, java.io.PrintStream logStream)
      Allocate a number of DPU ranks with the given profile and a default log stream.
      DpuSetAsync async()  
      void close()  
      void copy​(byte[][] dstBuffers, DpuSymbol srcSymbol)  
      void copy​(byte[][] dstBuffers, java.lang.String srcSymbol)  
      void copy​(DpuSymbol dstSymbol, byte[] srcBuffer)  
      void copy​(DpuSymbol dstSymbol, byte[][] srcBuffers)  
      void copy​(java.lang.String dstSymbol, byte[] srcBuffer)  
      void copy​(java.lang.String dstSymbol, byte[][] srcBuffers)  
      DpuDescription description()
      Return the description of the current DpuSystem.
      static DpuDescription description​(java.lang.String profile)
      Fetch the DPU description for the given profile.
      java.util.List<Dpu> dpus()
      Provide the DPU devices in the set.
      void exec()  
      void exec​(java.io.PrintStream logStream)  
      void free()
      Free the DPUs of the current DpuSystem.
      DpuProgramInfo load​(java.lang.String dpuExecutable)  
      void log()  
      void log​(java.io.PrintStream logStream)  
      java.util.List<DpuRank> ranks()
      Provide the DPU ranks in the set.
      void reset()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ALLOCATE_ALL

        public static final int ALLOCATE_ALL
        Constant used in the allocation methods to allocate all DPUs.
        See Also:
        Constant Field Values
    • Method Detail

      • allocate

        public static DpuSystem allocate​(int nrDpus,
                                         java.lang.String profile)
                                  throws DpuException
        Allocate a number of DPUs with the given profile.
        Parameters:
        nrDpus - The number of DPUs to allocate. ALLOCATE_ALL to allocate all available DPUs.
        profile - The DPU profile. Use an empty string for the default profile.
        Returns:
        The allocated DPU system.
        Throws:
        DpuException - When the DPUs could not be allocated
        See Also:
        ALLOCATE_ALL, DpuException
      • allocate

        public static DpuSystem allocate​(int nrDpus,
                                         java.lang.String profile,
                                         java.io.PrintStream logStream)
                                  throws DpuException
        Allocate a number of DPUs with the given profile and a default log stream.
        Parameters:
        nrDpus - The number of DPUs to allocate. ALLOCATE_ALL to allocate all available DPUs.
        profile - The DPU profile. Use an empty string for the default profile.
        logStream - The default stream where the DPU logs will be printed after execution.
        Returns:
        The allocated DPU system.
        Throws:
        DpuException - When the DPUs could not be allocated
        See Also:
        ALLOCATE_ALL, DpuException
      • allocateRanks

        public static DpuSystem allocateRanks​(int nrRanks,
                                              java.lang.String profile)
                                       throws DpuException
        Allocate a number of DPU ranks with the given profile.
        Parameters:
        nrRanks - The number of DPU ranks to allocate. ALLOCATE_ALL to allocate all available DPUs.
        profile - The DPU profile. Use an empty string for the default profile.
        Returns:
        The allocated DPU system.
        Throws:
        DpuException - When the DPUs could not be allocated
        See Also:
        ALLOCATE_ALL, DpuException
      • allocateRanks

        public static DpuSystem allocateRanks​(int nrRanks,
                                              java.lang.String profile,
                                              java.io.PrintStream logStream)
                                       throws DpuException
        Allocate a number of DPU ranks with the given profile and a default log stream.
        Parameters:
        nrRanks - The number of DPU ranks to allocate. ALLOCATE_ALL to allocate all available DPUs.
        profile - The DPU profile. Use an empty string for the default profile.
        logStream - The default stream where the DPU logs will be printed after execution.
        Returns:
        The allocated DPU system.
        Throws:
        DpuException - When the DPUs could not be allocated
        See Also:
        ALLOCATE_ALL, DpuException
      • allocate

        public static DpuSystem allocate()
                                  throws DpuException
        Allocate a DpuSystem with the default profile.
        Returns:
        The allocated DPU system.
        Throws:
        DpuException - When the DPUs could not be allocated
        See Also:
        DpuException
      • description

        public DpuDescription description()
        Return the description of the current DpuSystem.
        Returns:
        The DPU description.
        See Also:
        DpuDescription
      • free

        public void free()
                  throws DpuException
        Free the DPUs of the current DpuSystem.

        The DpuSystem should not be used anymore after calling this method.

        Throws:
        DpuException - When the DPUs could not be freed.
        See Also:
        DpuException
      • dpus

        public java.util.List<Dpu> dpus()
        Description copied from interface: DpuSet
        Provide the DPU devices in the set.
        Specified by:
        dpus in interface DpuSet
        Returns:
        The DPUs in the set.
        See Also:
        Dpu
      • ranks

        public java.util.List<DpuRank> ranks()
        Description copied from interface: DpuSet
        Provide the DPU ranks in the set.
        Specified by:
        ranks in interface DpuSet
        Returns:
        The DPU ranks in the set.
        See Also:
        DpuRank
      • close

        public void close()
                   throws DpuException
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        DpuException
      • copy

        public void copy​(java.lang.String dstSymbol,
                         byte[][] srcBuffers)
                  throws DpuException
        Throws:
        DpuException
      • copy

        public void copy​(byte[][] dstBuffers,
                         java.lang.String srcSymbol)
                  throws DpuException
        Throws:
        DpuException