3 (in-package :cl-cluster
)
6 (let ((node1 (make-instance 'node
:host
"rhel4" :connect t
))
7 (node2 (make-instance 'node
:host
"rhel5" :connect t
))
8 (node3 (make-instance 'node
:host
"rhel5" :lisp
"/usr/bin/clisp -q" :connect t
)))
9 ; (declare (special node1 node2 node3))
11 (dolist (node (list node1 node2 node3
))
12 (when (node-alive-p node
)
15 (format t
"Remote \"~A\" runs ~A ~A~%"
17 (node-exec node
"(lisp-implementation-type)")
18 (node-exec node
"(lisp-implementation-version)"))
19 (node-exec node
"(killallhumans)"))
21 (format t
"got error: ~A~%" condition
)))))
24 ((a (with-remote node1
30 (setq n1
(make-instance 'node
:host
"rhel4" :connect t
))
31 (setq n2
(make-instance 'node
:host
"rhel5" :connect t
))
32 ;; connect to host's different lisp
33 (setq n3
(make-instance 'node
:host
"rhel5" :lisp
"/usr/bin/clisp -q" :connect t
))
35 (setq n4
(make-instance 'node
:host
"rhel4" :lisp
"/usr/bin/clisp -q" :connect t
))
37 ;; node-exec expects only strings
40 ;; catch remote exception locally
41 (node-exec n1
"(lisp-implementation-type1)")
44 (lisp-implementation-type)
45 (lisp-implementation-version))
47 ;; calculate some stuff on remote lisps and aggregate answers on another remote
72 (lisp-implementation-type)
73 (lisp-implementation-version))
78 (asdf:oos
'asdf
:load-op
:asdf-install
))
81 (node-exec n
"(save-lisp-and-die \"core\")")
84 (setq n1
(make-instance 'node
:host
"rhel5" :connect t
))
97 (in-package :cl-cluster
)
99 (setq my-remote
(make-instance 'node-ssh
:host
"rhel5" :connect t
))
100 (setq my-remote
(make-instance 'node-zmq
:endpoint
"tcp://127.0.0.1:5555" :connect t
))
101 (setq my-remote
(make-instance 'node-zmq
:endpoint
"pgm://lo;226.0.0.1:5555" :connect t
))
103 (node-exec my-remote
"1")
105 (with-remote my-remote
106 (defvar remote-list
'(1 2 3 4 5 6 7 8)))
108 (with-remote my-remote
"123")
110 (node-alive-p my-remote
)
112 (node-disconnect my-remote
)
114 (node-sexp my-remote
)
116 (with-remote my-remote
119 (with-remote my-remote
120 (loop for i in remote-list
121 when
(oddp i
) collect i
))
123 (with-remote my-remote
124 (unintern 'remote-list
))
126 (with-remote my-remote
129 (with-remote my-remote
130 (defclass abc
() ; #<...> <- fails to read
131 ((foo :initform
1))))
133 (with-remote my-remote
134 (setq bar
(make-instance 'abc
)))
136 (with-remote my-remote
137 (slot-value bar
'foo
))
139 Error
: The variable REMOTE-LIST is unbound.
140 In form
: (PROGN REMOTE-LIST
)
141 At node
: #N
<HOST
:"rhel5" LISP
:"/usr/bin/sbcl --noinform --core core">
143 [Condition of type SIMPLE-ERROR
]