Enum Parallelism

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Parallelism>, java.util.function.IntSupplier, ParallelismSupplier

    public enum Parallelism
    extends java.lang.Enum<Parallelism>
    implements ParallelismSupplier
    A set of standard levels of parallelsim derived from the number of available cores and optionally capped by reserving a specified amount of memory per thread. The info about available cores/threads/memory comes from OjAlgoUtils.ENVIRONMENT.
    • Enum Constant Detail

      • THREADS

        public static final Parallelism THREADS
        The total number of threads (incl. hyperthreads)
      • CORES

        public static final Parallelism CORES
        The number of CPU cores
      • UNITS

        public static final Parallelism UNITS
        The number of CPU:s or, more precisely, top level (L3) cache units. It is generally assumed that there is one L3 cache unit per CPU.
    • Field Detail

      • myValue

        private final java.util.function.IntSupplier myValue
    • Constructor Detail

      • Parallelism

        private Parallelism​(java.util.function.IntSupplier value)
    • Method Detail

      • values

        public static Parallelism[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Parallelism c : Parallelism.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Parallelism valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getAsInt

        public int getAsInt()
        Specified by:
        getAsInt in interface java.util.function.IntSupplier