1 |
;;;; Copyright (c) Gene Cooperman, 1994-2002 |
;;;; Copyright (c) Gene Cooperman, 1994-2005 |
2 |
;;;; Rights to use this code for any purpose are freely granted, |
|
3 |
;;;; so long as this notice remains. No warranty is given for the |
;; This file is part of ParGCL. |
4 |
;;;; correctness or suitability of this code. |
;; |
5 |
|
;; ParGCL is free software; you can redistribute it and/or modify it under |
6 |
|
;; the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by |
7 |
|
;; the Free Software Foundation; either version 2, or (at your option) |
8 |
|
;; any later version. |
9 |
|
;; |
10 |
|
;; ParGCL is distributed in the hope that it will be useful, but WITHOUT |
11 |
|
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
12 |
|
;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public |
13 |
|
;; License for more details. |
14 |
|
;; |
15 |
|
;; You should have received a copy of the GNU Library General Public License |
16 |
|
;; along with ParGCL; see the file COPYING. If not, write to the Free Software |
17 |
|
;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
18 |
|
|
19 |
;;Main function: master-slave |
;;Main function: master-slave |
20 |
;; parametrized functions: generate-task-input, do-task, check-task-result, |
;; parametrized functions: generate-task-input, do-task, check-task-result, |
170 |
This is based on the TOP-C model for C/C++. |
This is based on the TOP-C model for C/C++. |
171 |
See http://www.ccs.neu.edu/home/gene/topc.html" |
See http://www.ccs.neu.edu/home/gene/topc.html" |
172 |
(declare (special *msg-buf*)) ; defined in slave-listener.lsp |
(declare (special *msg-buf*)) ; defined in slave-listener.lsp |
173 |
(let ((old-buffer-size (array-dimension (get '*msg-buf* 'string-char) 0))) |
(let ((old-buffer-size (array-dimension (get '*msg-buf* 'character) 0))) |
174 |
(if trace (format t "~%In master-slave~%")) |
(if trace (format t "~%In master-slave~%")) |
175 |
(when buffer-size (adjust-array (get '*msg-buf* 'string-char) buffer-size |
(when buffer-size (adjust-array (get '*msg-buf* 'character) buffer-size |
176 |
:static t)) |
:static t)) |
177 |
(setq *master-slave-time* |
(setq *master-slave-time* |
178 |
(list (get-internal-run-time) (get-internal-real-time) 0)) |
(list (get-internal-run-time) (get-internal-real-time) 0)) |
315 |
(when update-shared-data ; broadcast doesn't require reply |
(when update-shared-data ; broadcast doesn't require reply |
316 |
(funcall update-shared-data result)))))))) |
(funcall update-shared-data result)))))))) |
317 |
(when buffer-size |
(when buffer-size |
318 |
(adjust-array (get '*msg-buf* 'string-char) old-buffer-size :static t)) |
(adjust-array (get '*msg-buf* 'character) old-buffer-size :static t)) |
319 |
(setf (first *master-slave-time*) |
(setf (first *master-slave-time*) |
320 |
(- (get-internal-run-time) (first *master-slave-time*))) |
(- (get-internal-run-time) (first *master-slave-time*))) |
321 |
(setf (second *master-slave-time*) |
(setf (second *master-slave-time*) |