class Process

A simulated process

Inheritance:


Public Methods

[more] 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
[more]TIME getSubmit(void) const
Get the time this job was submitted
[more]TIME getRun(void) const
Get the time this job was run
[more]TIME getCPUTime(void) const
Get the amount of CPU time the process used.
[more]TIME getReqCPUTime(void) const
Get the amount of CPU time that was requested by the user
[more]MEMAMT getUsedMemory(void) const
Get the amount of memory the process used (per CPU)
[more]MEMAMT getRequestedMemory(void) const
Get the amount of memory the process requested (per CPU)
[more]double getCommRate(void) const
[more]ID getComputer(void) const
Get the first computer in the computer list.
[more]set<ID> getComputers(void)
[more]list<ID> getComputerList(void) const
[more]SIZE getComputerListSize(void)
[more]const list<Token> & getThreads(void) const
[more]Token getMasterThread(void)
[more]list<Token> ::iterator getFirstThread(void)
[more]list<Token> ::iterator getEndThread(void)
[more]Token& getThread(ID tknID)
[more]unsigned int getActiveThreads(void) const
[more]unsigned int getNumThreads(void) const
[more]unsigned int getUsedCPUs(void) const
Get the number of CPUs this process is using
[more]unsigned int getReqCPUs(void) const
Get the number of CPUs this process requested
[more]PRIORITY getPriority(void) const
Get the priority of the proces
[more]TIME getCPUTimeLeft(void) const
returns the number of CPU seconds left until the process considers itself "finished".
[more]bool hasStarted(void) const
[more]bool hasHalted(void) const
[more]double getMemAccessRate(void) const
[more]ID getInitThread(void) const
[more]TIME getStop(void) const
[more]void setSubmit(const TIME newSubmit)
set the submit time of the process
[more]void setRun(const TIME newRun)
set the scheduled run time of the process
[more]void setCPUTime(const TIME newCPUTime)
set the CPU time (the number of seconds the CPU must be used to complete the job)
[more]void setReqCPUTime(const TIME newCPUTime)
Set the CPU time requested by the user
[more]void setUsedMemory(const MEMAMT newUsedMemory)
set the used memory (RAM) of the process
[more]void setRequestedMemory(const MEMAMT newReqMem)
set the requested memory (RAM) of the process
[more]void setUsedCPUs(const unsigned int cpus)
Set the number of CPUs this process is using
[more]void setReqCPUs(const unsigned int cpus)
Set the number of CPUs this process is requesting
[more]void setComputer(const ID newComputer)
sets which computer the process will run on
[more]void setInitThread(const ID newID)
Sets the ID of the thread (token) that issues the SUBMIT and START commands
[more]void setCommRate(const double rate)
Sets the rate at which processes will communicate with each other.
[more]void addThread(const Token token)
Adds a thread of execution to the process
[more]void threadFinished()
Signals the process that one thread has finished its work.
[more]void clearThreads()
Deletes all threads of execution of the process
[more]bool synchronize()
Signals the process that a thread is requesting a global synchronization
[more]void setPriority(const PRIORITY newPriority)
sets the priority of the process
[more]void setCPUTimeLeft(const TIME newTime)
sets how much CPU time is left before completion of the job.
[more]void setMemAccessRate(const double rate)
sets how quickly processes will access RAM
[more]void resetCPUTimeLeft(void)
Resets CPU Time left to its original value
[more]void clearComputers(void)
Resets the computer set.
[more]ProcessEvent checkFuture(TIME timeFromNow)
Checks to see what this process would like to be doing seconds from now.
[more]void halt()
Signals to the process that all threads have finished (and so the process has finished)
[more]void useCPUTime(TIME amount)
Essentially, have the process get service from a CPU.
[more]string toString(void) const
[more]ID getRandomComputer() const
returns the ID of a random computer the process is running on
[more]static string eventToString(ProcessEvent event)
Translates an enumerated type ProcessEvent to a string
[more]ID nextCommunication(ID computer)
Determines the next communication the process will perform
[more]void calcPageFaults(void)
Polls each individual thread and asks how many page faults it has recorded - then dervies a total
[more]unsigned int getPageFaults(void) const
[more]void setStop(const TIME stopTime)
Set the time the process stopped
[more]TIME getResidenceTime(void) const
[more]TIME getExecutionTime(void) const
[more]TIME getWaitingTime(void) const
[more]RATIO getSlowdown(void) const


