Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -1545,11 +1545,11 @@ (lambda() (set! tqfilecontents (read-string)) )) (handle-exceptions exn (lambda() - (sleep 1) + (sleep 5) (common:get-normalized-cpu-load remote-host) ) (set! tqfileparts (string-split (string-trim-both tqfilecontents) ":")) ) ;;(print "TQuery host: " (car tqfileparts)) @@ -1556,26 +1556,33 @@ ;;(print "TQuery port " (cadr tqfileparts)) ;;(print "Getting normalized cpu load for : " remote-host " via " (car tqfileparts) ":" (cadr tqfileparts)) ) (begin (process-run "nbfake tquery -server -") - (sleep 2) + (sleep 5) ) ) (handle-exceptions exn - (lambda() + (begin ;;(print "Need to start tquery server here:") + (delete-file* (pathname-expand "~/.megatest/tquery")) (process-run "nbfake tquery -server -") - (sleep 2) + (sleep 5) (common:get-normalized-cpu-load remote-host) ) ;;(print "Preparing to connect to get load") - (define-values (i o) (tcp-connect (car tqfileparts) (string->number (cadr tqfileparts)))) + ;;;;(define-values (i o) (tcp-connect (car tqfileparts) (string->number (cadr tqfileparts)))) ;;(define-values (i o) (tcp-connect "plxcas102" 9000)) - (write-line (conc "adj-cpuload-full:" (if remote-host remote-host (get-host-name))) o) + ;;;;(write-line (conc "adj-cpuload-full:" (if remote-host remote-host (get-host-name))) o) ;;(write-line "adj-cpuload-full:plxcm5005" o) - (with-input-from-string (read-line i) read) + ;;;;(with-input-from-string (read-line i) read) + + (let*-values (((i o) (tcp-connect (car tqfileparts) (string->number (cadr tqfileparts))))) + (write-line (conc "adj-cpuload-full:" (if remote-host remote-host (get-host-name))) o) + (with-input-from-string (read-line i) read) + ) + ;;(if connection-successful tquery-output (begin (delete-file* (pathname-expand "~/.megatest/tquery")) (common:get-normalized-cpu-load remote-host))) ) ) (define (common:get-normalized-cpu-load-original remote-host) @@ -1814,13 +1821,11 @@ (numcpus (common:get-num-cpus hh))) (common:wait-for-normalized-load maxload msg hh))) (define (common:get-num-cpus remote-host) (handle-exceptions exn - (lambda() - 2 - ) + 2 (alist-ref 'core (common:get-normalized-cpu-load remote-host)) ) ) (define (common:get-num-cpus-orig remote-host)