ISchedulerJob.CancelTask Method (ITaskId, String, Boolean)

Cancels the specified task with the option to specify that you want to cancel the task immediately without using for the grace period for canceling a task, and provides the specified message to the user to explain the task was canceled.


Namespace: Microsoft.Hpc.Scheduler
Assembly: Microsoft.Hpc.Scheduler (in Microsoft.Hpc.Scheduler.dll)

'Usage
Dim instance As ISchedulerJob
Dim taskId As ITaskId
Dim message As String
Dim isForce As Boolean

instance.CancelTask(taskId, message, isForce)

void CancelTask (
	ITaskId taskId,
	string message,
	bool isForce
)
void CancelTask (
	ITaskId taskId, 
	String message, 
	boolean isForce
)
function CancelTask (
	taskId : ITaskId, 
	message : String, 
	isForce : boolean
)

Parameters

taskId

A ITaskId object that identifies the task to cancel.

message

A string that specifies the message that you want to provide to the user to explain why the task was canceled.

isForce

A Boolean that specifies whether to stop the task immediately without using the grace period for canceling a task. True indicates that the method should stop the task immediately without using the grace period for canceling a task. False indicates that the method should use the grace period for canceling a task.

To cancel a task, the state of the task must be Configuring, Submitted, Queued, or Running. If a task is running when it is canceled, the task ends and the state of the task changes to Failed. If you cancel a task with a task of Configuring or Queued, the state of the task changes to Canceled.

If you cancel a parametric task, the state of the parametric master task always changes to Canceled, and all of the individual subtasks are canceled. If the subtask is running when you cancel the parametric task, the state of the subtask changes to Failed. If the subtask is in a state other than Running, the state of the subtask changes to Canceled.

To determine the state of a task, use the ISchedulerTask.State property.

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

An application must respond to the CTRL+BREAK key combination to use the grace period for tasks.

To cancel a task without providing a message to the user that explains the reason you canceled the task, use the CancelTask(ITaskId) method.

Calling the CancelTask(ITaskId,String) method is equivalent to calling the CancelTask(ITaskId,String,Boolean) method with the isForce parameter set to false. For better performance, call the CancelTask(ITaskId,String,Boolean) method with the isForce parameter set to false instead of calling CancelTask(ITaskId,String).

Platform Note: This method was introduced in Windows HPC Server 2008 R2 and is not supported in previous versions.


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

Development Platforms

Windows XP, Windows Vista, Windows 7, Windows 8, Windows Server 2003, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012

Target Platforms

Windows XP, Windows Vista, Windows 7, Windows 8, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, with HPC Pack Client Utilities




Build Date:

2013-04-22
Show: