Creates a job template.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateJobTemplate

The operation that you want to perform. Set the value to CreateJobTemplate

CommandLine String Yes . /LammpsTest/lammps.pbs

The job command.

Name String Yes jobtemplate1

The name of the job template.

RunasUser String No user1

The name of the user that submitted the job.

Priority Integer No 0

The priority that is used to process the jobs. A smaller value represents a higher priority. Valid values: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.

Default value: 0.

PackagePath String No ./jobfolder

The directory where the job command resides

StdoutRedirectPath String No . /LammpsTest

The path to which the standard output is redirected.

StderrRedirectPath String No . /LammpsTest

The path to which the error output is redirected.

ReRunable Boolean No false

Specifies whether the job can be run again. Valid values:

  • true: rerun is supported
  • false: rerun is not supported
ArrayRequest String No 1-10:2

The queue job. Example: 1-10:2.

Variables String No [{Name:,Value:},{Name:,Value:}]

The environment variables of the job.

Queue String No workq

The queue of the job.

ClockTime String No 12:00:00

The maximum running time. Format:

  • hh:mm:ss
  • mm:ss
  • ss

We recommend that you use the hh:mm:ss format. If the maximum running time is 12 hours, the value is shown as 12:00:00.

Node Integer No 2

The number of the compute nodes. Valid values: 1 to 5000.

Note If this parameter is not specified, the Task, Thread, Mem, and Gpu parameters will become invalid.
Task Integer No 2

The number of tasks per compute node. Valid values: 1 to 20000.

Thread Integer No 1

The number of threads for a single task. Valid values: 1 to 20000.

Mem String No 1GB

The maximum memory usage per compute node. Valid values: GB, MB, or KB. The units are not case-sensitive.

Gpu Integer No 1

The maximum GPU usage for a single compute node. This parameter is available only to clusters that use the Portable Batch System (PBS) scheduler. The value of this parameter takes effect only when the compute nodes in the cluster contain GPUs. Valid values: 1 to 20000.

Response parameters

Parameter Type Example Description
RequestId String 04F0F334-1335-436C-A1D7-6C044FE73368

The ID of the request.

TemplateId String ehpc-job-tmpl-6RxO5y****

The ID of the job template.

Examples

Sample requests

https://ehpc.cn-hangzhou.aliyuncs.com/?Action=CreateJobTemplate
&CommandLine=. /LammpsTest/lammps.pbs
&Name=jobtemplate1
&<Common request parameters>

Sample success responses

XML format

<CreateJobTemplateResponse>
      <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
      <TemplateId>ehpc-job-tmpl-6RxO5y****</TemplateId>
</CreateJobTemplateResponse>

JSON format

{
    "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
    "TemplateId": "ehpc-job-tmpl-6RxO5y****"
}

Error codes

HttpCode Error code Error message Description
503 ServiceUnavailable The request has failed due to a temporary failure of the server The error message returned because the request has failed. The server is temporarily unavailable.

For a list of error codes, visit the API Error Center.