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: 1.2.0.275 (1.2.0.275)

Syntax

C#
int GetMaximumHostCount()
Visual Basic
Function GetMaximumHostCount As Integer

Return Value

Maximum number of threads for the job scheduler.

Examples

  Copy imageCopy
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.
             */
        }
    }
}

Exceptions

Exception Condition
AGI.Parallel.Client..::..JobSchedulerException If operation fails.

See Also