ICluster.CancelTasks Method

Cancels one or more specified tasks.

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

Usage

Syntax

'Declaration
Sub CancelTasks ( _
    jobId As Integer, _
    taskIds As IClusterEnumerable, _
    message As String _
)
void CancelTasks (
    int jobId,
    IClusterEnumerable taskIds,
    string message
)
void CancelTasks (
    int jobId, 
    IClusterEnumerable^ taskIds, 
    String^ message
)
void CancelTasks (
    int jobId, 
    IClusterEnumerable taskIds, 
    String message
)
function CancelTasks (
    jobId : int, 
    taskIds : IClusterEnumerable, 
    message : String
)

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.
  • message
    A message that describes the reason why the tasks were canceled. The message is limited to 320 Unicode characters. This parameter can be NULL.

    The message is stored with each canceled task. To get the message, access the ITask.ErrorMessage property.

Remarks

If you need to cancel multiple tasks, calling this method provides better performance than calling ICluster.CancelTask in a loop.

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

To cancel a task, the task's status must be: not submitted, queued, or running. If a task is running when it is canceled, the task is terminated and the status of the task changes to Cancelled (see TaskStatus). To determine a task's status, access the ITask.Status property.

You can call the ICluster.RequeueTask method to queue the task again.

If the method fails, only those tasks canceled before the failure are canceled.

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.AddTasks Method
ICluster.CancelTask Method
ListTasks
TaskStatus