EmbeddedJobScheduler Class |
Namespace: AGI.Parallel.Client
The EmbeddedJobScheduler type exposes the following members.
Name | Description | |
---|---|---|
EmbeddedJobScheduler |
Initializes a new instance of the EmbeddedJobScheduler class
passing in the number of cores as the number of hosts to start.
| |
EmbeddedJobScheduler(Int32) |
Initializes a new instance of the EmbeddedJobScheduler class
passing in the number of cores as the number of hosts to start and the default
machine memory budget.
| |
EmbeddedJobScheduler(Int32, Int32) |
Initializes a new instance of the EmbeddedJobScheduler class
passing in 32 as the number of tasks per host.
| |
EmbeddedJobScheduler(Int32, Int32, Int32) |
Initializes a new instance of the EmbeddedJobScheduler class.
|
Name | Description | |
---|---|---|
Id |
Gets or sets the identifier associated with this scheduler.
| |
IsConnected |
Gets a value indicating whether the job scheduler is connected.
|
Name | Description | |
---|---|---|
CancelJob |
Cancels the job with the specified id.
| |
CancelTask |
Cancels the task with the specified id.
| |
Connect |
Connects client to embedded scheduler.
| |
CreateJob |
Returns a new job that can later be used to submit to the job scheduler.
| |
Disconnect |
Disconnects client from embedded scheduler.
| |
Dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetHostLog |
Gets the host log.
| |
GetMaximumHostCount |
Returns the maximum number of hosts that is available to the job scheduler.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetVersionInfo |
Gets the version info of the job scheduler.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
PostMessage(Object, Guid) |
Posts a message to the specified target mailbox.
| |
PostMessage(Object, Guid, Boolean) |
Posts a message to the specified target mailbox.
| |
ReceiveMessage |
Receives a message from the participant's mailbox. Blocks the current thread until a message arrives.
| |
ReceiveMessage(Guid) |
Receives a message from the participant's mailbox. Blocks the current thread until a message arrives.
| |
ReceiveMessage(Int32) |
Receives a message from the participant's mailbox. Blocks the current thread until a message arrives.
| |
ReceiveMessage(Int32, Guid) |
Receives a message from the participant's mailbox. Blocks the current thread until a message arrives.
| |
SubmitJob |
Submits job to the job scheduler so that the job scheduler can add the job to it's queue.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
WaitUntilDone |
Blocks until all tasks in this job complete or the operation times out.
The callback passed in for the heartbeat is called with the period
specified by the millisecondsHeartbeat argument.
|
Name | Description | |
---|---|---|
NewMessage |
Occurs when a new message arrives.
|
using System; using AGI.Parallel.Client; using AGI.Parallel.Infrastructure; namespace CodeSamples { class Program { static void Main(string[] args) { // Create the EmbeddedJobScheduler class. // You can optionally specify the number of cores you want to use. // By default, it will use the number of cores available on your machine. using (IJobScheduler scheduler = new EmbeddedJobScheduler(4)) { // Before you use any methods on the object, you must call Connect. try { scheduler.Connect(); // Create a job, add a task, and submit. Job job = scheduler.CreateJob(); job.AddTask(new HelloTask()); job.Submit(); job.WaitUntilDone(); Console.WriteLine("Result: " + job.Tasks[0].Result); } catch (JobSchedulerException e) { Console.WriteLine("JobSchedulerException: " + e); } } } [Serializable] public class HelloTask : Task { public override void Execute() { Result = "Hello from Task"; } } } }
STK Parallel Computing Server 2.9 API for .NET