Click or drag to resize

Getting Started Cluster Scheduler

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

Note 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 Parallel Computing Server 2.9 Install, install both the Coordinator and the Agent on the development machine using install.exe.

Caution note Caution

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

Tip 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 Install and check Coordinator. After the install finishes, the Coordinator will be available on the machine.

Start the Install and check Agent. When prompted for the user setting, specify DOMAIN\USERNAME, e.g. mydomain\username.

After the install finishes, an Agent will be available on the machine.

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 services are "STK Parallel Computing Coordinator" and "STK Parallel Computing 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 Note

"C:\Program Files\AGI\STK Parallel Computing Server 2.9\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 Note

"C:\Program Files\AGI\STK Parallel Computing Server 2.9\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 Note

"C:\Program Files\AGI\STK Parallel Computing Server 2.9\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
import agi.parallel.client.ClusterJobScheduler;
import agi.parallel.client.IJobScheduler;

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

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

javac -classpath agi.parallel.client-2.9.0.jar GettingStartedCluster.java
jar cvf GettingStartedCluster.jar *.class
java -classpath "GettingStartedCluster.jar;agi.parallel.client-2.9.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-2.9.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 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

STK Parallel Computing Server 2.9 API for Java