[developers] start-generator-server

Francis Bond fcbond at gmail.com
Thu Dec 13 07:03:22 CET 2007


G'day,

would anyone object to me adding code that would make
start-generator-server run index-for-generator iff necessary?

I can't imagine any negative repercussions, but just in case ...

-- 
Francis Bond <http://www2.nict.go.jp/x/x161/en/member/bond/>
NICT Computational Linguistics Group

P.S. the change would be (in translate.lisp):

(defun start-generator-server (&optional (forkp t) (gcp t))
;;; New bit here
  (unless (and (hash-table-p mrs::*relation-index*)
	   (> (hash-table-count mrs::*relation-index*) 0))
      (index-for-generator))
;;; finishes here
  (when (and *generator-server* forkp)
    (stop-generator-server)
    (with-open-file (log (merge-pathnames
			  (lkb-tmp-dir)
			  (format
			   nil
			   "generate.debug.~a.~(~a~)"
			   (current-user) (first *translate-grid*)))
                     :direction :output :if-exists :supersede)))
  ;;
  ;; tune Allegro CL gc() performance to initially tenure everything (assuming
  ;; that is the grammar, mostly) and then keep everything in newspace.
  ;;
  #+:allegro
  (when gcp
    (excl:gc :tenure)
    (excl:gc)
    (excl:gc t)
    (setf (sys:gsgc-parameter :auto-step) nil))

  (if forkp
    (with-output-to-top ()
      #-:clisp
      (setf *generator-server*
        (mp:run-function "generator server" #'start-generator-server nil gcp)))
    (translate :serverp t)))



More information about the developers mailing list