| 1 | = How to manage a job from start to end = |
| 2 | |
| 3 | [[NoteBox(note, If the directory **DRM4G_DIR** (`~/.drm4g` by default) does not exist\, `drm4g` will create one with for its local configuration)]] |
| 4 | |
| 5 | 1. Start up DRM4G : |
| 6 | {{{ |
| 7 | #!sh |
| 8 | [user@mycomputer~]$ drm4g start |
| 9 | Creating a DRM4G local configuration in '/home/user/.drm4g' |
| 10 | Creating '/home/user/.drm4g/var/acct' directory |
| 11 | Coping from '/home/user/drm4g/etc' to '/home/user/.drm4g/etc' |
| 12 | Starting DRM4G .... |
| 13 | OK |
| 14 | Starting ssh-agent ... |
| 15 | OK |
| 16 | }}} |
| 17 | 1. Show information about all available resources and their host : |
| 18 | {{{ |
| 19 | #!sh |
| 20 | [user@mycomputer~]$ drm4g resource list |
| 21 | RESOURCE STATE |
| 22 | localmachine enabled |
| 23 | |
| 24 | [user@mycomputer~]$ drm4g host list |
| 25 | HID ARCH JOBS(R/T) LRMS HOST |
| 26 | 0 x86_64 0/0 fork localmachine |
| 27 | |
| 28 | [user@mycomputer~]$ drm4g host list 0 |
| 29 | HID ARCH JOBS(R/T) LRMS HOST |
| 30 | 0 x86_64 0/0 fork localmachine |
| 31 | |
| 32 | QUEUENAME JOBS(R/T) WALLT CPUT MAXR MAXQ |
| 33 | default 0/0 0 0 1 1 |
| 34 | }}} |
| 35 | 1. Create a job template : |
| 36 | {{{ |
| 37 | #!sh |
| 38 | [user@mycomputer~]$ echo "EXECUTABLE=/bin/date" > date.job |
| 39 | }}} |
| 40 | 1. Submit the job : |
| 41 | {{{ |
| 42 | #!sh |
| 43 | [user@mycomputer~]$ drm4g job submit date.job |
| 44 | ID: 0 |
| 45 | }}} |
| 46 | 1. Check the evolution of the job : |
| 47 | {{{ |
| 48 | #!sh |
| 49 | [user@mycomputer~]$ drm4g job list 0 |
| 50 | JID DM EM START END EXEC XFER EXIT NAME HOST |
| 51 | 0 pend ---- 19:39:09 --:--:-- 0:00:00 0:00:00 -- date.job -- |
| 52 | }}} |
| 53 | If you execute successive `drm4g job list 0`, you will see the different states of this job: |
| 54 | {{{ |
| 55 | 0 pend ---- 19:39:09 --:--:-- 0:00:00 0:00:00 -- date.job -- |
| 56 | 0 prol ---- 19:39:09 --:--:-- 0:00:00 0:00:00 -- date.job -- |
| 57 | 0 wrap pend 19:39:09 --:--:-- 0:00:00 0:00:00 -- date.job localhost/fork |
| 58 | 0 wrap actv 19:39:09 --:--:-- 0:00:05 0:00:00 -- date.job localhost/fork |
| 59 | 0 epil ---- 19:39:09 --:--:-- 0:00:10 0:00:00 -- date.job localhost/fork |
| 60 | 0 done ---- 19:39:09 19:39:27 0:00:10 0:00:01 0 date.job localhost/fork |
| 61 | }}} |
| 62 | * `pend`: The job is waiting for a resource to run on. |
| 63 | * `prol` :The remote system is being prepared for execution. |
| 64 | * `wrap pend` :The job has been successfully submitted to the computing resource and it is waiting. |
| 65 | * `wrap actv`:The job is being executed by the computing resource. |
| 66 | * `epil`:The job is finalizing. |
| 67 | * `done`:The job has finished. |
| 68 | 1. Results are standard output (stdout) and standard error (stderr), both files will be in the same directory as the job template: |
| 69 | {{{ |
| 70 | #!sh |
| 71 | [user@mycomputer~]$ cat stdout.0 |
| 72 | Mon Jul 28 12:29:43 CEST 2014 |
| 73 | |
| 74 | [user@mycomputer~]$ cat stderr.0 |
| 75 | |
| 76 | }}} |