Job Creation

For the creation of the job, /heappe/JobManagement/CreateJob endpoint is used. The endpoint is used to create a new job in the HEAppE system. The job is created with the specified tasks and parameters.

HEAppE JobSpecification

HEAppE JobSpecification can wrap multiple HEAppE Tasks which are representation of the HPC jobs. The following text describes the payload of the HEAppE JobSpecification.

HEAppE JobSpecification

Field

Type

Description

MaxLength

IsRequired

Example Values

Name

string

Name of the job

50

Yes

TestJob

ProjectId

integer

Id of the project

Yes

1

WaitingLimit

integer

Maximum time in seconds the job can wait in the queue

No, default 0

900

NotificationEmail

string

Email address for notifications

50

No, default null

user@example.com

PhoneNumber

string

Phone number for notifications, not available

20

No, default null

7777676767

NotifyOnAbort

boolean

Whether to notify on job abortion

No, default false

true/false

NotifyOnFinish

boolean

Whether to notify on job completion

No, default false

true/false

NotifyOnStart

boolean

Whether to notify on job start

No, default false

true/false

ClusterId

integer

Id of the cluster where the job will run

Yes

1

FileTransferMethodId

integer

Id of the file transfer method

Yes

1

IsExtraLong

boolean

Whether the job is extra long

No, default false

true/false

EnvironmentVariables

array of objects

Environment variables for the job

No, default null

null/Environment Variables

Tasks

array of objects

Tasks of the job

Yes, at least one

HEAppE Task

HEAppE Task

HEAppE Task is a part of the HEAppE JobSpecification. HEAppE Task is representation of the HPC job. The following text describes the payload of the HEAppE Task.

HEAppE Task

Field

Type

Description

MaxLength

IsRequired

Example Values

Name

string

Name of the task

50

Yes

TestTask

MinCores

integer

Minimum number of cores

No, default 0, <= MaxCores

2

MaxCores

integer

Maximum number of cores

Yes

4

WalltimeLimit

integer

Maximum time in seconds the task can run

Yes

900

PlacementPolicy

string

Placement policy

40

No

Priority

integer

Priority of the task

No

1

JobArrays

string

Job arrays

No

null/1-10/1-10:2

IsExclusive

boolean

Whether the task is exclusive

No, default false

true/false

IsRerunnable

boolean

Whether the task is rerunnable

No, default false

true/false

StandardInputFile

string

Standard input file

30

No

stdin

StandardOutputFile

string

Standard output file

30

No

stdout

StandardErrorFile

string

Standard error file

30

No

stderr

ProgressFile

string

Progress file

No

progress.txt

LogFile

string

Log file

No

log.txt

ClusterTaskSubdirectory

string

Cluster task subdirectory

50

No

null/subdir

ClusterNodeTypeId

integer

Id of the cluster node type

Yes

1

CommandTemplateId

integer

Id of the command template

Yes

1

CpuHyperThreading

boolean

Whether the task uses CPU hyper-threading

No, default false

true/false

RequiredNodes

array of strings

Required nodes

No, default null

null/["cn1", "cn2"]

TaskParalizationParameters

array of objects

Task parallelization parameters

No

null/Task Paralization Parameters

EnvironmentVariables

array of objects

Environment variables for the task

No

null/Environment Variables

TemplateParameterValues

array of objects

Template parameter values

Depends on the command template

null/Template Parameter Values

Environment Variables

Environment variables are part of the HEAppE JobSpecification and HEAppE Task. The following text describes the payload of the EnvironmentVariables.

EnvironmentVariables

Field

Type

Description

Example Values

Name

string

Name of the environment variable

ENV_VAR1

Value

string

Value of the environment variable

value1

Task Paralization Parameters

Task parallelization parameters are part of the HEAppE Task. The following text describes the payload of the Task Paralization Parameters.

Task Paralization Parameters

Field

Type

Description

Example Values

MPIProcesses

integer

Number of MPI processes

4

OpenMPThreads

integer

Number of OpenMP threads

8

MaxCores

integer

Maximum number of cores

16

Template Parameter Values

Template parameter values are part of the HEAppE Task. The following text describes the payload of the Template Parameter Values.

Template Parameter Values

Field

Type

Description

Example Values

CommandParameterIdentifier

string

Identifier of the command parameter

inputParam

ParameterValue

string

Value of the parameter

value1

Example Request

curl -X 'POST' \
  'http://localhost:5000/heappe/JobManagement/CreateJob' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
        "SessionCode":"123e4567-e89b-12d3-a456-426614174000",
        "JobSpecification":{
            "Name":"TestJob",
            "ProjectId":1,
            "WaitingLimit":900,
            "NotificationEmail":"user@example.com",
            "PhoneNumber":"7777676767",
            "NotifyOnAbort":true,
            "NotifyOnFinish":true,
            "NotifyOnStart":false,
            "ClusterId":1,
            "FileTransferMethodId":1,
            "IsExtraLong":false,
            "EnvironmentVariables":[
              {
                  "Name":"ENV_VAR1",
                  "Value":"value1"
              },
              {
                  "Name":"ENV_VAR2",
                  "Value":"value2"
              }
            ],
            "Tasks":[
              {
                  "Name":"TestTask",
                  "MinCores":2,
                  "MaxCores":4,
                  "WalltimeLimit":3600,
                  "PlacementPolicy":"",
                  "Priority":1,
                  "JobArrays":"1-10",
                  "IsExclusive":true,
                  "IsRerunnable":false,
                  "StandardInputFile":"stdin",
                  "StandardOutputFile":"stdout",
                  "StandardErrorFile":"stderr",
                  "ProgressFile":"progress.txt",
                  "LogFile":"log.txt",
                  "ClusterTaskSubdirectory":"",
                  "ClusterNodeTypeId":1,
                  "CommandTemplateId":1,
                  "CpuHyperThreading":true,
                  "RequiredNodes":[
                  ],
                  "TaskParalizationParameters":[
                    {
                        "MPIProcesses":4,
                        "OpenMPThreads":8,
                        "MaxCores":16
                    }
                  ],
                  "EnvironmentVariables":[
                    {
                        "Name":"TASK_ENV_VAR1",
                        "Value":"task_value1"
                    }
                  ],
                  "DependsOn":[
                  ],
                  "TemplateParameterValues":[
                    {
                        "CommandParameterIdentifier":"inputParam",
                        "ParameterValue":"value1"
                    }
                  ]
              }
            ]
        }
      }'

Note

The response of the /heappe/JobManagement/CreateJob endpoint will be a JSON object containing the ID of the created job and this ID must be used for further operations with the job (Submit, Monitor, Cancel, Delete, FileTransfer).