Get-HpcTask

Get-HpcTask

Gets a task or subtask for a job.

Syntax

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

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




Detailed Description

The Get-HpcTask cmdlet 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

-ClusterConnectionString<String[]>

Specifies an array of cluster connection strings for the cluster to which you want to add the device drivers. The value format is host1,host2,host3. If you do not specify the ClusterConnectionString parameter, this cmdlet uses the connection string on the head node that the CCP_CONNECTIONSTRING environment variable specifies. To set this environment variable, run the following cmdlet: Set-Content Env: CCP_CONNECTIONSTRING <head_node_name>.

This parameter was introduced in HPC Pack 2016.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Job<HpcJob>

Specifies 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

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-JobId<Int32>

Specifies the job ID 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 IDs.


Aliases

none

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>


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-State<TaskState[]>

Specifies an array of states that the tasks or subtasks that you want to get should have. Valid values are:

-- Configuring
-- Submitted
-- Validating
-- Queued
-- Dispatching
-- Running
-- Finishing
-- Finished
-- Failed
-- Canceled
-- Canceling
-- All


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SubTaskId<Int32>

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


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TaskId<Int32>

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


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

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

Inputs

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

  • HpcJob

Outputs

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

  • HpcTask

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: Get a task by ID

This command gets the fourth task from the job with a job ID of 35.


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

Example 2: Get all tasks from a job

This command gets all of the tasks from the job with a job ID of 35.


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

Example 3: Use HpcTask object methods

The first command gets the specified HpcTask object, and then stores it in the $T variable.

The second command uses the methods of the HpcTask object in $T to requeue, cancel, and submit a task.


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

Example 4: Get a parametric subtask

This command gets the ninety-fifth step of the parametric sweep task that is the first task in the job with a job ID of 3.


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

Related topics

Community Additions

ADD
Show: