- Please follow the instructions given in the lab web page or
course web page for preparing the file for submission.
Create a directory for each homework containing all the
files relevant to that homework. For the first homework you
will have a lab1 directory, for the second lab2 etc. You should submit a tar or
tar-zipped file of that directory. Only a single file should be submitted and it should be named as c4307XYZ-labn.tar.gz
where 'XYZ' is your lab ID, such as 102 or 106, and 'n' is the lab number.
- The project has to contain correct Makefile. The project should be compiled by simple running 'make'.
Makefile should include the 'clean' option which should delete .o files, core dumps, executables, etc.
Before sending the lab, you should run 'make clean' so that only the required files are sent.
- You have to add -Wall flag when compiling. The program should compile without warnings when using the -Wall flag.
- Please put header in EVERY source file.
- README.txt is required, please see the
course website for suggested contents of the documentation.
- Instead of putting everything in a single file, break up programs into smaller components which can be compiled separately.
Pay attention not to implement functions in .h files.
- Codes must be well commented and correctly indented.
- Your should not assume that the order in which parameters are given in sim.init file is fixed. They could be given in any order.
- Avoid using global variables whenever you can.
Global variables could be modified from anywhere and consequent side effects will be hard to predict.
- Be careful with malloc, always explicitly free the dynamic buffers when they are no longer used.
- Read lab assignments carefully before starting. Parameters you set must have reasonable values. The name of log file should be sim.log
- Average queue size should be computed as a weigthed average.
For example, if queue size was equal to 2 from t=0 to t=6 and equal to 3 from t=6 to t=8,
then average queue size is not (2+3)/2, but (2*(6-0)+3*(8-6))/(8-0).
- ID: CIS43070101      Grade: 5/20
- All files should be stored in /lab1 directory and then tarred.
- Makefile: please make sure that you included -Wall when compiling.
- README.txt is provided but it does not contain required documentation.
- Program compiles with two warnings. However, when it is run it gives segmentation fault.
- ID: CIS43070103      Grade: 12/20
- Submitted file does not follow the naming requirement (should be c43070103lab1.tar.gz).
- You are not taking an advantage of Makefile. The format should be:
Target specifies the file name of the target file that will be created. Dependencies is a list of files that must exist before the target can be made. Dependencies are especially useful because make will only make the target if the dependencies are newer than the target. This basically means that if you haven't made any changes to the dependencies, the target won't be recompiled. This is a huge time saver in complex programs.
'make clean' does not work. Clean do not need any dependencies, the format should be
- In Runs.txt you explained very well what are the consequences of having inappropriate job interarrival times and server service times.
However, when initialize those parameters in sim.init you set job arrival rate to be larger then cpu1 service time,
which automatically means that cpu1 will be saturated.
- ServerQueue.h: typedef and struct could be combined.
- Main.c: global variables could be local, you used malloc but didn't free.
- Simulation output is not correct. Writing in sim.log should be done at the point when you get an event from agenda.
- Statistics is not correct.
- ID: CIS43070104      Grade: 6/20
- Submitted file does not follow the naming requirement (should be c43070104lab1.tar.gz).
- The name of makefile should be either 'Makefile' or 'makefile' not 'Make'.
I don't need executables so you should get rid of them along with .o files in 'clean'.
Please compile with -Wall flag and make sure that you do not get any warnings.
- In README.txt you propose using an array as a structure for FIFO queue.
Your argument is that you did experiments and discovered that maximal queue sizes were limited.
I agree with you to some extent. If you chose parameters Amim, Amax, Smin and Smax carefully maximal sizes of FIFO queues will be limited.
However, for some adversary setup queues can get bigger and bigger as system evolves in time.
Also, you have a comment that global variables are not safe in case of multi threaded programs,
but in case of single threaded sequential program they are ok. I do not agree with this,
global variables are a bad practice to establish communication among functions.
Global variables could be modified from anywhere.
Hence, consequent side effects will be hard to predict.
- In Runs.txt an analysis of the simulation results is presented. Your conclusion is that queue 1 gets bigger in time for most of the setups.
You proposed a solution to increase P and Q and to make service time at CPU1 significantly less than service time at CPU2 and DISK,
consequently job interarrival time could be small. However, in this kind of setup you would have a bottleneck at CPU2 and DISK,
both of them will get saturated, queues 2 and 3 will get bigger in time as a consequence.
- Program compiles with more than 20 warnings. However, it gives 'floating exception' when run.
- ID: CIS43070106      Grade: 14/20
- Submitted file does not follow the naming requirement (should be c43070106lab1.tar.gz).
- FIFOs are implemented using arrays, which might be good if those arrays are used as circular buffers.
However, you keep inserting numbers in the array, eventually you will run out of memory.
- There is no need to check whether agenda is empty or not, it will always contain at least one arrival.
- Something strange happens to job 1. At time 0 it is said that job 1 will arrive in 4sec. However it is grabbed from agenda at 10sec.
Job 280: at time 5374 it is said that job 280 arrives in 4sec, it is grabbed from agenda at 5555sec.
- Statistics is mostly correct. Average queue size should be weighted average.
- ID: CIS43070107      Grade: 9/20
- Submitted file does not follow the naming requirement (should be c43070107lab1.tar.gz).
- 'makefile' doesn't work. There is no Lab1a.c file. Please use -Wall flag when compiling.
- Runs.txt is not provided.
- In README.txt you said that agenda would be implemented as a linked list and that both
insert and retrieve operations would be done in O(n) time.
However, either insert or retrieve could be done in O(1) time. Also, it looks like you run out of time while writing this document.
- Lab1.c 88: in addToAgenda you inserted a node to the end of the list, however you can insert it at the begging, it will take O(1) time instead.
- Simulation is not correct. Job at CPU0 never gets done.
- ID: CIS43070108 Grade: 6/20
- When compile use -Wall flag and make sure that it compiles without warnings.
Do not submit anything but .c, .h, Makefile and documentation files (I do not need to have executables).
- It compiles without warnings. However, it gives segmentation fault.
- In .h files you need #ifndef to avoid bad effects from duplicate include.
- ID: CIS43070109      Grade: 14/20
- 'make clean' cannot be run. Submission contains executables and .o files.
Please make sure that your submission does not contain anything but .c, .h, Makefile and documentation.
- Please make sure that all source files have the header.
- In Runs.txt some analysis of results is given.
Probabilities P and Q are identified as major causes of system slowness.
What about interarrival time and service times?
- Code is not indented correctly.
- Parameters are not loaded from sim.init file. Output is printed on the screen not into log file.
- Fifolib.c: In case of pointers use NULL instead of 0.
- Pqueue.h: You don't need a 'marker' in PQ structure, you use it as an iterator.That could be done using some temporary variable.
- Discrete.h: implementations of functions should be in discrete.c not in the main code.
- Seed for random should be the one you specified in sim.init.
- Statistics is missing.
- ID: CIS43070112      Grade: 19/20
- Submitted file does not follow the naming requirement (should be c43070112lab1.tar.gz)
- Makefile could be improved. For each Target, Dependencies represents a list of files that must exist before the Target can be made.
When having .o files as targets I would use .c and .h as dependencies rather than some other .o files.
- Please make sure that all source files have the header.
- Documentation is not provided.
- Parameters are loaded from sim.init file. However, they must be in specific order to load them correctly otherwise they will be messed up.
It would have been better if you had loaded parameters in such a way so that order does not matter.
- ID: CIS43070123      Grade: 20/20
- Makefile: please make sure that you run 'make clean' before you tar the directory, .o files should not be included.
- Readme.txt: Really good job in analysis! Runs.txt: nice try to come up with some reasonable interarrival time A.
- Statistics: average queue size should be weighted average.