| 1 | = Job Description = |
| 2 | |
| 3 | This section will explain how to create a template with which to configure DRM4G's jobs. |
| 4 | |
| 5 | |
| 6 | |
| 7 | == Syntax == |
| 8 | |
| 9 | {{{ |
| 10 | <VARIABLE> = ["]<VALUE>["] |
| 11 | }}} |
| 12 | |
| 13 | |
| 14 | |
| 15 | == Template options == |
| 16 | |
| 17 | * `NAME`: Name of the job (filename of the Job Template by default). |
| 18 | * `EXECUTABLE`: The executable file. |
| 19 | * `ARGUMENTS`: Arguments to the above executable. |
| 20 | * `NP`: The number of processors to be allocated to a job. |
| 21 | * `INPUT_FILES`: A comma-separated pair of local/remote filenames. If the remote filename is missing, the local filename will be preserved in the execution host. |
| 22 | * `OUTPUT_FILES`: A comma-separated pair of remote/local filenames. If the local filename is missing, the remote filename will be preserved in the client host. |
| 23 | * `STDIN_FILE`: Standard input file. |
| 24 | * `STDOUT_FILE`: Standard output file. By default is stdout.${JOB_ID}. |
| 25 | * `STDERR_FILE`: Standard error file. By default is stderr.${JOB_ID}. |
| 26 | * `REQUIREMENTS`: A boolean expression evaluated for each available host, if the evaluation returns true the host will be considered to submit the job. |
| 27 | * `ENVIRONMENT`: User defined, comma-separated environment variables. |
| 28 | |
| 29 | |
| 30 | |
| 31 | == Requirement Expressions == |
| 32 | |
| 33 | === Syntax === |
| 34 | |
| 35 | The syntax of the requirement expressions is defined as: |
| 36 | |
| 37 | {{{ |
| 38 | stmt::= expr |
| 39 | expr::= VARIABLE '=' INTEGER |
| 40 | | VARIABLE '>' INTEGER |
| 41 | | VARIABLE '<' INTEGER |
| 42 | | VARIABLE '=' STRING |
| 43 | | expr '&' expr |
| 44 | | expr '|' expr |
| 45 | | '!' expr |
| 46 | | '(' expr ')' |
| 47 | }}} |
| 48 | |
| 49 | Each expression is evaluated to 1 (True) or 0 (False). Only those hosts for which the requirement expression is evaluated to True will be considered to execute the job. |
| 50 | |
| 51 | Logical operators are as expected ( less '<', greater '>', '&' AND, '|' OR, '!' NOT), '=' means equals with integers. When you use '=' operator with strings, it performs a shell wild-card pattern matching. |
| 52 | |
| 53 | |
| 54 | === Variables === |
| 55 | The REQUIREMENTS values are: |
| 56 | |
| 57 | * `HOSTNAME`: Execution host (e.g. mycomputer). |
| 58 | * `ARCH`:Architecture of the execution host (e.g. i686, x86_64). |
| 59 | * `LRMS_TYPE`: Type of local DRM system for execution (e.g. pbs, sge). |
| 60 | * `QUEUE_NAME`: Name of the queue (e.g. default, short). |
| 61 | * `QUEUE_MAXTIME`:Maximum wall time of jobs in the queue. |
| 62 | * `QUEUE_MAXCPUTIME`:Maximum CPU time of jobs in the queue. |
| 63 | * `QUEUE_MAXCOUNT`:Maximum count of jobs that can be submitted in one request to the queue. |
| 64 | * `QUEUE_MAXRUNNINGJOBS`:Maximum number of running jobs in the queue. |
| 65 | * `QUEUE_MAXJOBSINQUEUE`:Maximum number of queued jobs in the queue. |
| 66 | |
| 67 | |
| 68 | === Examples === |
| 69 | |
| 70 | {{{ |
| 71 | REQUIREMENTS = LRMS_TYPE = "pbs" # Only use pbs |
| 72 | REQUIREMENTS = HOSTNAME = "*.es" # Only hosts ending in ".es" |
| 73 | REQUIREMENTS = HOSTNAME = "mycomputer" # Only use mycomputer |
| 74 | REQUIREMENTS = ARCH = "x86_64" # Only host x86_64 architecture |
| 75 | REQUIREMENTS = ARCH = "x86_64" & HOSTNAME = "*.es" # Only hosts ending in ".es" and have x86_64 architecture |
| 76 | }}} |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | == Environment Expressions == |
| 82 | |
| 83 | === Syntax === |
| 84 | The syntax of the environment expressions is specified in a comma-separated, source/destination pair: |
| 85 | {{{ |
| 86 | stmt::= VARIABLE = VALUE, VARIABLE = VALUE, ... |
| 87 | }}} |
| 88 | |
| 89 | |
| 90 | === Variables === |
| 91 | The variables defined in the ENVIRONMENT are: |
| 92 | |
| 93 | * `PPN`: Specify the number of processors per node requested for the job. |
| 94 | * `CPUTIME`:Maximum amount of CPU time used by all processes in the job ('''HH:MM:SS'''). |
| 95 | * `WALLTIME`:Maximum amount of real time during which the job can be in the running state ('''HH:MM:SS'''). |
| 96 | * `MEMORY`:Maximum amount of physical memory used by the job ('''MB'''). |
| 97 | |
| 98 | |
| 99 | === Examples === |
| 100 | |
| 101 | {{{ |
| 102 | ENVIRONMENT = WALLTIME = 00:01:00 # 60 seconds of max walltime |
| 103 | ENVIRONMENT = WALLTIME = 00:01:00, MEMORY = 2000 # 60 seconds of max walltime and 2 GB of RAM memory |
| 104 | }}} |