Click or drag to resize

TaskEnvironment Class

Represents the task environment in the system. The task environment provides common methods to run before and after Task is run.
Inheritance Hierarchy
SystemObject
  AGI.Parallel.InfrastructureTaskEnvironment
    AGI.Parallel.InfrastructureDefaultTaskEnvironment

Namespace:  AGI.Parallel.Infrastructure
Assembly:  AGI.Parallel.Infrastructure (in AGI.Parallel.Infrastructure.dll) Version: 2.9.0.1601 (2.9.0.1601)
Syntax
[SerializableAttribute]
public abstract class TaskEnvironment

The TaskEnvironment type exposes the following members.

Constructors
  NameDescription
Public methodTaskEnvironment
Initializes a new instance of the TaskEnvironment class.
Top
Properties
  NameDescription
Public propertyAdditionalId
Gets or sets the optional additional id of the environment. Environment can be reused if Environment IDs are identical.
Public propertyCode exampleAttachToDebugger
Gets or sets a value indicating whether to automatically attach the host processes to the debugger running the client submission code.
Public propertyCode exampleDebuggerType
Gets or sets the type of the debugger used by the host process to attach itself to Visual Studio.
Public propertyHostArchitecture
Gets or sets the desired CPU Architecture of the host that executes the task.
Public propertyHostGcMode
Gets or sets the garbage collection of the host environment.
Public propertyId
Gets or sets the id of the environment. Environment can be reused if the environment IDs are identical.
Public propertyName
Gets or sets the display name of the task environment.
Public propertyProperties
Gets task environment properties.
Public propertyRecycleSettings
Gets or sets the recycling settings that determine when to shutdown the host process on which tasks run.
Public propertyRequiredLicense
Gets or sets the required license associated with this environment.
Public propertyTasksPerHost Obsolete.
Gets or sets the number of tasks this environment will execute before shutting down.
Public propertyTeardownTimeout
Gets or sets the amount of time teardown can run for before it is timed-out in milliseconds.
Public propertyThreadApartmentState
Gets or sets the apartment state of the thread that will be used to set the task environment and execute the tasks. The default is to use STA (i.e. ApartmentState.STA).
Public propertyCode exampleWorkingDirectory
Gets or sets the custom working directory of the task environment.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetProperty(String)
Returns property value by name.
Public methodGetPropertyT(String)
Returns property value by name.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodCode exampleSetConfigurationFile
Specifies the .NET configuration file to load into the host application domain during task execution. If you wish to use the current configuration file, pass in [!:System.AppDomainSetup.ConfigurationFile].
Public methodCode exampleSetConfigurationString
Specifies the .NET configuration as a string to load into the host application domain during task execution.
Public methodSetProperty(String, Object)
Sets property value.
Public methodSetPropertyT(String, T)
Sets property value.
Public methodSetup
Called by Host before Task is executed.
Public methodTeardown
Called by Host after Task is executed.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks
You must implement this class so that it can be serialized by the .NET binary serializer. Add the SerializableAttribute attribute to your class and any other fields that this class references.
Examples
// You must always make the TaskEnvironment class serializable
[Serializable]
public class MyEnvironment : TaskEnvironment
{
    public override void Setup()
    {
        // Put your common setup logic in the Setup method
    }

    public override void Teardown()
    {
        // Put your common teardown logic in the Teardown method
    }
}
See Also

STK Parallel Computing Server 2.9 API for .NET