1 |
;;; To load and run this example: |
;;; To load and run this example: |
2 |
;;; (par-load "par-mapcar.lsp") |
;;; (par-load "par-mapcar.lsp") |
3 |
;;; (par-mapcar 'sqrt '(1 2 3 4 5 6 7 8 9 10)) |
;;; (par-mapcar #'sqrt '(1 2 3 4 5 6 7 8 9 10)) |
4 |
|
|
5 |
;;;This example generalizes mapcar to the obvious parallel version. |
;;;This example generalizes mapcar to the obvious parallel version. |
6 |
;;; It computes on each element of the list using the next processor, |
;;; It computes on each element of the list using the next processor, |
21 |
:check-task-result #'(lambda (task-in task-out) |
:check-task-result #'(lambda (task-in task-out) |
22 |
(setf (aref result task-in) task-out) |
(setf (aref result task-in) task-out) |
23 |
'NO-ACTION) |
'NO-ACTION) |
24 |
:trace t) |
:trace nil) |
25 |
(if (master-p) (coerce result 'list) nil) |
(if (master-p) (coerce result 'list) nil) |
26 |
) |
) |