Random Bits of Open Code

Check-in [90dced0839]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Switch to PERSIST mode and turn off exit on line
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:90dced083943f669f0ecb7295ca30421d6138d6e
User & Date: mrwellan 2019-05-20 22:10:00
Context
2019-06-04
03:30
Added work week to options.cfg* to avoid accidentally clobbering a good install check-in: 349cb2f495 user: matt tags: trunk
2019-05-20
22:10
Switch to PERSIST mode and turn off exit on line check-in: 90dced0839 user: mrwellan tags: trunk
21:27
Merged from 79c8 and tweaked a bit check-in: efd8e83582 user: mrwellan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ringchart/process.scm.

31
32
33
34
35
36
37

38
39
40
41
42
43
44
...
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
;;======================================================================

(define (create-get-db fname)
  (let* ((dbexists (file-exists? fname))
	 (db       (open-database fname)))
    (print "FName: " fname)
    (execute db "PRAGMA synchronous=0;")

    (if (not dbexists)(init-db db))
    db))

(define (make-statements db)
  `((stmt .  ,(prepare db "INSERT INTO jobs (jobid,iteration,user,submit_time,queue_name,num_cpus,mem,duration,host,start_time,finish_time,exit_status,cores_consumed) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?);"))
    ;;                                         0       1       2        3          4        5      6     7       8       9          10         11           12
    (dups-stmt . ,(prepare db "SELECT jobid,iteration,user,submit_time,queue_name,num_cpus,mem,duration,host,start_time,finish_time,exit_status,cores_consumed FROM jobs
................................................................................
     db
     (lambda ()
       (let loop ((inl (read-line))
		  (lnum 0)
		  (coll 0))
	 (if (not (eof-object? inl))
	     (let* ((nbstatusline (string-split-fields "," inl #:infix))) ;;  Jobid,User,Workstation,StartTime,FinishTime,ExitStatus,SubmitTime,ActualClassReservation,Qslot,Iteration,CoresConsumption
               ;; (if (eq? lnum 20) (quit))
	       (if (eq? (modulo lnum 1000) 0)
		   (print lnum " lines, " (let ((delta (- (current-seconds) start-time)))
				     (if (> delta 0)
					 (inexact->exact (round (/ lnum delta)))
					 0))
			  " lines/sec processed, "
			  coll " collisions"))







>







 







|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
...
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
;;======================================================================

(define (create-get-db fname)
  (let* ((dbexists (file-exists? fname))
	 (db       (open-database fname)))
    (print "FName: " fname)
    (execute db "PRAGMA synchronous=0;")
    (execute db "PRAGMA journal_mode=PERSIST;")
    (if (not dbexists)(init-db db))
    db))

(define (make-statements db)
  `((stmt .  ,(prepare db "INSERT INTO jobs (jobid,iteration,user,submit_time,queue_name,num_cpus,mem,duration,host,start_time,finish_time,exit_status,cores_consumed) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?);"))
    ;;                                         0       1       2        3          4        5      6     7       8       9          10         11           12
    (dups-stmt . ,(prepare db "SELECT jobid,iteration,user,submit_time,queue_name,num_cpus,mem,duration,host,start_time,finish_time,exit_status,cores_consumed FROM jobs
................................................................................
     db
     (lambda ()
       (let loop ((inl (read-line))
		  (lnum 0)
		  (coll 0))
	 (if (not (eof-object? inl))
	     (let* ((nbstatusline (string-split-fields "," inl #:infix))) ;;  Jobid,User,Workstation,StartTime,FinishTime,ExitStatus,SubmitTime,ActualClassReservation,Qslot,Iteration,CoresConsumption
               ;; (if (> lnum 100000) (quit))
	       (if (eq? (modulo lnum 1000) 0)
		   (print lnum " lines, " (let ((delta (- (current-seconds) start-time)))
				     (if (> delta 0)
					 (inexact->exact (round (/ lnum delta)))
					 0))
			  " lines/sec processed, "
			  coll " collisions"))