Megatest

Check-in [0ee351862a]
Login
Overview
Comment:Missing changes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.60
Files: files | file ages | folders
SHA1: 0ee351862a7743cf5207e3a053ef333a48dc9702
User & Date: matt on 2015-06-19 21:17:03
Other Links: branch diff | manifest | tags
Context
2015-06-20
13:37
Moved the sleep from server to client' check-in: 30d0a746e2 user: matt tags: v1.60
2015-06-19
21:17
Missing changes check-in: 0ee351862a user: matt tags: v1.60
2015-06-18
23:12
Added queuefeeder check-in: a095ada3d1 user: matt tags: v1.60
Changes

Added loadwatch/Makefile version [d2fa89fb63].























>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11

all : launch-many queuefeeder queuefeeder-server

launch-many : launch-many.scm
	csc launch-many.scm

queuefeeder : queuefeeder.scm
	csc queuefeeder.scm

queuefeeder-server : queuefeeder-server.scm
	csc queuefeeder-server.scm

Modified loadwatch/launch-many.scm from [72e97c4511] to [141ac70432].



1
2
3
4
5
6
7


(let loop ((count 0))
  (if (> count 500000)
      (print "DONE")
      (let ((cmd (conc "./queuefeeder xena:22022 bsub ./testopenlava.sh " count " " (random 30))))
	(print "Running: " cmd)
	(system cmd)
	(loop (+ count 1)))))
>
>







1
2
3
4
5
6
7
8
9
(use posix)

(let loop ((count 0))
  (if (> count 500000)
      (print "DONE")
      (let ((cmd (conc "./queuefeeder xena:22022 bsub ./testopenlava.sh " count " " (random 30))))
	(print "Running: " cmd)
	(system cmd)
	(loop (+ count 1)))))

Modified loadwatch/queuefeeder-server.scm from [befbabbb2c] to [a13dabce08].

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
			     (print "ping, failed: received key \"" result "\"")
			     (set! keepwaiting #f)
			     (set! success #f)))))
		   "ping"))
	 (timeout (make-thread (lambda ()
				 (let loop ((count 0))
				   (thread-sleep! 1)
				   (print "still waiting after count seconds...")
				   (if (and keepwaiting (< count 10))
				       (loop (+ count 1))))
				 (if keepwaiting
				     (begin
				       (print "timeout waiting for ping")
				       (thread-terminate! ping))))
			       "timeout")))







|







90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
			     (print "ping, failed: received key \"" result "\"")
			     (set! keepwaiting #f)
			     (set! success #f)))))
		   "ping"))
	 (timeout (make-thread (lambda ()
				 (let loop ((count 0))
				   (thread-sleep! 1)
				   (print "still waiting after " count " seconds...")
				   (if (and keepwaiting (< count 10))
				       (loop (+ count 1))))
				 (if keepwaiting
				     (begin
				       (print "timeout waiting for ping")
				       (thread-terminate! ping))))
			       "timeout")))
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
	  (nn-close req)
	  success))))

(define *current-delay-mutex* (make-mutex))

;; update the *current-delay* value every minute or QUEUE_CHK_DELAY seconds
(thread-start! (make-thread (lambda ()
			      (let ((delay-time (string->number (or (get-environment-variable "QUEUE_CHK_DELAY") "60"))))
				(let loop ()
				  (with-input-from-pipe 
				   cmd
				   (lambda ()
				     (let* ((val       (read))
					    (droop-val (if (number? val)(/ val 50) #f)))
				       ;; val is number of jobs in queue. Use a linear droop of val/50
				       (mutex-lock! *current-delay-mutex*)
				       (set! *current-delay* (/ (or droop-val 100) 50))
				       (mutex-unlock! *current-delay-mutex*)
				       (print "droop-val=" droop-val)
				       (thread-sleep! delay-time))))
				  (loop))))))

(let ((server-thread (make-thread (lambda ()(server rep)) "server")))
  (thread-start! server-thread)







|





|
|

|







120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
	  (nn-close req)
	  success))))

(define *current-delay-mutex* (make-mutex))

;; update the *current-delay* value every minute or QUEUE_CHK_DELAY seconds
(thread-start! (make-thread (lambda ()
			      (let ((delay-time (string->number (or (get-environment-variable "QUEUE_CHK_DELAY") "30"))))
				(let loop ()
				  (with-input-from-pipe 
				   cmd
				   (lambda ()
				     (let* ((val       (read))
					    (droop-val (if (number? val)(/ val 500) #f)))
				       ;; val is number of jobs in queue. Use a linear droop of val/40
				       (mutex-lock! *current-delay-mutex*)
				       (set! *current-delay* (or droop-val 30)) ;; (/ (or droop-val 100) 50))
				       (mutex-unlock! *current-delay-mutex*)
				       (print "droop-val=" droop-val)
				       (thread-sleep! delay-time))))
				  (loop))))))

(let ((server-thread (make-thread (lambda ()(server rep)) "server")))
  (thread-start! server-thread)

Modified loadwatch/queuefeeder.scm from [175b252945] to [2effd437a4].

51
52
53
54
55
56
57
58
59
60
61

62
63
64
65
66
67
;;       (if (> cnt 0)(loop (- cnt 1)))))
;;   (print (client-send-receive req "quit"))
;;   (nn-close req)
;;   (exit))
;; 

(thread-start! (lambda ()
		 (thread-sleep! 20)
		 (print "Give up on waiting for the server")
		 (nn-close req)
		 (exit)))

(thread-join! (thread-start! (lambda ()
			       (print (client-send-receive req (conc (current-user-name) "@" (get-host-name)))))))

(process-execute (car cmd) (cdr cmd))









|


|
>






51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
;;       (if (> cnt 0)(loop (- cnt 1)))))
;;   (print (client-send-receive req "quit"))
;;   (nn-close req)
;;   (exit))
;; 

(thread-start! (lambda ()
		 (thread-sleep! 60)
		 (print "Give up on waiting for the server")
		 (nn-close req)
		 ;; (exit)
		 ))
(thread-join! (thread-start! (lambda ()
			       (print (client-send-receive req (conc (current-user-name) "@" (get-host-name)))))))

(process-execute (car cmd) (cdr cmd))