A simulated process
Inheritance:
Public Methods
-
Process( ID newId = 0, string newName="", TIME newSubmit = 0, TIME newRun = 0, TIME newCPUtime = 0, TIME newReqCPUTime = 0, MEMAMT newUsedMemory = 0, MEMAMT newRequestedMemory = 0, unsigned int newUsedCPUs = 1, unsigned int newReqCPUs = 1)
- Constructor
-
TIME getSubmit(void) const
- Get the time this job was submitted
-
TIME getRun(void) const
- Get the time this job was run
-
TIME getCPUTime(void) const
- Get the amount of CPU time the process used.
-
TIME getReqCPUTime(void) const
- Get the amount of CPU time that was requested by the user
-
MEMAMT getUsedMemory(void) const
- Get the amount of memory the process used (per CPU)
-
MEMAMT getRequestedMemory(void) const
- Get the amount of memory the process requested (per CPU)
-
double getCommRate(void) const
-
-
ID getComputer(void) const
- Get the first computer in the computer list.
-
set<ID> getComputers(void)
-
-
list<ID> getComputerList(void) const
-
-
SIZE getComputerListSize(void)
-
-
const list<Token> & getThreads(void) const
-
-
Token getMasterThread(void)
-
-
list<Token> ::iterator getFirstThread(void)
-
-
list<Token> ::iterator getEndThread(void)
-
-
Token& getThread(ID tknID)
-
-
unsigned int getActiveThreads(void) const
-
-
unsigned int getNumThreads(void) const
-
-
unsigned int getUsedCPUs(void) const
- Get the number of CPUs this process is using
-
unsigned int getReqCPUs(void) const
- Get the number of CPUs this process requested
-
PRIORITY getPriority(void) const
- Get the priority of the proces
-
TIME getCPUTimeLeft(void) const
- returns the number of CPU seconds left until the process considers itself "finished".
-
bool hasStarted(void) const
-
-
bool hasHalted(void) const
-
-
double getMemAccessRate(void) const
-
-
ID getInitThread(void) const
-
-
TIME getStop(void) const
-
-
void setSubmit(const TIME newSubmit)
- set the submit time of the process
-
void setRun(const TIME newRun)
- set the scheduled run time of the process
-
void setCPUTime(const TIME newCPUTime)
- set the CPU time (the number of seconds the CPU must be used to complete the job)
-
void setReqCPUTime(const TIME newCPUTime)
- Set the CPU time requested by the user
-
void setUsedMemory(const MEMAMT newUsedMemory)
- set the used memory (RAM) of the process
-
void setRequestedMemory(const MEMAMT newReqMem)
- set the requested memory (RAM) of the process
-
void setUsedCPUs(const unsigned int cpus)
- Set the number of CPUs this process is using
-
void setReqCPUs(const unsigned int cpus)
- Set the number of CPUs this process is requesting
-
void setComputer(const ID newComputer)
- sets which computer the process will run on
-
void setInitThread(const ID newID)
- Sets the ID of the thread (token) that issues the SUBMIT and START commands
-
void setCommRate(const double rate)
- Sets the rate at which processes will communicate with each other.
-
void addThread(const Token token)
- Adds a thread of execution to the process
-
void threadFinished()
- Signals the process that one thread has finished its work.
-
void clearThreads()
- Deletes all threads of execution of the process
-
bool synchronize()
- Signals the process that a thread is requesting a global synchronization
-
void setPriority(const PRIORITY newPriority)
- sets the priority of the process
-
void setCPUTimeLeft(const TIME newTime)
- sets how much CPU time is left before completion of the job.
-
void setMemAccessRate(const double rate)
- sets how quickly processes will access RAM
-
void resetCPUTimeLeft(void)
- Resets CPU Time left to its original value
-
void clearComputers(void)
- Resets the computer set.
-
ProcessEvent checkFuture(TIME timeFromNow)
- Checks to see what this process would like to be doing seconds from now.
-
void halt()
- Signals to the process that all threads have finished (and so the process has finished)
-
void useCPUTime(TIME amount)
- Essentially, have the process get service from a CPU.
-
string toString(void) const
-
-
ID getRandomComputer() const
- returns the ID of a random computer the process is running on
-
static string eventToString(ProcessEvent event)
- Translates an enumerated type ProcessEvent to a string
-
ID nextCommunication(ID computer)
- Determines the next communication the process will perform
-
void calcPageFaults(void)
- Polls each individual thread and asks how many page faults it has recorded - then dervies a total
-
unsigned int getPageFaults(void) const
-
-
void setStop(const TIME stopTime)
- Set the time the process stopped
-
TIME getResidenceTime(void) const
-
-
TIME getExecutionTime(void) const
-
-
TIME getWaitingTime(void) const
-
-
RATIO getSlowdown(void) const
-
Inherited from SimObj:
Public Methods
-
string getName(void) const
-
ID getID(void) const
-
void setName(const string newName)
-
void setID(const ID newID)
-
virtual void clear(void)
-
virtual bool activate(void)
Documentation
In this simulation, a process is essentially an event generator.
A process is activated at a certain time (according to some trace file)
and has a specific sequence of things it wants to do (events)
Process( ID newId = 0, string newName="", TIME newSubmit = 0, TIME newRun = 0, TIME newCPUtime = 0, TIME newReqCPUTime = 0, MEMAMT newUsedMemory = 0, MEMAMT newRequestedMemory = 0, unsigned int newUsedCPUs = 1, unsigned int newReqCPUs = 1)
-
TIME getSubmit(void) const
-
TIME getRun(void) const
-
TIME getCPUTime(void) const
-
TIME getReqCPUTime(void) const
-
MEMAMT getUsedMemory(void) const
-
MEMAMT getRequestedMemory(void) const
-
double getCommRate(void) const
-
ID getComputer(void) const
-
set<ID> getComputers(void)
-
- Returns:
- the set of all computers this process has threads running on
list<ID> getComputerList(void) const
-
- Returns:
- a list containing all of the computers this process has threads
running on.
SIZE getComputerListSize(void)
-
- Returns:
- the number of computers that this process is using
const list<Token> & getThreads(void) const
-
- Returns:
- a list of tokens that represent the threads of this process
Token getMasterThread(void)
-
list<Token> ::iterator getFirstThread(void)
-
list<Token> ::iterator getEndThread(void)
-
Token& getThread(ID tknID)
-
unsigned int getActiveThreads(void) const
-
Threads can issue a STOP at any time and they become inactive.
The process does not stop until all threads STOP, however.
- Returns:
- the number of threads that are still actively doing work.
unsigned int getNumThreads(void) const
-
- Returns:
- the total number of threads this process has
unsigned int getUsedCPUs(void) const
-
unsigned int getReqCPUs(void) const
-
PRIORITY getPriority(void) const
-
TIME getCPUTimeLeft(void) const
-
bool hasStarted(void) const
-
- Returns:
- true if the process has started execution. False if it is awaiting
execution
bool hasHalted(void) const
-
double getMemAccessRate(void) const
-
Each process will use this rate as a guideline as to how quickly
access its own memory.
- Returns:
- the generic memory access rate for the system
ID getInitThread(void) const
-
This function is used to cancel events in the future event list if
necessary.
- Returns:
- the ID of the token that issues the START and SUBMIT events.
TIME getStop(void) const
-
- Returns:
- the time at which the entire process stopped.
void setSubmit(const TIME newSubmit)
-
void setRun(const TIME newRun)
-
void setCPUTime(const TIME newCPUTime)
-
Sets both CPUTime and CPUTime left
void setReqCPUTime(const TIME newCPUTime)
-
void setUsedMemory(const MEMAMT newUsedMemory)
-
used memory is the amount of memory actually used by a process
during its execution. This is different from requested memory.
void setRequestedMemory(const MEMAMT newReqMem)
-
requested memory is the amount of memory requested at job submittal
time. It does not reflect how much memory was actually used.
void setUsedCPUs(const unsigned int cpus)
-
void setReqCPUs(const unsigned int cpus)
-
void setComputer(const ID newComputer)
-
a process can only sit on one computer. Note that dervived classes
(e.g. a parallel process) may implement this function differently
void setInitThread(const ID newID)
-
This function is used to cancel events in the future event list if
necessary.
void setCommRate(const double rate)
-
void addThread(const Token token)
-
A single-CPU process should only have one thread of execution. Child
classes of the single-CPU process may have more, however.
void threadFinished()
-
void clearThreads()
-
This function would be appropraite when the process terminates.
bool synchronize()
-
Synchronize will not do anything until all threads give a synchronize
function call. Threads that issue the synchronize function call simply wait.
When all threads have issued this command, the process will tell the threads
how to communicate with
each other to synchronize - after which each thread can resume normal operations.
void setPriority(const PRIORITY newPriority)
-
sets how important this process is.
void setCPUTimeLeft(const TIME newTime)
-
void setMemAccessRate(const double rate)
-
void resetCPUTimeLeft(void)
-
void clearComputers(void)
-
ProcessEvent checkFuture(TIME timeFromNow)
-
void halt()
-
This should probably be called automatically by the process itself, not
issued by the system or some other outside entitity.
void useCPUTime(TIME amount)
-
This method will adjust how much the time is worth in terms of work
accomplished based on the clock speed of the processor.
string toString(void) const
-
- Returns:
- a string representation of the process
ID getRandomComputer() const
-
static string eventToString(ProcessEvent event)
-
ID nextCommunication(ID computer)
-
The computer passed is the "home" computer - or the computer the
sub-process is making a request from.
void calcPageFaults(void)
-
unsigned int getPageFaults(void) const
-
void setStop(const TIME stopTime)
-
Process stop time is defined as the time the last thread finished
execution.
TIME getResidenceTime(void) const
-
- Returns:
- the amount of time the process was in the system
TIME getExecutionTime(void) const
-
- Returns:
- the amount of time the process was executing (not waiting)
TIME getWaitingTime(void) const
-
- Returns:
- the amount of time the process was waiting (for communications,
disk reads, etc.)
RATIO getSlowdown(void) const
-
- Returns:
- the slowdown of the process
- This class has no child classes.
- Author:
- John Oleszkiewicz
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.