Inherited from SimObj:

Public Methods

ostring getName(void) const
oID getID(void) const
ovoid setName(const string newName)
ovoid setID(const ID newID)
ovirtual void clear(void)
ovirtual 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)
o 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)

oTIME getSubmit(void) const

oTIME getRun(void) const

oTIME getCPUTime(void) const

oTIME getReqCPUTime(void) const

oMEMAMT getUsedMemory(void) const

oMEMAMT getRequestedMemory(void) const

odouble getCommRate(void) const

oID getComputer(void) const

oset<ID> getComputers(void)
Returns:
the set of all computers this process has threads running on

olist<ID> getComputerList(void) const
Returns:
a list containing all of the computers this process has threads running on.

oSIZE getComputerListSize(void)
Returns:
the number of computers that this process is using

oconst list<Token> & getThreads(void) const
Returns:
a list of tokens that represent the threads of this process

oToken getMasterThread(void)

olist<Token> ::iterator getFirstThread(void)

olist<Token> ::iterator getEndThread(void)

oToken& getThread(ID tknID)

ounsigned 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.

ounsigned int getNumThreads(void) const
Returns:
the total number of threads this process has

ounsigned int getUsedCPUs(void) const

ounsigned int getReqCPUs(void) const

oPRIORITY getPriority(void) const

oTIME getCPUTimeLeft(void) const

obool hasStarted(void) const
Returns:
true if the process has started execution. False if it is awaiting execution

obool hasHalted(void) const

odouble 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

oID 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.

oTIME getStop(void) const
Returns:
the time at which the entire process stopped.

ovoid setSubmit(const TIME newSubmit)

ovoid setRun(const TIME newRun)

ovoid setCPUTime(const TIME newCPUTime)
Sets both CPUTime and CPUTime left

ovoid setReqCPUTime(const TIME newCPUTime)

ovoid 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.

ovoid 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.

ovoid setUsedCPUs(const unsigned int cpus)

ovoid setReqCPUs(const unsigned int cpus)

ovoid 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

ovoid setInitThread(const ID newID)
This function is used to cancel events in the future event list if necessary.

ovoid setCommRate(const double rate)

ovoid 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.

ovoid threadFinished()

ovoid clearThreads()
This function would be appropraite when the process terminates.

obool 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.

ovoid setPriority(const PRIORITY newPriority)
sets how important this process is.

ovoid setCPUTimeLeft(const TIME newTime)

ovoid setMemAccessRate(const double rate)

ovoid resetCPUTimeLeft(void)

ovoid clearComputers(void)

oProcessEvent checkFuture(TIME timeFromNow)

ovoid halt()
This should probably be called automatically by the process itself, not issued by the system or some other outside entitity.

ovoid 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.

ostring toString(void) const
Returns:
a string representation of the process

oID getRandomComputer() const

ostatic string eventToString(ProcessEvent event)

oID nextCommunication(ID computer)
The computer passed is the "home" computer - or the computer the sub-process is making a request from.

ovoid calcPageFaults(void)

ounsigned int getPageFaults(void) const

ovoid setStop(const TIME stopTime)
Process stop time is defined as the time the last thread finished execution.

oTIME getResidenceTime(void) const
Returns:
the amount of time the process was in the system

oTIME getExecutionTime(void) const
Returns:
the amount of time the process was executing (not waiting)

oTIME getWaitingTime(void) const
Returns:
the amount of time the process was waiting (for communications, disk reads, etc.)

oRATIO 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++.