In my simulation experiments for Job Scheduling policies, I need to define/assume the job's deadline. However the job's computational running time and the number of CPUs are already defined. I need a perfect solution to generate the job deadlines.
If I understand your question, your simulated scheduler is doing allocation based on total CPU time requested? That is quite different than most schedulers that I'm familiar with - in which you specify the amount of wall clock time. These schedulers then terminate running jobs when that amount (+ % overage) is exceeded.
To measure CPU time, you'll need fine grained access to understand the usage. Assuming multiple processes per CPU, measuring becomes quite difficult without instrumenting the actual code running. If unable to instrument, then you should look at the 'top' command and see how it queries the system for the time values it displays.
Sampling every second might not be enough for the granularity you need.
Yes, The simulated scheduler palces the job on CPU based on total CPU time requested, which is defined apriori.
Definatly these schedulers then terminate running jobs when the defined time exceeded, becuase of the running time was estimated according to particuler CPU/machine capacity.
But in my case, I want to generate the job's deadlines for futher assumtion to place it on different CPU/machine capacity. Where the estimated time would be base line and deadline time would be hard line. Moreover, job might not be terminated when estimated running time exeeced.