ICluster.CancelJobs Method

Cancels one or more specified jobs.

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

Usage

Syntax

'Declaration
Sub CancelJobs ( _
    jobIds As IClusterEnumerable, _
    message As String _
)
void CancelJobs (
    IClusterEnumerable jobIds,
    string message
)
void CancelJobs (
    IClusterEnumerable^ jobIds, 
    String^ message
)
void CancelJobs (
    IClusterEnumerable jobIds, 
    String message
)
function CancelJobs (
    jobIds : IClusterEnumerable, 
    message : String
)

Parameters

  • jobIds
    An IClusterEnumerable interface that contains one or more job identifiers of the jobs to cancel. The ICluster.AddJob method returns the job identifier. 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 jobs were canceled. The message is limited to 320 Unicode characters. Can be empty.

    The message is stored with each canceled job. To get the message, access the IJob.ErrorMessage property.

Remarks

If you need to cancel multiple jobs, calling this method provides better performance than calling the ICluster.CancelJob method in a loop.

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

The jobs are removed from the queue but remain in the cluster until the value of the TTLCompletedJobs cluster configuration parameter is exceeded. For a description of this parameter, see the ICluster.SetClusterParameter method.

To cancel a job, the job's status must be: not submitted, queued, or running. If a job is running tasks when the job is canceled, the tasks are terminated and marked as failed. If you queue the job again, the tasks that were finished when the job was canceled stay finished, but all other tasks are queued (including those that failed).

If this method fails, only those jobs 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.AddJobs Method
ICluster.CancelJob Method
CancelTasks