Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-02 - 43,50242/basys.bli
There are no other files named basys.bli in the archive.
00100	BEGIN
00200	MACRO
00300	  PASSIVATE=CANCEL(.CURRENT)$,
00400	  IOREQ=0.50$,
00500	  FCORE=0$,
00600	  LINTIME=0$,
00700	  LDSPQTIME=1$,
00800	  LDSKQTIME=2$,
00900	  LRUNTIME=3$,
01000	  CHNL=5$,
01100	  XFYWRITE=1^3$,
01200	  AL=1$,
01300	  MRTIME=0.10$,
01400	  MCORESIZE=25.0$,
01500	  SCORESIZE=4.0$,
01600	  CRLF=(WRITE(CHNL,#15); WRITE(CHNL,#12))$,
01700	  NEWPAGE=WRITE(CHNL,#14)$,
01800	  SAMPLE=1000$;
01900
02000	MACRO  !	TO FIX TO NEW I/O.
02100	  REALOUT(CH,L,DEN,DOR) = FLOUT(CH,(FLOAT DEN) FDVR (FLOAT DOR),L,3)$;
02200	
02300
02400	EXTERNAL
02500	  RESET,
02600	  OUTMSG,
02700	  SETCHN,
02800	  DECOUT,
02900	  WRITE,
03000	  CLOSE;
03100
03200
03300	FORWARD
03400	  CPU,
03500	  JOB,
03600	  CENTRALMEM,
03700	  DSKIO;
03800
03900
04000	GLOBAL
04100	  BASBUG,
04200	  DEV[2],
04300	  FILE[2],
04400	  EXT,
04500	  DSPT[306],
04600	  DSKT[306],
04700	  TOTT[306],
04800	  SYSQT[306],
04900	  DSPQLENGTH,
05000	  DSKQLENGTH,
05100	  SYSQLENGTH,
05200	  DDSPQ,
05300	  DDSKQ,
05400	  DSYSQ,
05500	  PERCORE,
05600	  DCORPS,
05700	  JOBS,
05800	  DJOBS,
05900	  JOBCOUNT,
06000	  COUNT,
06100	  PIECECORPS,
06200	  TOTJOBS,
06300	  SKEDULER,
06400	  IO,
06500	  COMPUTER,
06600	  JSEED1,
06700	  JSEED2,
06800	  JSEED3,
06900	  CPUSEED1,
07000	  DSPQ,
07100	  DSKQ,
07200	  SYSQ;
07300
07400
     
00100	ROUTINE JOB(RUNTIME,CORE) =
00200	  BEGIN
00300	      LOCAL INTIME,DSPQTIME,DSKQTIME,TIMELEFT;
00400	      MACRO MARVLTIME=0.10$;
00500	      ACTIVATE(NEW(JOB(NEGEXP(MRTIME,JSEED1<0,0>),
00600	                       FIX FASTNORMAL(MCORESIZE,SCORESIZE,JSEED2<0,0>)),
00700	                   60),
00800	               LASTAT,
00900	               .TIME FADR NEGEXP(MARVLTIME,JSEED3<0,0>));
01000	        IF .BASBUG THEN BEGIN
01100		COUNT_.COUNT+1;
01200		OUTMSG(0,PLIT 'JOB ');
01300		DECOUT(0,4,.COUNT);
01400		OUTMSG(0,PLIT ' ');
01500		OUTMSG(0,PLIT 'RUN TIME = ');
01600		REALOUT(0,6,FIX (.RUNTIME FMPR 1000.0),1000);
01700		WRITE(0," ");
01800		OUTMSG(0,PLIT 'CORESIZE = ');
01900		DECOUT(0,4,.CORE);
02000		WRITE(0,#15);WRITE(0,#12);
02100	         END;
02200	      TIMELEFT_.RUNTIME;
02300	      DSPQTIME_DSKQTIME_0;
02400	      ACTIVATE(.SKEDULER,AFTER,.CURRENT);
02500	      ACCUM(SYSQLENGTH<0,0>,DSYSQ<0,0>,FLOAT CARDINAL(.SYSQ));
02600	      INTIME_.TIME;
02700	      WAIT(.SYSQ);
02800	  END;
02900	
     
00100	ROUTINE CENTRALMEM =
00200	  BEGIN
00300	      LOCAL OBJECT JOBB,JOBCORPS,X;
00400	      WHILE 1 DO
00500	        BEGIN
00600	            JOBB_.SYSQ; JOBB_.SUC(JOBB);
00700	            INCR I FROM 1 TO CARDINAL(.SYSQ) DO
00800	              BEGIN
00900	                  JOBCORPS_REMOTEFML(.JOBB,FCORE)<0,36>;
01000	                  IF .PIECECORPS GTR @.JOBCORPS
01100	                    THEN BEGIN
01200	                             ACCUM(JOBCOUNT<0,0>,DJOBS<0,0>,FLOAT .JOBS);
01300	                             ACCUM(PERCORE<0,0>,DCORPS<0,0>,FLOAT (((300-.PIECECORPS)*100)/300));
01400	                             ACCUM(SYSQLENGTH<0,0>,DSYSQ<0,0>,FLOAT CARDINAL(.SYSQ));
01500	                             HISTO(SYSQT, (.TIME FSBR .REMOTELCL(.JOBB,LINTIME)<0,36>));
01600	                             [email protected];
01700	                             REMOTELCL(.JOBB,LDSPQTIME)<0,36>_ FNEG .TIME;
01800	                             JOBS_.JOBS+1;
01900	                             TOTJOBS_.TOTJOBS+1;
02000				     X_.JOBB; JOBB_.SUC(JOBB);
02100	                             INCLUDE(REMOVE(.X),.DSPQ);
02200	                             ACTIVATE(.COMPUTER,AFTER,.CURRENT);
02300	                         END;
02400	              END;
02500	            PASSIVATE;
02600	        END;
02700	  END;
02800
02900	
     
00100	ROUTINE DSKIO=
00200	    BEGIN
00300		LOCAL JOBB,LDSK;
00400		MACRO
00500		    LDSP=LDSK$;
00600		WHILE 1 DO
00700		    BEGIN
00800			JOBB_FIRST(.DSKQ);
00900			ACCUM(DSKQLENGTH<0,0>,DDSKQ<0,0>,FLOAT CARDINAL(.DSKQ));
01000			LDSK_REMOTELCL(.JOBB,LDSKQTIME)<0,36>;
01100			[email protected] FADR .TIME;
01200			HOLD(IOREQ);
01300			ACCUM(DSPQLENGTH<0,0>,DDSPQ<0,0>,FLOAT CARDINAL(.DSPQ));
01400			LDSP_REMOTELCL(.JOBB,LDSPQTIME)<0,36>;
01500			[email protected] FSBR .TIME;
01600			INCLUDE(REMOVE(.JOBB),.DSPQ);
01700			ACTIVATE(.COMPUTER,AFTER,.CURRENT);
01800			IF EMPTY(.DSKQ) THEN PASSIVATE;
01900		    END;
02000	    END;
02100	
     
00100	ROUTINE CPU=
00200	    BEGIN
00300		LOCAL JOBB,LRTIME,XTIME,DONE,X;
00400		MACRO 
00500		    MCPUTIME=1.0$,
00600		    LDSK=LRTIME$,
00700		    LDSP=LRTIME$;
00800		WHILE 1 DO
00900		    BEGIN
01000			JOBB_FIRST(.DSPQ);
01100			ACCUM(DSPQLENGTH<0,0>,DDSPQ<0,0>,FLOAT CARDINAL(.DSPQ));
01200			LDSP_REMOTELCL(.JOBB,LDSPQTIME)<0,36>;
01300			[email protected] FADR .TIME;
01400			LRTIME_REMOTELCL(.JOBB,LRUNTIME)<0,36>;
01500			XTIME_NEGEXP(MCPUTIME,CPUSEED1<0,0>);
01600			X_IF DONE_(.XTIME GEQ @.LRTIME)
01700			    THEN @.LRTIME
01800			    ELSE .XTIME;
01900			HOLD(.X);
02000			IF .DONE
02100			    THEN BEGIN
02200				ACCUM(PERCORE<0,0>,DCORPS<0,0>,FLOAT (((300-.PIECECORPS)*100)/300));
02300				ACCUM(JOBCOUNT<0,0>,DJOBS<0,0>,FLOAT .JOBS);
02400				PIECECORPS_.PIECECORPS+.REMOTEFML(.JOBB,FCORE)<0,36>;
02500				JOBS_.JOBS-1;
02600				HISTO(DSPT,.REMOTELCL(.JOBB,LDSPQTIME)<0,36>);
02700				HISTO(DSKT,.REMOTELCL(.JOBB,LDSKQTIME)<0,36>);
02800				HISTO(TOTT,(.TIME
02900				    FSBR .REMOTELCL(.JOBB,LINTIME)<0,36>));
03000				KILL(.JOBB);
03100	    	IF .BASBUG THEN BEGIN
03200				OUTMSG(0,PLIT 'KJOB');
03300				WRITE(0,#15);WRITE(0,#12);
03400				END;
03500				IF .TOTJOBS GTR SAMPLE 
03600				    THEN (ACTIVATE(.MAINPROG,AFTER,.CURRENT);PASSIVATE)
03700				    ELSE ACTIVATE(.SKEDULER,BEFORE,.CURRENT);
03800			    END
03900			   ELSE BEGIN
04000				[email protected] FSBR .XTIME;
04100				ACCUM(DSKQLENGTH<0,0>,DDSKQ<0,0>,FLOAT CARDINAL(.DSKQ));
04200				LDSK_REMOTELCL(.JOBB,LDSKQTIME)<0,36>;
04300				[email protected] FSBR .TIME;
04400				INCLUDE(REMOVE(.JOBB),.DSKQ);
04500				ACTIVATE(.IO,AFTER,.CURRENT);
04600			    END;
04700			IF EMPTY(.DSPQ) THEN PASSIVATE;
04800		    END;
04900	    END;
05000	
     
00100	GLOBAL ROUTINE INITIO =
00200	BEGIN
00300	  BASBUG_0;
00400	  DEV_'DSK  ';
00500	  FILE_'BASYS';
00600	  EXT_'OUT';
00700	  FILE[1]_DEV[1]_' ';
00800	  RESET();
00900	  SETCHN(CHNL,AL,DEV,FILE,EXT,0,0,XFYWRITE,0,0);
01000	END;
01100	
     
00100	DSPQLENGTH_DDSPQ_PERCORE_JOBCOUNT_COUNT_0;
00200	SYSQLENGTH_JOBS_DSYSQ_TOTJOBS_0;
00300	DJOBS_DCORPS_DDSKQ_DSKQLENGTH_0;
00400	INCR J FROM 0 TO 302 DO
00500	    DSPT[.J]_DSKT[.J]_TOTT[.J]_SYSQT[.J]_0;
00600	PIECECORPS_300;
00700	INITHISTO(DSPT<0,0>,300,5.0,0.0);
00800	INITHISTO(DSKT<0,0>,300,1.0,0.0);
00900	INITHISTO(TOTT<0,0>,300,10.0,0.0);
01000	INITHISTO(SYSQT<0,0>,300,2.0,0.0);
01100	SKEDULER_NEW(CENTRALMEM(),50);
01200	COMPUTER_NEW(CPU(),50);
01300	IO_NEW(DSKIO(),50);
01400	DSPQ_MAKELIST();
01500	DSKQ_MAKELIST();
01600	SYSQ_MAKELIST();
01700	JSEED1_13579;
01800	JSEED2_4721;
01900	JSEED3_34673;
02000	CPUSEED1_60431;
02100	ACTIVATE(NEW(JOB(NEGEXP(MRTIME,JSEED1<0,0>),
02200	                 FIX FASTNORMAL(MCORESIZE,SCORESIZE,JSEED2<0,0>)),
02300	            65),AFTER,.CURRENT);
02400	PASSIVATE;
02500	ACCUM(DSPQLENGTH,DDSPQ<0,0>,FLOAT CARDINAL(.DSPQ));
02600	ACCUM(DSKQLENGTH,DDSKQ<0,0>,FLOAT CARDINAL(.DSKQ));
02700	ACCUM(PERCORE,DCORPS<0,0>,FLOAT (((300-.PIECECORPS)*100)/300));
02800	ACCUM(JOBCOUNT,DJOBS<0,0>,FLOAT .JOBS);
02900	ACCUM(SYSQLENGTH,DSYSQ<0,0>,FLOAT CARDINAL(.SYSQ));
03000	OUTMSG(CHNL,PLIT 'SIMULATION OF BASYS SYSTEM USING 300K CORE AND .');
03100	CRLF;
03200	REALOUT(CHNL,4,FIX(IOREQ FMPR 1000.0),1000);
03300	OUTMSG(CHNL,PLIT ' SEC TO PROCESS I/O REQUEST.');
03400	CRLF;
03500	CRLF;
03600	OUTMSG(CHNL,PLIT 'JOBS THROUGH SYSTEM = ');
03700	DECOUT(CHNL,5,SAMPLE);
03800	WRITE(CHNL,#11);
03900	OUTMSG(CHNL,PLIT 'AVERAGE DISK-QUEUE LENGTH = ');
04000	REALOUT(CHNL,6,FIX((.DSKQLENGTH FDVR .TIME) FMPR 1000.0), 1000);
04100	CRLF;
04200	CRLF;
04300	OUTMSG(CHNL,PLIT 'AVERAGE DISPATCH QUEUE LENGTH  = ');
04400	REALOUT(CHNL,6,FIX((.DSPQLENGTH FDVR .TIME) FMPR 1000.0),1000);
04500	CRLF; CRLF;
04600	OUTMSG(CHNL,PLIT 'AVERAGE AMOUNT OF CORE USED =  ');
04700	REALOUT(CHNL,6,FIX((.PERCORE FDVR .TIME) FMPR 1000.0),1000);
04800	CRLF; CRLF;
04900	OUTMSG(CHNL,PLIT 'AVERAGE NUMBER OF JOBS WHO OWN SOME MEMORY =  ');
05000	REALOUT(CHNL,6,FIX((.JOBCOUNT FDVR .TIME) FMPR 1000.0),1000);
05100	CRLF; CRLF;
05200	OUTMSG(CHNL,PLIT 'AVERAGE MEMORY QUEUE LENGTH =  ');
05300	REALOUT(CHNL,6,FIX((.SYSQLENGTH FDVR .TIME) FMPR 1000.0), 1000);
05400	NEWPAGE;
05500	OUTMSG(CHNL,PLIT 'DISPATCH QUEUE WAITING TIME');
05600	CRLF;CRLF;
05700	HPRINT(CHNL,DSPT<0,0>);
05800	NEWPAGE;
05900	OUTMSG(CHNL,PLIT 'DISK QUEUE WAITING TIME');
06000	CRLF;CRLF;
06100	HPRINT(CHNL,DSKT<0,0>);
06200	NEWPAGE;
06300	OUTMSG(CHNL,PLIT 'MEMORY QUEUE WAITING TIME ');
06400	CRLF;CRLF;
06500	HPRINT(CHNL,SYSQT<0,0>);
06600	NEWPAGE;
06700	OUTMSG(CHNL,PLIT 'TOTAL TIME IN SYSTEM ');
06800	CRLF;CRLF;
06900	HPRINT(CHNL,TOTT<0,0>);
07000	CRLF;
07100	CLOSE(CHNL);
07200	END;
07300	END ELUDOM