Key Concepts |
There are three key concepts in the STK Parallel Computing Desktop API: ScenarioTask, ScenarioJob, and the ScenarioJobExecutionService.
This topic contains the following sections:
A ScenarioTask is a basic building block of a parallel job. A ScenarioJob contains one or more of these tasks, which get executed in parallel.
A ScenarioTask has a special Execute method that provides access to the STK Scenario. STK Parallel Computing automatically calls this function when the task has been scheduled and is ready for processing.
Developers must extend ScenarioTask to create their own custom task class, which can use properties to define unique inputs and supply an implementation of the Execute method. The output of the task's Execute method should be stored in its Result property.
All classes inheriting from ScenarioTask must be marked with the Serializable attribute.
A ScenarioJob allows one or more ScenarioTasks to be managed as a unit. Afer constructing a new ScenarioJob, use the AddTask method to add individual tasks to the job.
The ScenarioJob class also provides capabilities for monitoring the execution status of its tasks. The TaskCompleted event is fired after each task is completed. This is a useful mechanism for retrieving and saving/processing the results of each task as the job continues to execute other tasks, instead of waiting for the entire job to finish. Once the ScenarioJob has completed, its Status property can be inspected to see whether the job failed, was cancelled, or completed successfully.
All classes inheriting from ScenarioJob must be marked with the Serializable attribute.
A class implementing the IJobExecutionService interface, such as ScenarioJobExecutionService, serves as the main entry point for executing jobs using STK Parallel Computing.
The ScenarioJobExecutionService is a singleton. Use the GetInstance method to retrieve an instance of the class and then submit a ScenarioJob using the ExecuteJob.
STK Parallel Computing Desktop API 2.9