Class ThreadCommunicator
A mimic of the Communicator class in MPI.NET, that uses local threads only.
Inheritance
ThreadCommunicator
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
public class ThreadCommunicator : CommunicatorBase, ICommunicator
Constructors
ThreadCommunicator(ThreadCommunicator.SharedState, Int32)
Declaration
protected ThreadCommunicator(ThreadCommunicator.SharedState shared, int rank)
Parameters
Fields
anySource
Declaration
public const int anySource = -2
Field Value
anyTag
Declaration
public const int anyTag = -1
Field Value
shared
Declaration
protected readonly ThreadCommunicator.SharedState shared
Field Value
Properties
PercentTimeSpentWaiting
Declaration
public override double PercentTimeSpentWaiting { get; }
Property Value
Overrides
Rank
Declaration
public override int Rank { get; }
Property Value
Overrides
Size
Declaration
public override int Size { get; }
Property Value
Overrides
Methods
Barrier()
Declaration
public override void Barrier()
Overrides
Declaration
public override ICommunicatorRequest ImmediateReceive<T>(int source, int tag, T[] values)
Parameters
Type |
Name |
Description |
Int32 |
source |
|
Int32 |
tag |
|
T[] |
values |
|
Returns
Type Parameters
Overrides
Microsoft.ML.Probabilistic.CommunicatorBase.ImmediateReceive<T>(System.Int32, System.Int32, T[])
Declaration
public override ICommunicatorRequest ImmediateReceive<T>(int source, int tag, Action<T> action)
Parameters
Returns
Type Parameters
Overrides
Microsoft.ML.Probabilistic.CommunicatorBase.ImmediateReceive<T>(System.Int32, System.Int32, System.Action<T>)
Non-blocking send of a single value. This routine will initiate communication and then return immediately with a Request object that can be used to query the status of the communication.
Declaration
public override ICommunicatorRequest ImmediateSend<T>(T value, int dest, int tag)
Parameters
Type |
Name |
Description |
T |
value |
|
Int32 |
dest |
|
Int32 |
tag |
|
Returns
Type Parameters
Overrides
Microsoft.ML.Probabilistic.CommunicatorBase.ImmediateSend<T>(T, System.Int32, System.Int32)
Receive<T>(Int32, Int32, out T)
Receive a message from another process, blocking until the message is received.
Declaration
public override void Receive<T>(int source, int tag, out T value)
Parameters
Type |
Name |
Description |
Int32 |
source |
|
Int32 |
tag |
|
T |
value |
|
Type Parameters
Overrides
Microsoft.ML.Probabilistic.CommunicatorBase.Receive<T>(System.Int32, System.Int32, T)
Run(Int32, Action<ThreadCommunicator>)
Execute an action in multiple threads, waiting for them all to finish
Declaration
public static void Run(int numberOfThreads, Action<ThreadCommunicator> action)
Parameters
Implements