public class ParallelUtils extends Object
Constructor and Description |
---|
ParallelUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
getEndBlock(int N,
int ID)
Gets the ending index (exclusive) for splitting up a list of items into
SystemInfo.LogicalCores evenly sized blocks. |
static int |
getEndBlock(int N,
int ID,
int P)
Gets the ending index (exclusive) for splitting up a list of items into
P evenly sized blocks. |
static int |
getStartBlock(int N,
int ID)
Gets the starting index (inclusive) for splitting up a list of items into
SystemInfo.LogicalCores evenly sized blocks. |
static int |
getStartBlock(int N,
int ID,
int P)
Gets the starting index (inclusive) for splitting up a list of items into
P evenly sized blocks. |
public static int getStartBlock(int N, int ID, int P)
P
evenly sized blocks. In the event that N
is not evenly
divisible by P
, the size of ranges will differ by at most 1.N
- the number of items to split upID
- the block number in [0, P
)P
- the number of blocks to break up the items intoID
'th process.public static int getStartBlock(int N, int ID)
SystemInfo.LogicalCores
evenly sized blocks. In the event that
N
is not evenly divisible by SystemInfo.LogicalCores
, the
size of ranges will differ by at most 1.N
- the number of items to split upID
- the block number in [0, SystemInfo.LogicalCores
)ID
'th process.public static int getEndBlock(int N, int ID, int P)
P
evenly sized blocks. In the event that N
is not evenly
divisible by P
, the size of ranges will differ by at most 1.N
- the number of items to split upID
- the block number in [0, P
)P
- the number of blocks to break up the items intoID
'th process.public static int getEndBlock(int N, int ID)
SystemInfo.LogicalCores
evenly sized blocks. In the event that
SystemInfo.LogicalCores
is not evenly divisible by
SystemInfo.LogicalCores
, the size of ranges will differ by at
most 1.N
- the number of items to split upID
- the block number in [0, SystemInfo.LogicalCores
)ID
'th process.Copyright © 2017. All rights reserved.