Getting Started |
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:
Using the STK Parallel Computing Server 2.9 Install (available as separate install), install both the Coordinator and the Agent on the development machine using install.exe.
Caution |
---|
The Java API requires an STK Parallel Computing Server 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 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.
Move the STK Parallel Computing Server 2.9 Coordinator and Agent tar files to a directory where you would like to store the Coordinator and Agent.
Unpack the Coordinator tar file using the command "tar -xvf STK_Parallel_Computing_Coordinator_v2.9.tgz".
Unpack the Agent tar file using the command "tar -xvf STK_Parallel_Computing_Agent_v2.9.tgz".
Open the README.txt files in each of the created Coordinator and Agent directories to guide the rest of the configuration.
Although not strictly required when developing, there are many advantages for running the Coordinator and Agent in console mode rather than as Windows Services:
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.
Set the startup type from the default of Automatic to Manual. Do this both for the Coordinator and the Agent.
Open a command prompt and start AGI.Parallel.CoordinatorService.exe found in [Install Directory]\Coordinator\bin. e.g.
Note |
---|
"C:\Program Files\AGI\STK Parallel Computing Server 2.9\Coordinator\bin\AGI.Parallel.CoordinatorService.exe" |
Open a second command prompt and start AGI.Parallel.AgentService.exe found in [Install Directory]\Agent\bin. e.g.
Note |
---|
"C:\Program Files\AGI\STK Parallel Computing Server 2.9\Agent\bin\AGI.Parallel.AgentService.exe" |
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\AGI\STK Parallel Computing Server 2.9\Agent\bin\AGI.Parallel.AgentService.exe" /? |
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.
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.
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. |
STK Parallel Computing Server 2.9 API for Java