.. (לתיקייה המכילה) | ||
How seek time of the arm should be calculated when the arm moves from cylinder A to cylinder B ? | |
d = |A-B| // i.e. d is how many cylinders the arm moves As written in Tutorial 4(Simulator) Seek_time(0)=0 // if d=0 Otherwise Seek_time(d)=d/v + 1 // where v = 0.5 |
Can we add our definitions to ex1.h ? | |
No. You should not change ex1.h. You can add your definitions to ex1.c |
Can you provide the expected output file ? Otherwise we are not sure about our right answers. | |
No! The policy of the course is not provide expected output for wet assignments. Moreover, one of your tasks is to test your program by yourself and you are supposed to do that! Hint: you can write your short and good tests in addition to simple print functions of main_test.c E.g. think how to test CalculateReadTime function after you implement it. Hint2: main_test.c does not test your functions ! It only has initial print functions that will help you to write your tests. Do not think that is main_test.c runs OK your program is correct ! |
How much time take our local computations like XOR between two buffers, can we assume that this time is zero ? | |
This question shows that you do not understand the main principle of the simulator. Briefly: "time" in the simulator is only float time; that is defined somewhere in simulator and it can be changed ONLY when you invoke sim_wait() function. ALL OTHER FUNCTIONS/COMPUTATIONS can not change/affect the time of the simulator, e.g. any computation that does not invoke sim_wait() of course DOES NOT affect this time. sim_read, sim_write, sim_wait also DO NOT AFFECT THIS TIME |
Can I add tasks using sim_read, sim_seek etc. to simulator and get the relevant times in implementation of CalculateReadTime and OptimalServiceTimeInPartition functions ? | |
No !!! It is forbidden to change the queues of disks in these functions. |
When we need to read the entire track do we need to wait for the 0 (Zero) | |
In this course and in particular in the wet ex. we ALWAYS read the track from its beginning to the end, i.e. the reading starts from sector 0. |
Should OptimalServiceTimeInPartition (BlockNum block, Partition p); | |
Yes . |
Does the next implementation wrong ? | |
This implementation is of course wrong ! OptimalServiceTimeInPartition should return Optimal time for reading a block, and there are two possibilities to do that in the received partition. This implementation considered only one possibility to do that . |
In term "efficiency" what do you mean ? | |
"efficiency" mean minimal time of simulator. And not running time of your local computations, which is not relevant at all in all this assignment ! |
Can we assume that in CreateRAID() function all disks are OK ? | |
Yes, of course. |
When I run the program I get the next output: | |
These questions will not be answered ! It is your task to analyze the output you get. |
Can we estimate the expected rotation delay or/and average seek time | |
No ! In this assignment all times you calculate should be calculated exactly !!! You can know all needed information using getCurrentAddress() function. --------------------------------------------------------------------------------------- In the tutorials we estimate approximately some times when there is no other way, i.e. when there is no information about location of the arm etc.; it is not the case in this assignment. |
Can we assume that queues of the disks are empty each time when our functions | |
Yes. |
Can I assume that anytime I invoke getCurrentAddress the arm of the relevant disk is | |
Yes, of course. You can assume that anytime it is invoked even all arms of all disks are located over starts of some (may be different) sectors. |
Function OptimalServiceTimeInPartition() returns only the optimal time for given partition but we | |
You can write function (let's say GetOptimalOptionToRead()) which will return for you the disks which you should read in the given partition and the expected time of this reading and if it is impossible to read the required block returns -1. Now, ... OptimalServiceTimeInPartition(...........) { ........................... return GetOptimalOptionToRead(............); } and implementations of RegularRead and EmergencyRead will be simple. |
Can we assume that the arm velocity V=0.5 also in the automatic testing ? | |
Yes. Moreover you can assume that all constant which were defined in ex1.h will also remain the same in the automatic testing. |