Package org.ojalgo.concurrent
Enum Parallelism
- java.lang.Object
-
- java.lang.Enum<Parallelism>
-
- org.ojalgo.concurrent.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 fromOjAlgoUtils.ENVIRONMENT
.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.IntSupplier
myValue
-
Constructor Summary
Constructors Modifier Constructor Description private
Parallelism(java.util.function.IntSupplier value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAsInt()
static Parallelism
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Parallelism[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface org.ojalgo.concurrent.ParallelismSupplier
adjustDown, adjustUp, average, decrement, divideBy, halve, increment, limit, limit, require, require, reserveBytes, reserveGigaBytes, reserveKiloBytes, reserveMegaBytes, reserveTeraBytes
-
-
-
-
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.
-
EIGHT
public static final Parallelism EIGHT
8
-
FOUR
public static final Parallelism FOUR
4
-
TWO
public static final Parallelism TWO
2
-
ONE
public static final Parallelism ONE
1
-
-
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 namejava.lang.NullPointerException
- if the argument is null
-
getAsInt
public int getAsInt()
- Specified by:
getAsInt
in interfacejava.util.function.IntSupplier
-
-