Share via


ICluster.AddTasks Method

Adds one or more specified tasks to the specified job.

Namespace: Microsoft.ComputeCluster
Assembly: CcpAPI (in ccpapi.dll)

Usage

Syntax

'Declaration
Function AddTasks ( _
    jobId As Integer, _
    tasks As IClusterEnumerable _
) As IClusterEnumerable
IClusterEnumerable AddTasks (
    int jobId,
    IClusterEnumerable tasks
)
IClusterEnumerable^ AddTasks (
    int jobId, 
    IClusterEnumerable^ tasks
)
IClusterEnumerable AddTasks (
    int jobId, 
    IClusterEnumerable tasks
)
function AddTasks (
    jobId : int, 
    tasks : IClusterEnumerable
) : IClusterEnumerable

Parameters

  • jobId
    The job identifier. The ICluster.AddJob method returns this value. If you have an instance of the job that has already been added to the cluster, you can access the IJob.Id property to get the identifier.
  • tasks
    An IClusterEnumerable interface that contains one or more ITask objects for the tasks that you want to add to the job.

Return Value

An IClusterEnumerable interface that contains a collection of integers that identify the tasks that were added to the job. The identifiers in this collection correspond directly to the tasks passed in the tasks parameter.

Remarks

If you need to add multiple tasks to a job, calling this method provides better performance than calling the ICluster.AddTask method in a loop.

To create the enumerable object that contains the collection of tasks, call the ICluster.CreateClusterEnumerable method. Then, call the IClusterEnumerable.Add method for each task object that you want to add to the enumerable object.

If this method fails to add one of the tasks to the job, none of the tasks are added to the job. The likely reason for failing to add a task to a job is if resource usage or run-time requirements of the task conflict with job.

A task cannot be modified after it is added to a job.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Microsoft Windows Compute Cluster Server 2003, Windows Server 2003, Windows XP

Target Platforms

Microsoft Windows Compute Cluster Server 2003, Windows Server 2003 with Compute Cluster Pack Client Utilities, Windows XP with Compute Cluster Pack Client Utilities

See Also

Reference

ICluster Interface
ICluster Members
Microsoft.ComputeCluster Namespace
ICluster.AddTask Method
CancelTasks
ListTasks
IJob.AddTask