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.

Caution

The Java API requires an STK Scalability 1.0.2 install or later. Previous versions do not support Java.

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 Coodinator 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 the 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

Verify connecting to the Coordinator

The final step to ensure a working development setup is compiling a simple application and connecting to the Coordinator.

Create a file called GettingStartedCluster.java and copy and paste the contents below.

Java  Copy imageCopy
import agi.parallel.client.ClusterJobScheduler;
import agi.parallel.client.IJobScheduler;

public class GettingStartedCluster {
    public static void main(String[] args) {
        IJobScheduler scheduler = new ClusterJobScheduler("localhost");
        try {
            scheduler.connect();
            System.out.println("Congratulations, you can start coding!");
        } finally {
            scheduler.dispose();
        }
    }
}

Assuming you changed the location of agi.parallel.client-1.1.0.jar to the path of the jar on your machine, compile GettingStartedCluster.java and create a jar. Execute the following commands:

  Copy imageCopy
javac -classpath agi.parallel.client-1.1.0.jar GettingStartedCluster.java
jar cvf GettingStartedCluster.jar *.class
java -classpath "GettingStartedCluster.jar;agi.parallel.client-1.1.0.jar" GettingStartedCluster

If you get an error such as "package agi.parallel.client does not exist", make sure you changed the command to match your agi.parallel.client-1.1.0.jar path.

Getting Started Console

If everything goes smoothly - congratulations! Everything is setup for developing applications for the cluster scheduler. Let's get 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.

See Also

Other Resources