Perform these steps to develop applications targeting the Cluster Job Scheduler.

Note

These instructions are intended to jump start developers during development. When deploying systems in production, please follow the instructions in the Help System.

After setting up an environment, consider completing the Programmer's Guide to learn how to submit jobs to the cluster scheduler.

Setting up your environment for the cluster scheduler, consists of the following:

Install Coordinator and Agent

Using the STK Scalability 1.2 Install (available as separate install), install both the Coordinator and the Agent on the development machine using setup.exe.

Tip

When starting, running the Coordinator and Agent on the same machine as the development machine is strongly recommended. This help system always hardcodes the Coordinator hostname to localhost. To use a Coordinator installed on another machine, replace localhost with the Coordinator's IP address or name.

Start the Coordinator Install. When prompted for the Coordinator user account the default SYSTEM account is fine. After the install finishes, the Coordinator will be available on the machine.

Coordinator Install

Start the Agent Install. When prompted for the user setting, specify either DOMAIN\USERNAME, e.g. mydomain\username, or choose to run as SYSTEM. If planning to run in Console Mode as explained below, it does not matter which option is chosen.

Agent Install

When prompted for the Coordinator machine name, leave that field as 127.0.0.1. After the install finishes, an Agent will be available on the machine.

Agent Install 2

Optionally run Coordinator and Agent in console mode

Although not strictly required when developing, there are many advantages for running the Coordinator and Agent in console mode rather than as Windows Services:

  • Easier debugging
  • Logging is automatically displayed on the console
  • Restart and shutdown Coordinator and Agent faster

Instructions to disable coordinator and agent from automatically starting

Open Computer Management and find the Coordinator and Agent services. The name for the Coordinator and Agent Windows sevices are "STK Scalability Coordinator" and "STK Scalability Agent" respectively.

Find Services In Computer Management

Set the startup type from the default of Automatic to Manual. Do this both for the Coordinator and the Agent.

Coordinator Service Properties

Start Coordinator and Agent console applications

Open a command prompt and start AGI.Parallel.CoordinatorService.exe found in [Install Directory]\Coordinator\bin. e.g.

Note

"C:\Program Files (x86)\AGI\STK Scalability 1.2\Coordinator\bin\AGI.Parallel.CoordinatorService.exe"

Coordinator Console

Open a second command prompt and start AGI.Parallel.AgentService.exe found in [Install Directory]\Agent\bin. e.g.

Note

"C:\Program Files (x86)\AGI\STK Scalability 1.2\Agent\bin\AGI.Parallel.AgentService.exe"

Agent Console

Options in Console Mode

In console mode, options can be specified via the command line. This is especially useful when starting an agent as an easy way to specify the Coordinator name and the number of hosts to use. To see the options, append the /? flag. e.g.

Note

"C:\Program Files (x86)\AGI\STK Scalability 1.2\Agent\bin\AGI.Parallel.AgentService.exe" /?

Agent Console Options

Setup Visual Studio project and add necessary assemblies

In Visual Studio, create a new Visual C# or Visual Basic project targeting .NET 3.5 or greater.

Visual Studio Project Setup

Add AGI.Parallel.Client.dll, AGI.Parallel.Infrastructure.dll to the project references.

Cluster Add Required Assemblies
Caution

For .NET 4.0, the API requires Full Target. By default, Visual Studio may set the default target to Client Profile Only These errors and warnings may be displayed:

Dot Net Profile Only Warning

To fix this, set the target framework to .NET Framework 4 or .NET Framework 3.5

Dot Net Profile Specify Framework

Verify connecting to the Coordinator

The final step to ensure a working development setup is compiling a simple application and connecting to the Coordinator. In the Program.cs file of the project, copy and paste the code below. Compile and run. If everything goes smoothly - congratulations! Everything is setup for developing applications for the cluster scheduler. Let's get coding!

C#  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();
                Console.WriteLine("Congratulations, you can start coding!");
            }
        }
    }
}
Note

If an exception is thrown at the Connect method that says something like "Cannot connect to Coordinator," the most likely reason is that the Coordinator is not running on the specified machine and port. Make sure the coordinator is running on that machine and confirm a firewall is not blocking the port.

Cluster Connect Exception

See Also

Other Resources