Professional Documents
Culture Documents
Proc SCHDL
Proc SCHDL
process in a run executed by pushing Draw Gantt Chart and selecting the run we wish to view or graphs demonstrating one statistic that pertains to all the runs by cycling through the statistics by pushing Graph Type then viewing that graph by pushing Draw. 5. The last feature of importance to us is the simulator's logging capability. Push Open Log to activate logging. Now, push Log All Table Data as this will log the same data that can be viewed when pushing Show All Table Data. 6. Next, draw a Gantt Chart for FCFS and in the new window push the button labeled Log in the lower right corner. Once finished, push Hide in the lower left corner of the window and this will return you to the simulator. Lastly, cycle thorough the graph types till you reach Turnaround, then push Draw. This will show the Turnaround Times for each run. Similar to logging the Gantt Chart, push Log and then Hide. 7. Finally, back at the simulator window push Show Local Log and verify that what you logged shows up in the log exactly in the order in which it was added. Now, close the simulator by pushing Quit in the lower right corner of the simulator window. 8. Notice a 'logfile.html' shows up in the working directory of the simulator. Open it to verify that this file is the same as the local log file that you viewed earlier. There will also be gif images in the same directory as the log file. These images contain the graph data that you logged. If the log file is ever moved you have to make sure to move these images as well so that the graph data shows in the new log location. ii. Activity 1. Modify the 'myexp.exp' file to have 5 run lines that will use the following algorithms: FCFS, SJF, RR 1, RR 5, and RR 10. On each run line, make sure that both the algorithm and key are correctly identify each other. 2. Now modify the 'myrun.run' file so that there will be a total of 20 processes with the following properties: All processes arrive at time 0.0 All processes have a constant duration of 100 All have constant I/O bursts of 10 All have basepriority 1.0 The first set of 10 processes have CPU bursts uniformly distributed between 2 and 8 The last set of 10 processes have CPU bursts uniformly distributed between 30 and 40 Do not change the seed line of the run file as this will change the sample space. Example of 'myexp.exp': name myexp comment This experiment contains 5 runs run myrun algorithm FCFS key "FCFS" run myrun algorithm SJF key "SJF" run myrun algorithm RR 1 key "RR 1" run myrun algorithm RR 5 key "RR 5" run myrun algorithm RR 10 key "RR 10"
Example of 'myrun.run': name myrun comment This contains two types of processes
algorithm SJF seed 5000 numprocs 10 firstarrival 0.0 interarrival constant 0.0 duration constant 100.0 cpuburst uniform 2.0 8.0 ioburst constant 10.0 basepriority 1.0
numprocs 10 firstarrival 0.0 interarrival constant 0.0 duration constant 100.0 cpuburst uniform 30.0 40.0 ioburst constant 10.0 basepriority 1.0
3. Run the simulator and open a log file and add the tabular data and the 5 Gantt charts, one for each run. 4. Now let us analyze the results. SJF will have the best average waiting time. This is easily identifiable by graphing the Waiting. Why is this behavior evident with our chosen example? 5. Next, compare the trend in the Round Robin experiments as the quantum increases. For large values of the quantum which algorithm will Round Robin mimic and how large does the quantum need to be for our example?
th
6. Let us try to prove our conjecture by adding a 6 run to 'myexp.exp'. So to do this we must first Close Log and Quit our current session with the simulator. Now open the 'myexp.exp' and add an additional line defining a RR algorithm with your chosen quantum. Again, make sure the key correctly identifies the algorithm.
th
7. Run the simulator again and this time log the tabular data again but this time only log the 6 Gantt chart which should simulate the RR algorithm with a large quantum. So now, let us have the simulator Show Local Log which should correspond with our previous conjecture. 8. Finally, Close Log and Quit the simulator. Recall that the generated log can be viewed as an HTML file in the working directory of the simulator, and if the log file is moved so must the gif images be moved as well to the same destination directory. IV. Assignments 1. (Activity 4) 2. (Activity 5)