Get-HpcTask

Get-HpcTask

Gets a specified task or subtask for the specified job, or gets a list of all tasks for the specified job.

Syntax

Parameter Set: id
Get-HpcTask -JobId <Int32> [-Scheduler <String> ] [-State <TaskState[]> ] [-SubTaskId <Int32> ] [-TaskId <Int32> ] [ <CommonParameters>]

Parameter Set: job
Get-HpcTask -Job <HpcJob> [-Scheduler <String> ] [-State <TaskState[]> ] [-SubTaskId <Int32> ] [-TaskId <Int32> ] [ <CommonParameters>]

Detailed Description

Gets a specified task or subtask for the specified job, or gets a list of all tasks for the specified job. You can cancel, requeue, or submit the task that you get with this cmdlet by using the Cancel, Requeue, or Submit method of the HpcTask object that the cmdlet returns.

Parameters

-Job<HpcJob>

An HpcJob object that corresponds to the job that contains the tasks or subtasks that you want to get. Use the Get-HpcJob cmdlet to get an HpcJob object for a job. You can specify either the Job parameter or the JobId parameter, but not both parameters at the same time.

Aliases

none

Required?

true

Position?

named

Default Value

no default

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-JobId<Int32>

Specifies the job identifier for the job that contains the tasks or subtasks that you want to get. Use the Get-HpcJob cmdlet to view a list of jobs and their job identifiers.

Aliases

none

Required?

true

Position?

named

Default Value

no default

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Scheduler<String>

Specifies the host name or IP address of the head node for the cluster that includes the tasks or subtasks. The value must be a valid computer name or IP address. If you do not specify the Scheduler parameter, this cmdlet uses the scheduler on the head node that the CCP_SCHEDULER environment variable specifies. To set this environment variable, run the following cmdlet:

Set-Content Env:CCP_SCHEDULER <head_node_name>

Aliases

none

Required?

false

Position?

named

Default Value

%CCP_SCHEDULER%

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-State<TaskState[]>

Specifies a list of states that the tasks or subtasks that you want to get should have. The following values are possible states: Configuring, Submitted, Validating, Queued, Dispatching, Running, Finishing, Finished, Failed, Canceled, Canceling, and All.

Aliases

none

Required?

false

Position?

named

Default Value

All

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SubTaskId<Int32>

Specifies the subtask identifier for the subtask that you want to get. Only parametric tasks have subtasks. A parametric task has one task identifier and multiple subtask identifiers.

Aliases

none

Required?

false

Position?

named

Default Value

no default

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TaskId<Int32>

Specifies the identifier of the task that you want to get.

Aliases

none

Required?

false

Position?

named

Default Value

no default

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • An HpcJob object.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • An HpcTask object.

Notes

  • If you specify the Job or JobId parameter, but not the TaskId or SubTaskID parameter, this cmdlet gets all of the tasks in the specified job. If any of the tasks are parametric tasks, the cmdlet also gets all of the subtasks of the parametric task.

    If you specify the Job or JobId parameter and specify a parametric task for the TaskId parameter, but do not specify the SubTaskID parameter, this cmdlet gets the parametric task, but not the subtasks of the parametric task.

Examples

EXAMPLE 1

Returns the fourth task from the job with a job identifier of 35.

PS C:\>Get-HpcTask -JobId 35 -TaskId 4

EXAMPLE 2

Gets all of the tasks from the job with a job identifier of 35.

PS C:\>Get-HpcJob -id 35 | Get-HpcTask

EXAMPLE 3

Uses the methods of the HpcTask object to requeue, cancel, and submit an individual task.

PS C:\>$t=Get-HpcTask -JobId 3 -TaskId 1 $t.Requeue() $t.Cancel() $t.Submit()

EXAMPLE 4

Gets the ninety-fifth step of the parametric sweep task that is the first task in the job with a job identifier of 3.

PS C:\>Get-HpcTask -JobId 3 -TaskId 1 -SubTaskId 95

Add-HpcTask

Get-HpcJob

Set-HpcTask