Output
Next: Starter code
Up: No Title
Previous: Scheduling algorithm
Your program's output should consist of the statistics calculated
during the simulation, as shown at the end of
the example run attached to this handout.
In addition, if the program is running in trace mode extra
information must be printed out at each time step, as shown in the example
run.
For both the final statistics and the trace output,
your program must print at least all of the information in the
example run, but the format
is up to you. Make sure it is easy to read and interpret.
Read through the example run
carefully to be sure you understand what's
going on at each time step.
Below are some things to notice about the output:
-
The output refers to ``tasks'' arriving, being put into
the priority queue, etc.
This is a general term used in simulations to refer to
some entity that needs to be serviced. In our case, a task
is a process that needs to be assigned to a CPU so that it can run.
-
Task 3 arrives after task 2 does, yet it gets a CPU first because
of its higher priority.
-
Tasks 4 and 6 both arrive at time step 4,
but task 4 gets a CPU first because it arrived first.
-
Task 1 needs 10 units of CPU time, which is more than the maximum
time slice permitted (set to 5 in this run of the program).
So at time step 4, after spending 5 time units
in a CPU, Task 1 is put back into the priority queue.
-
At each time step, the program reports
which process each CPU is currently running.
The number zero is used to denote that a CPU is not presently in use.
-
The duration of task generation was chosen to be 50 for this run of
the program,
yet the total number of times steps simulated is 224.
The simulated system is so heavily loaded that
at time step 50, all CPUs are busy and
the queue contains 37 processes waiting for CPU time.
The remaining time steps are needed to clear the system.
-
The amount of ``work done'' in any time step is the number of
CPUs that were busy for that time step.
At the end of the simulation, the total amount of work done
over all time steps is reported.
This is analogous to person-hours.
-
``Throughput'', the average amount of work done per unit time,
is also reported.
-
A process will have to wait more than once for a CPU if it
needs more time than the maximum time slice permitted.
This is why the program reports on the average total time waited.
-
The average total time waited is reported overall and by priority.
This allows us to see how much longer the lower priority processes
had to wait than the higher ones.
Next: Starter code
Up: No Title
Previous: Scheduling algorithm
Diane Horton
Mon Dec 11 15:56:16 EST 1995