All Products
Search
Document Center

Elastic High Performance Computing:SubmitJob

Last Updated:Sep 07, 2026

Submits a job to a specified cluster.

Operation description

Operation description

Before submitting a job to a cluster, make sure that you have uploaded the job file (such as job.sh) to the cluster.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ehpc:SubmitJob

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ClusterId

string

Yes

The cluster ID.

You can call ListClusters to query the cluster ID.

ehpc-hz-FYUr32****

CommandLine

string

Yes

The command to run the job.

./LammpsTest/lammps.pbs

RunasUser

string

Yes

The username that is used to run the job.

You can call ListUsers to query the usernames in the cluster.

testuser

RunasUserPassword

string

No

The user password.

12****

Name

string

No

The job name. The name must be 6 to 30 characters in length, start with a letter, and can contain digits and periods (.).

jobtest

Priority

integer

No

The job priority. Valid values: 0 to 9. A larger value indicates a higher priority.

Default value: 0.

0

PackagePath

string

No

The path to run the job.

./Tem

StdoutRedirectPath

string

No

The path for standard output.

./LammpsTest

StderrRedirectPath

string

No

The path for error output.

./LammpsTest

ReRunable

boolean

No

Specifies whether the job can be rerun. Valid values:

  • true: The job can be rerun.

  • false: The job cannot be rerun.

false

ArrayRequest

string

No

The array job.

Format: X-Y:Z. The minimum value X is the first index, the maximum value Y is the last index, and Z is the step size. For example, 2-7:2 indicates that the job queue contains three sub-jobs numbered 2, 4, and 6.

1-10:2

Variables

string

No

The environment variables for the job. You can access the environment variables in the job execution file.

[{Name:test1,Value:value1},{Name:test2,Value:value2}]

InputFileUrl

string

No

The URL of the job file uploaded to Object Storage Service (OSS).

https://ehpc-hangzhou.oss-cn-hangzhou.aliyuncs.com/test-u4****/testlist_ehpc.sh

UnzipCmd

string

No

The command used to decompress the file downloaded from OSS. Valid values:

  • tar xzf: decompresses a gzip archive.

  • tar xf: decompresses a tar archive.

  • unzip: decompresses a zip archive.

tar xzf

PostCmdLine

string

No

The command to run after the job is submitted.

example.sh

JobQueue

string

No

The name of the queue in which the job runs.

You can call ListQueues to query the queue name.

workq

Node

integer

No

The number of compute nodes required to run the job.

Note

If this parameter is left empty, the Cpu, Task, Thread, Mem, and Gpu parameters do not take effect.

2

Cpu

integer

No

The number of CPU cores required for each compute node.

2

Task

integer

No

The number of processes created on each compute node.

This parameter is applicable to Message Passing Interface (MPI) jobs.

2

Thread

integer

No

The number of threads created on each compute node.

This parameter is applicable to OpenMP jobs.

1

Mem

string

No

The maximum memory usage of each compute node. Units: GB, MB, and KB. The unit is case-insensitive.

1GB

Gpu

integer

No

The number of GPUs used by each compute node.

This parameter takes effect only for clusters that use the PBS scheduler and whose compute nodes contain GPUs.

1

ClockTime

string

No

The maximum running time of the job. Three formats are supported:

  • hh:mm:ss

  • mm:ss

  • ss

The first format is recommended. For example, if the maximum running time is 12 hours, set this parameter to 12:00:00.

12:00:00

JobRetry.Count

integer

No

The number of job retries. Valid values: 1 to 10. The job retry feature is applicable only to PBS clusters.

Note

If this parameter is left empty, the JobRetry.Priority and JobRetry.OnExitCode parameters do not take effect.

5

JobRetry.Priority

integer

No

The priority of the retry job. Valid values: 0 to 9. A larger value indicates a higher priority.

Note

If this parameter is left empty, the retry job priority is calculated as min{original job priority + 1, 9}.

1

JobRetry.OnExitCode

integer

No

The condition for job retry. A job retry is triggered when the exit code matches the value of this parameter.

Note

If this parameter is left empty, a job retry is triggered when the exit code is not 0.

1

Async

boolean

No

Specifies whether to use an asynchronous message link to submit the job.

Default value: false.

false

Response elements

Element

Type

Description

Example

object

JobId

string

The job ID.

1.manager

RequestId

string

The request ID.

04F0F334-1335-436C-A1D7-6C044FE7****

Examples

Success response

JSON format

{
  "JobId": "1.manager",
  "RequestId": "04F0F334-1335-436C-A1D7-6C044FE7****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParams The specified parameter %s is invalid. The specified parameter %s is invalid.
400 NotEnabled You have not enabled this service You have not enabled this service
400 InDebt Your account has overdue payments. Your account has overdue payments.
500 UnknownError An unknown error occurred. An unknown error occurred.
403 InvalidClusterStatus The operation failed due to invalid cluster status. The cluster status does not support the operation.
403 ConflictOpt A conflicting operation is running. A conflicting operation is running. Please try again later.
403 UsernameExist The username already exists. The username already exists.
403 IncorrectCredential The username or password is incorrect. The username or password is incorrect.
403 AgentError.Account.ValidateCredentialFailure Username or password verification failed. Username or password verification failed.
404 ClusterNotFound The specified cluster does not exist. The specified instance does not exist.
404 ContainerNotFound The specified container does not exist. The specified container does not exist.
404 ManagerNotFound The manager nodes do not exist or their status is abnormal. The manager nodes do not exist or their status is abnormal.
503 ServiceUnavailable The request has failed due to a temporary failure of the server The request has failed due to a temporary failure of the server.
406 AgentError.Job.SubmitFailure Failed to submit jobs: %s Failed to submit the jobs.
406 AgentError.Job.InvalidContainerType Unsupported container type: %s. The container type is not supported: %s.
406 AliyunError An Alibaba Cloud product error occurred. Alibaba Cloud product error. %s
406 AgentError.Account.AccountValidateCredentialFailure Cannot get user info Failed to retrieve user information.
406 AgentResponseTimeout Agent response timeout: %s The proxy response timed out.
406 AgentError The agent service request failed: %s Operation unsuccessful: %s
407 NotAuthorized You are not authorized by RAM for this request. The request is not authorized by RAM.
409 PartFailure Part of the batch operation failed. Part of the batch operation failed.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.