Class ParallelScheduler
Constructs a schedule for multiprocessor execution given a task graph.
Inheritance
ParallelScheduler
Assembly: Microsoft.ML.Probabilistic.Compiler.dll
Syntax
public class ParallelScheduler
Fields
BuildTreeImbalanceThreshold
Lower values speed up scheduling but create more stages.
Declaration
public int BuildTreeImbalanceThreshold
Field Value
FillIdleSlots
If true, each stage is pruned until the remaining nodes have no idle slots when sorted by height.
Declaration
public bool FillIdleSlots
Field Value
LoggingAction
Declaration
public Action<string> LoggingAction
Field Value
PruningImbalanceThreshold
Must be non-negative. Larger values lead to fewer stages.
Declaration
public int PruningImbalanceThreshold
Field Value
Methods
AddEdge(Int32, Int32)
Declaration
public int AddEdge(int source, int target)
Parameters
Returns
ContainsEdge(Int32, Int32)
Declaration
public bool ContainsEdge(int source, int target)
Parameters
Returns
ConvertToSchedulePerProcess(Int32[][][])
Renumbers the nodes in a schedule to be process-local.
Declaration
public static int[][][] ConvertToSchedulePerProcess(int[][][] schedulePerThread)
Parameters
| Type |
Name |
Description |
| Int32[][][] |
schedulePerThread |
|
Returns
| Type |
Description |
| Int32[][][] |
|
ConvertToSchedulePerProcess(Int32[][][], ParallelScheduler.NodeLocation[], out List<Int32>[][], out List<Int32>[][])
Declaration
public static void ConvertToSchedulePerProcess(int[][][] schedulePerThread, ParallelScheduler.NodeLocation[] locations, out List<int>[][] nodeIndicesToSend, out List<int>[][] nodeIndicesToReceive)
Parameters
ConvertToSchedulePerThread(IReadOnlyList<IReadOnlyList<IReadOnlyList<Int32>>>, Int32)
Convert [stage][block][item] into [thread][stage][item]
Declaration
public int[][][] ConvertToSchedulePerThread(IReadOnlyList<IReadOnlyList<IReadOnlyList<int>>> schedule, int threadCount)
Parameters
Returns
| Type |
Description |
| Int32[][][] |
|
ConvertToSchedulePerThreadFast(IReadOnlyList<IReadOnlyList<IReadOnlyList<Int32>>>, Int32)
Convert [stage][block][item] into [thread][block][item]
Declaration
public int[][][] ConvertToSchedulePerThreadFast(IReadOnlyList<IReadOnlyList<IReadOnlyList<int>>> schedule, int threadCount)
Parameters
Returns
| Type |
Description |
| Int32[][][] |
|
CreateGraph(IReadOnlyList<Int32[]>)
Declaration
public void CreateGraph(IReadOnlyList<int[]> variablesUsedByNode)
Parameters
GetDistributedCommunicationInfos(Int32[][][])
Declaration
public DistributedCommunicationInfo[] GetDistributedCommunicationInfos(int[][][] schedulePerProcess)
Parameters
| Type |
Name |
Description |
| Int32[][][] |
schedulePerProcess |
|
Returns
GetDistributedCommunicationInfos(Int32[][][], IReadOnlyList<Int32[]>)
Declaration
public static DistributedCommunicationInfo[] GetDistributedCommunicationInfos(int[][][] schedulePerProcess, IReadOnlyList<int[]> variablesUsedByNode)
Parameters
Returns
GetDistributedCommunicationInfos(Int32[][][], IReadOnlyList<Int32[]>, out Dictionary<Int32, Int32>[])
Declaration
public static DistributedCommunicationInfo[] GetDistributedCommunicationInfos(int[][][] schedulePerProcess, IReadOnlyList<int[]> variablesUsedByNode, out Dictionary<int, int>[] processLocalIndexOfArrayIndexForProcess)
Parameters
Returns
GetHeights()
Get an array where array[node] is the height of a node in the dependency graph.
Declaration
public int[] GetHeights()
Returns
Declaration
public static double GetMedianMinBlockSize(int[][][] schedulePerThread)
Parameters
| Type |
Name |
Description |
| Int32[][][] |
schedulePerThread |
[process][stageIndex][indexInBlock]
|
Returns
Declaration
public static double GetMedianMinBlockSize(int[][][][] schedulePerThreadInProcess, out double medianThreadStages)
Parameters
| Type |
Name |
Description |
| Int32[][][][] |
schedulePerThreadInProcess |
|
| Double |
medianThreadStages |
|
Returns
GetSchedulePerThreadInProcess(Int32[][], IReadOnlyList<Int32[]>, Int32, Action<String>)
Declaration
public static int[][][][] GetSchedulePerThreadInProcess(int[][] scheduleForProcess, IReadOnlyList<int[]> variablesUsedByNodeInProcess, int numThreads, Action<string> loggingAction = null)
Parameters
Returns
| Type |
Description |
| Int32[][][][] |
|
GetScheduleWithBarriers(Int32)
Declaration
public List<List<List<int>>> GetScheduleWithBarriers(int degreeOfParallelism)
Parameters
| Type |
Name |
Description |
| Int32 |
degreeOfParallelism |
|
Returns
GetScheduleWithBarriers1(Int32)
Get a schedule where all blocks have size 1
Declaration
public List<List<List<int>>> GetScheduleWithBarriers1(int degreeOfParallelism)
Parameters
| Type |
Name |
Description |
| Int32 |
degreeOfParallelism |
|
Returns
NewNode()
Declaration
Returns
ScheduleHasConflict(Int32[][][], IReadOnlyList<Int32[]>)
Declaration
public static bool ScheduleHasConflict(int[][][] schedulePerThread, IReadOnlyList<int[]> variablesUsedByNode)
Parameters
Returns
WriteSchedule(IEnumerable<IEnumerable<IReadOnlyCollection<Int32>>>, Boolean)
Declaration
public static void WriteSchedule(IEnumerable<IEnumerable<IReadOnlyCollection<int>>> schedule, bool blockCounts = false)
Parameters
WriteStage(IEnumerable<IReadOnlyCollection<Int32>>, Boolean)
Declaration
public static void WriteStage(IEnumerable<IReadOnlyCollection<int>> stage, bool blockCounts = false)
Parameters
WriteThreadSchedule(Int32[][][])
Declaration
public static void WriteThreadSchedule(int[][][] blocksOfThread)
Parameters
| Type |
Name |
Description |
| Int32[][][] |
blocksOfThread |
|