summaryrefslogtreecommitdiff
path: root/README.org
blob: 8c4329b24638240965e95660d647480148c7f585 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
-*- mode: org; coding: utf-8; -*-

#+TITLE: README for Guile DRMAA

Hi there!  This project provides low-level bindings to DRMAA version 1.  Here’s an example:

#+begin_src scheme
(use-modules (drmaa v1 low))

(define (test)
  (let ((t (allocate-job-template!)))
    (set-attribute! t (DRMAA 'REMOTE_COMMAND) "/bin/ls")
    (set-attribute! t (DRMAA 'JS_STATE)
                    (DRMAA 'SUBMISSION_STATE_ACTIVE))
    (set-attribute! t (DRMAA 'WD)
                    "/home/rwurmus/")
    (apply set-vector-attribute! t (DRMAA 'V_ENV)
           (list "USER=rwurmus" "USER=rwurmus" "you"))
    (run-job t)))

(init-session!)
(test)
(exit-session!)
#+end_src

Higher level bindings are also provided:

#+begin_src scheme
(use-modules (drmaa v1 high))

(define j1
  (job-template #:job-name "drmaa-test-rekado"
                #:remote-command "/bin/ls"))

(define j2
  (job-template #:job-name "drmaa-test-rekado-2"
                #:remote-command "/bin/ls"
                #:arguments '("/")))

(with-drmaa-session
 (let ((jid1 (run-job j1))
       (jid2 (run-job j2)))
   (control jid1 'release)
   (call-with-values
       (lambda () (wait '*))
     (lambda (jid status resources)
       (pk jid resources)
       (control jid2 'release)))))
#+end_src

See the Info manual for a description of all procedures.