Launch Jobs with Non-default Options
The nc_run.py example program shown earlier can submit an Accelerator job with no customizations. In reality, users often need to specify non-default properties for the jobs they submit. Examples are resources, slot counts, auto-kill times, and numerous other options that can be seen on the nc run -h CLI command help information and in the documentation with the Altair Accelerator Administrator Guide.
- Field in Array
- Description
- autokill
- Set the autokill flag (option -kill)
- check,directory
- Set it to 0 to disable checking of canonicalization of current directory (option -D)
- env
- Environment of the job (option -e). Set this to "" or to DEFAULT to force the use of an environment snapshot.
- force
- Force the job to be rescheduled (option -F)
- group
- Group the job belongs to (options -g and -G)
- inputs
- List of input files (dependencies) (option -i)
- priority, default
- Default priority (NOT USED)
Although the above document has good descriptions of the fields/keys that can be provided to job launch requests, some of those fields are usable in Accelerator jobclass definitions but not in REST job requests. To see the precise list of fields/keys that are supported in REST requests, see the Swagger docs described in the REST Request Detailed Documentation section later in this tutorial.
You can modify the nc_run.py script previously shown (or the nc_run2.py script in an upcoming section) with additional options specified as key-value pairs in the VOV_JOB_DESC Python dictionary. For example, here is the modification to nc_run.py that specifies an auto-kill time of 60 seconds. The Python dictionary “update” method function provides a convenient way to do that.
VOV_JOB_DESC.update( {
"autokill" : 60,
} )
vrest.submitRequest("POST", resturl, jsonData=VOV_JOB_DESC)