Click or drag to resize

ClusterJobScheduler.GetMaximumHostCount Method

Returns the maximum number of hosts that is available to the job scheduler.

Namespace:  AGI.Parallel.Client
Assembly:  AGI.Parallel.Client (in AGI.Parallel.Client.dll) Version: 2.10.0.1777 (2.10.0.1777)
Syntax
public int GetMaximumHostCount()

Return Value

Type: Int32
Maximum number of threads for the job scheduler.

Implements

IJobScheduler.GetMaximumHostCount()
Exceptions
ExceptionCondition
JobSchedulerExceptionCoordinator did not respond within the specified timeout value.
Examples
using System;
using AGI.Parallel.Client;
using AGI.Parallel.Infrastructure;

namespace CodeSamples
{
    class Program
    {
        static void Main(string[] args)
        {
            using (IJobScheduler scheduler = new ClusterJobScheduler("localhost"))
            {
                scheduler.Connect();
                int numHosts = scheduler.GetMaximumHostCount();
                Console.WriteLine("There are {0} hosts available to the job scheduler.", numHosts);
            }

            /*
             * The output of the application should resemble:
             * There are 4 hosts available to the job scheduler.
             */
        }
    }
}
See Also

STK Parallel Computing Server 2.10 API for .NET