Search Results for

    Show / Hide Table of Contents

    Class ThreadCommunicator

    A mimic of the Communicator class in MPI.NET, that uses local threads only.

    Inheritance
    Object
    CommunicatorBase
    ThreadCommunicator
    Implements
    ICommunicator
    Inherited Members
    CommunicatorBase.ImmediateSend<T>(T[], Int32, Int32)
    CommunicatorBase.Send<T>(T, Int32, Int32)
    CommunicatorBase.Send<T>(T[], Int32, Int32)
    CommunicatorBase.Receive<T>(Int32, Int32, T[])
    CommunicatorBase.Gather<T>(T, Int32)
    CommunicatorBase.GatherFlattened<T>(T[], Int32)
    CommunicatorBase.Broadcast<T>(T, Int32)
    CommunicatorBase.Scatter<T>(T[], Int32)
    CommunicatorBase.Alltoall<T>(T[])
    CommunicatorBase.Alltoall<T>(T[][])
    CommunicatorBase.AlltoallFlattened<T>(T[], Int32[], Int32[])
    CommunicatorBase.Reduce<T>(T, Func<T, T, T>, Int32)
    CommunicatorBase.Allreduce<T>(T, Func<T, T, T>)
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Microsoft.ML.Probabilistic
    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
    Type Name Description
    ThreadCommunicator.SharedState shared
    Int32 rank

    Fields

    anySource

    Declaration
    public const int anySource = -2
    Field Value
    Type Description
    Int32

    anyTag

    Declaration
    public const int anyTag = -1
    Field Value
    Type Description
    Int32

    shared

    Declaration
    protected readonly ThreadCommunicator.SharedState shared
    Field Value
    Type Description
    ThreadCommunicator.SharedState

    Properties

    PercentTimeSpentWaiting

    Declaration
    public override double PercentTimeSpentWaiting { get; }
    Property Value
    Type Description
    Double
    Overrides
    CommunicatorBase.PercentTimeSpentWaiting

    Rank

    Declaration
    public override int Rank { get; }
    Property Value
    Type Description
    Int32
    Overrides
    CommunicatorBase.Rank

    Size

    Declaration
    public override int Size { get; }
    Property Value
    Type Description
    Int32
    Overrides
    CommunicatorBase.Size

    Methods

    Barrier()

    Declaration
    public override void Barrier()
    Overrides
    CommunicatorBase.Barrier()

    ImmediateReceive<T>(Int32, Int32, T[])

    Declaration
    public override ICommunicatorRequest ImmediateReceive<T>(int source, int tag, T[] values)
    Parameters
    Type Name Description
    Int32 source
    Int32 tag
    T[] values
    Returns
    Type Description
    ICommunicatorRequest
    Type Parameters
    Name Description
    T
    Overrides
    Microsoft.ML.Probabilistic.CommunicatorBase.ImmediateReceive<T>(System.Int32, System.Int32, T[])

    ImmediateReceive<T>(Int32, Int32, Action<T>)

    Declaration
    public override ICommunicatorRequest ImmediateReceive<T>(int source, int tag, Action<T> action)
    Parameters
    Type Name Description
    Int32 source
    Int32 tag
    Action<T> action
    Returns
    Type Description
    ICommunicatorRequest
    Type Parameters
    Name Description
    T
    Overrides
    Microsoft.ML.Probabilistic.CommunicatorBase.ImmediateReceive<T>(System.Int32, System.Int32, System.Action<T>)

    ImmediateSend<T>(T, Int32, Int32)

    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 Description
    ICommunicatorRequest
    Type Parameters
    Name Description
    T
    Overrides
    Microsoft.ML.Probabilistic.CommunicatorBase.ImmediateSend<T>(T, System.Int32, System.Int32)
    Remarks

    from the MPI.NET doc: it is crucial that outstanding communication requests be completed with a successful call to Wait or Test before the request object is lost.

    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
    Name Description
    T
    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
    Type Name Description
    Int32 numberOfThreads
    Action<ThreadCommunicator> action

    Implements

    ICommunicator
    In This Article
    Back to top Copyright © .NET Foundation. All rights reserved.