CS3530 Assignment 2


Kennesaw State University
Department of Computer Science
Operating Systems CS3530/01
Assignment # 2 / Single vs Multiprogramming

Dalibor Labudovic

06/12/2013
















Initial Problem Statement:
Study the behavior of a batch system with multi-programming. 
File: batchmio.cpp

  1. Open a script log file with the 'script' command.
  1. Copy the model implemented in file 'batchmio.cpp' from /home/jgarrido/psim3
  1. Compile, link, and execute the program to run the simulation model.
  1. The model reads all input parameters; it has default values built-in.Run the simulation models with the default values by pressing the Enter key on each input parameter. The default value of the degree of multi-programming is 15. The output of the simulation run is stored in files: "batchmio.dat" and "resources.dat" (short output).
  1. Rename these files appropriately so they will not be over-written by the next simulation run.
  1. Run the simulation model again with the degree of multi-programming set to 1.  Compare the performance of the two simulation run. 
  1. Close the script.
  1. Write your report following the guidelines given. In the last part of your report include your answers to the following questions:
  1. What are the main differences between the this model and the previous model of OS (assignment #1 batch.cpp)?
  2. Explain how multiprogramming is made possible for these models. How is this implemented? 
  3. With no multiprogramming, why is the input queue needed? Why is the ready queue needed. 
  4. What aspect of an operating system is the model representing? 
  5. What performance measures does the model compute? 
  6. After changing some of the parameters in the model (the workload) and executing again the model: 
   What changes in the results do you notice? 

Summary and purpose of the assignment activity:
The purpose of this assignment is to compare multiprogramming to single programming, along with the utilization of the performance index to evaluate the results and compare results and discover the differences. The summary of this assignment activity is to better familiarize our selves with Linux commands and understanding how the modern operating system functions and studying the historical evolution of computational progression.

Detail description of the solution and used in the project:
The solution in this project is that multiprogramming has given the processor the software power to manage jobs and therefore improve performance. The performance improvement can be measure with the results, the number of jobs completed, the number of jobs rejected, the amount of time a job had to wait, and CPU utilization efficiency. With the simulation results we can conclude that multiprogramming has improved the overall performance of the processor and has given a more effective structure to the processor and how to successfully complete jobs, reduce wait time, and effectively use queues.
Table of results:
batchmio.dat –1
Batch Multiprogramming System
System Parameters
Simulation period: 1750
Close arrivals time: 800
Total memory: 255, queue sizes: 100
Degree of mult.: 15
Workload Parameters
Mean arrival: 7.3, mean CPU per: 11.5, mean I/O per: 11
Upper memory demand: 60 lower mem demand: 10
Results
tal number of jobs that arrived: 114
Total number of rejected jobs: 0
Total number of completed jobs: 114
Average number of jobs in input queue: 26.2944
Maximum number of jobs in memory: 15
The proportion of rejected jobs is: 0
Average sojourn time: 490.981
Average total wait time: 468.999
CPU utilization: 0.826877
DISK utilization: 0.606452


batchmio.dat ---2
Batch Multiprogramming System
System Parameters
Simulation period: 1750
Close arrivals time: 800
Total memory: 255, queue sizes: 100
Degree of mult.: 1
Workload Parameters
Mean arrival: 7.3, mean CPU per: 11.5, mean I/O per: 11
Upper memory demand: 60 lower mem demand: 10
Results
Service factor: 0.02236
Total number of jobs that arrived: 149
Total number of rejected jobs: 12
Total number of completed jobs: 67
Average number of jobs in input queue: 69.773
Maximum number of jobs in memory: 1
The proportion of rejected jobs is: 0.0805369
Average sojourn time: 631.206
Average total wait time: 605.588
CPU utilization: 0.54737
DISK utilization: 0.443785

Comments and Conclusion:
In the concluding thoughts of this assignment is that multiprogramming has enables fast and more efficient utilization of the hardware. Along with multiprogramming there have been obstacles and solutions, obstacles to better manager interruptions and effectively organize queues. With this assignment I have a better understanding about the degree of multiprogramming, and without multiprogramming, our software technology would not be as advanced as it is today.
Questions:
    1. What are the main differences between the this model and the previous model of OS (assignment #1 batch.cpp)?
  The main difference is the ability to change the parameter of multiprogramming    degree in which the simulation will be running.
    2. Explain how multiprogramming is made possible for these models. How is this implemented? 
  Multiprogramming is possible for these models because restrict the number of jobs a   processor can work on at a time. A single processor without multiprogramming can 
  perform a CPU burst for a time of the entire job,which has significant disadvantages.
  Some disadvantages of non-multiprogramming is longer wait time, less CPU     efficiency and more jobs rejected.
    3.With no multiprogramming, why is the input queue needed? Why is the ready queue needed. 
  
  With no multiprogramming a input queue is needed because an input queue is a    collection of processes in a storage that are waiting to be brought into memory to    run a program. The need for an input queue is that ready queue is backed up with    other processes which are waiting to be processed. The ready  queue is needed    because its a queue in which processes are ready to be executed, their memory and   I/o resources have been allocated.
    4. What aspect of an operating system is the model representing? 
  The operating system this model represents is the scheduler and dispatcher.
    5. What performance measures does the model compute? 
 
  This model computes the following performance measurements: memory and CPU    utilization, number of jobs processes and rejected, the number of jobs in a queue,    and the amount of time jobs had to wait to be processed.
    6. After changing some of the parameters in the model (the workload) and executing  again the model: 
   What changes in the results do you notice?The 
  The changes of the results I have noticed are that multiprogramming does a better    job of processing the variety of jobs in its queue. The system of scheduling and    dispatching is necessary to accomplish efficiency with better CPU and memory    utilization. The multiprogramming  has given a better solution to jobs wait time and    less jobs rejected. Also the multiprogramming has done a great job to allocated    other resources in a manageable time with CPU time bursts.

Script:
Script started on Mon 10 Jun 2013 03:12:32 PM EDT
#]0;dlabudov@cs3:~/dlabudov#[dlabudov@cs3 dlabudov]$ ./psim3x##[Kc batchmio.p##[Kcpp
#[H#[2J#[H#[2J-------------------------------------------------------------------------------
------ Psim3 C++ (POSIX threads) package for object oriented simulation -------
------------------ (C) J. M. Garrido, 2004-2012 -----------
-------------------------------------------------------------------------------
a.out created.
#]0;dlabudov@cs3:~/dlabudov#[dlabudov@cs3 dlabudov]$ ls##[K##[Kls##[K##[K./a.out
Psim3 project: Batch Multiprogramming System
Simulation date: Mon Jun 10 15:13:46 2013


Simulation period: (1750)
Arrival close time: (800)
System Parameters
Total system memory: (255)
Size of input queue: (100)
Degree of multiprogramming: (15)
Workload Parameters
Mean interarrival: (7.3)
Mean CPU service: (11.5)
Mean I/O service: (11)
Lower memory demand: (10)
Upper memory demand: (60)
Run Simulation
-------------------------------------------------------------
Memory % usage: 0.881231 avg num items used: 227.596
% of time spent in res usage: 0.987338
% of time spent waiting: 0.937163
-------------------------------------------------------------

------------------------------------------
Service factor: 0.0258319
Total number of jobs that arrived: 114
Total number of rejected jobs: 0
Total number of completed jobs: 114
Average number of jobs in input queue: 26.2944
Maximum number of jobs in memory: 15
The proportion of rejected jobs is: 0
Average sojourn time: 490.981
Average total wait time: 468.999
CPU utilization: 0.826877
DISK utilization: 0.606452
--------------------------------------------------
End of simulation Batch Multiprogramming System Mon Jun 10 15:13:46 2013



#[m#]0;dlabudov@cs3:~/dlabudov#[dlabudov@cs3 dlabudov]$ nano batchmio.dat
?1h#=#[39;49m#[39;49m#(B#[m#[H#[2J#(B#[0;7m GNU nano 1.3.12 File: batchmio.dat #[3;1H#(B#[mBatch Multiprogramming System
#[4dSystem Parameters
#[5dSimulation period: 1750
#[6dClose arrivals time: 800
#[7dTotal memory: 255, queue sizes: 100
#[8dDegree of mult.: 15
#[9dWorkload Parameters
#[10dMean arrival: 7.3, mean CPU per: 11.5, mean I/O per: 11
#[11dUpper memory demand: 60 lower mem demand: 10
#[13dStarting Simulation Run
#[14dCPU created
#[15dDisk created
#[16dJob1 requiring CPU serv 0.103007 disk serv 8.01836 memory 38 arrives at 14.2904
#[17dJob1 joining input queue at 14.2904
#[18dJob1 acquired 38 memory at 14.2904 wait 0
#[19dJob1 start CPU service at: 14.2904 for period = 0.00727215
#[20dCPU completed CPU service to Job1 at 14.2977
#[21dJob1 start DISK service at: 14.2977 for period: 3.97343#[22;31H#(B#[0;7m[ Read 2979 lines ]
#[23d^G#(B#[m Get Help #(B#[0;7m^O#(B#[m WriteOut #(B#[0;7m^R#(B#[m Read File #(B#[0;7m^Y#(B#[m Prev Page #(B#[0;7m^K#(B#[m Cut Text #(B#[0;7m^C#(B#[m Cur Pos
#[24d#(B#[0;7m^X#(B#[m Exit#[14G#(B#[0;7m^J#(B#[m Justify #(B#[0;7m^W#(B#[m Where Is #(B#[0;7m^V#(B#[m Next Page #(B#[0;7m^U#(B#[m UnCut Text#(B#[0;7m^T#(B#[m To Spell
#[3dB#[1;71H#(B#[0;7mModified
#[3d#(B#[m#[1PBatch Multiprogramming System
B#[2;21r#[2;1H#M#[1;24r#[3;1HB
#[4d#[1P#[4;21r#[21;1H
#[1;24r#[3;2Hatch Multiprogramming System
#[21dJob1 start DISK service at: 14.2977 for period: 3.97343
#[3dB
#[22d#(B#[0;7mSave modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? #[23;1H Y#(B#[m Yes#[K
#[24d#(B#[0;7m N#(B#[m No #[14G #(B#[0;7m^C#(B#[m Cancel#[K#[22;62H
#(B#[0;7mFile Name to Write: batchmio.dat
#[23d^G#(B#[m Get Help#[23;21H#(B#[0;7m^T#(B#[m To Files#[23;41H#(B#[0;7mM-M#(B#[m Mac Format#[61G#(B#[0;7mM-P#(B#[m Prepend
#[24d#(B#[0;7m^C#(B#[m Cancel #(B#[0;7mM-D#(B#[m DOS Format #(B#[0;7mM-A#(B#[m Append#[24;61H#(B#[0;7mM-B#(B#[m Backup File#[22;33H#####(B#[0;7m1.dat#[30G#(B#[m
#(B#[0;7mSave file under DIFFERENT NAME ?
#[23d Y#(B#[m Yes#[K
#[24d#(B#[0;7m N#(B#[m No #(B#[0;7m^C#(B#[m Cancel#[K#[22;34H
#[23d#[39;49m#(B#[m#[J#[1;30H#(B#[0;7mFile: batchmio1#[1;71H #[22;30H#(B#[m#[1K #(B#[0;7m[ Wrote 2979 lines ]#(B#[m#[K#[24;80H#[24;1H#[?1049l
#[?1l#>#]0;dlabudov@cs3:~/dlabudov#[dlabudov@cs3 dlabudov]$ nano resources.dat
#[?1049h#[1;24r#(B#[m#[4l#[?7h#[?12l#[?25h#[?1h#=#[?1h#=#[?1h#=#[39;49m#[39;49m#(B#[m#[H#[2J#(B#[0;7m GNU nano 1.3.12 File: resources.dat #[3;1H#(B#[mPsim3 project: Batch Multiprogramming System
#[4dSimulation date: Mon Jun 10 15:13:46 2013
#[6d-------------------------------------------------------------
#[7dMemory % usage: 0.881231 avg num items used: 227.596
#[8d% of time spent in res usage: 0.987338
#[9d% of time spent waiting: 0.937163
#[10d-------------------------------------------------------------
#[11d--------------------------------------------------
#[12d End of simulation Batch Multiprogramming System Mon Jun 10 15:13:46 2013#[22;32H#(B#[0;7m[ Read 12 lines ]

#[?1l#>#]0;dlabudov@cs3:~/dlabudov#[dlabudov@cs3 dlabudov]$ a./out
Psim3 project: Batch Multiprogramming System
Simulation date: Mon Jun 10 15:14:51 2013


Simulation period: (1750)
Arrival close time: (800)
System Parameters
Total system memory: (255)
Size of input queue: (100)
Degree of multiprogramming: (15) 1
Workload Parameters
Mean interarrival: (7.3)
Mean CPU service: (11.5)
Mean I/O service: (11)
Lower memory demand: (10)
Upper memory demand: (60)
Run Simulation
-------------------------------------------------------------
Memory % usage: 0.131743 avg num items used: 34.2523
% of time spent in res usage: 0.980793

-------------------------------------------------------------

------------------------------------------
Service factor: 0.02236
Total number of jobs that arrived: 149
Total number of rejected jobs: 12
Total number of completed jobs: 67
Average number of jobs in input queue: 69.773
Maximum number of jobs in memory: 1
The proportion of rejected jobs is: 0.0805369
Average sojourn time: 631.206
Average total wait time: 605.588
CPU utilization: 0.54737
DISK utilization: 0.443785
--------------------------------------------------
End of simulation Batch Multiprogramming System Mon Jun 10 15:14:51 2013
#[m#]0;dlabudov@cs3:~/dlabudov#[dlabudov@cs3 dlabudov]$ nano batchmio.dat
#=#[39;49m#[39;49m#(B#[m#[H#[2J#(B#[0;7m GNU nano 1.3.12 File: batchmio.dat #[3;1H#(B#[mBatch Multiprogramming System
#[4dSystem Parameters
#[5dSimulation period: 1750
#[6dClose arrivals time: 800
#[7dTotal memory: 255, queue sizes: 100
#[8dDegree of mult.: 1
#[9dWorkload Parameters
#[10dMean arrival: 7.3, mean CPU per: 11.5, mean I/O per: 11
#[11dUpper memory demand: 60 lower mem demand: 10
#[13dStarting Simulation Run
#[14dCPU created
#[15dDisk created
#[16dJob1 requiring CPU serv 2.32352 disk serv 0.391988 memory 27 arrives at 18.2583
#[17dJob1 joining input queue at 18.2583
#[18dJob1 acquired 27 memory at 18.2583 wait 0
#[19dJob1 start CPU service at: 18.2583 for period = 0.0952547
#[20dCPU completed CPU service to Job1 at 18.3536
#[21dJob1 start DISK service at: 18.3536 for period: 0.160138#[22;31H#(B#[0;7m[ Read 1947 lines ]
#[23d^G#(B#[m Get Help #(B#[0;7m^O#(B#[m WriteOut #(B#[0;7m^R#(B#[m Read File #(B#[0;7m^Y#(B#[m Prev Page #(B#[0;7m^K#(B#[m Cut Text #(B#[0;7m^C#(B#[m Cur Pos
#[24d#(B#[0;7m^X#(B#[m Exit#[14G#(B#[0;7m^J#(B#[m Justify #(B#[0;7m^W#(B#[m Where Is #(B#[0;7m^V#(B#[m Next Page #(B#[0;7m^U#(B#[m UnCut Text#(B#[0;7m^T#(B#[m To Spell
#[3dB#[1;71H#(B#[0;7mModified
#[3d#(B#[m#[1PBatch Multiprogramming System
#[3;1H#(B#[mPsim3 project: Batch Multiprogramming System
#[4dSimulation date: Mon Jun 10 15:14:51 2013
#[6d-------------------------------------------------------------
#[7dMemory % usage: 0.131743 avg num items used: 34.2523
#[8d% of time spent in res usage: 0.980793
#[10d-------------------------------------------------------------
#[11d--------------------------------------------------
#[12d End of simulation Batch Multiprogramming System Mon Jun 10 15:14:51 2013#[22;32H#(B#[0;7m[ Read 12 lines ]
#[23d^G#(B#[m Get Help #(B#[0;7m^O#(B#[m WriteOut #(B#[0;7m^R#(B#[m Read File
#[3d#(B#[m#[1PPsim3 project: Batch Multiprogramming System
#[?1l#>#]0;dlabudov@cs3:~/dlabudov#[dlabudov@cs3 dlabudov]$ exit
exit

Script done on Mon 10 Jun 2013 03:15:43 PM EDT

Popular posts from this blog

CS3401 Practice Quiz 2 Part 2

CS3401 Practice Quiz 2 Part 1