Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Get-HpcTask

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

Syntax

Get-HpcTask [-Scheduler <string>] [-State <TaskState[]>] [-SubTaskId <int>] [-TaskId <int>] -JobId <int> [<CommonParameters>]

Get-HpcTask [-Scheduler <string>] [-State <TaskState[]>] [-SubTaskId <int>] [-TaskId <int>] -Job <HpcJob> [<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.

 

Required?

true

Position?

named

Default Value

no defualt

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-JobId <int>

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.

 

Required?

true

Position?

named

Default Value

none

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>

 

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.

 

Required?

false

Position?

named

Default Value

All

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SubTaskId <int>

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.

 

Required?

false

Position?

named

Default Value

no default

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TaskId <int>

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

 

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.

Input and Return Types

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

 

Input Type

An HpcJob object.

Return Type

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.

Example 1

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

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

Example 2

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

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

Example 3

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

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

Example 4

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

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

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.