atropos.gvt
Class Gvt

java.lang.Object
  |
  +--java.util.Date
        |
        +--atropos.lp.AvnmpTime
              |
              +--atropos.lp.AvnmpDebug
                    |
                    +--atropos.gvt.Gvt
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, ConfigInterface, java.io.Serializable
Direct Known Subclasses:
AvnmpLP

public abstract class Gvt
extends AvnmpDebug

This class implements the GVT update algorithm.


 input -> storeIn() ...
 ouput -> storeOut() ...

 if isUpdateTime()
      startGvt() -> broadcast GvtUpdateRequest
      
 GvtUpdateRequest -> reportIn() -> [to all input processes
 to this process] GvtReportInput

 GvtReportInput -> reportLocalMinimum() -> [to GVT initiator] 
 GvtUpdateResponse

 while !isDone()
      GvtUpdateResponse -> collectMinima()


 
This research is funded by DARPA/ITO Contract Number: F30602-98-C-0230 supported by the Air Force Research Laboratory/IF.

Version:
$Revision: 1.1.1.1 $ $State: Exp $
Author:
Steve Bush
See Also:
Serialized Form

Field Summary
static int COLLECTMIN
          The Gvt process is finishing the Gvt calculation.
static byte GvtReportInput
          Indicate a GVT report message type.
static byte GvtUpdateRequest
          Indicate a GVT update message type.
static byte GvtUpdateResponse
          Indicate a GVT response message type.
static int IDLE
          The Gvt process is not currently in operation.
protected  long lm
          The local minimum.
static int REPORTLOCAL
          The Gvt process is reporting it's local minimum.
static int START
          The Gvt process is starting to broadcast Gvt update requests.
 
Fields inherited from class atropos.lp.AvnmpDebug
dlevel, DRIVER_D, GVT_D, html, LP_D, LPSTATE_D, MEASURE_D, NodeName, PACKET_D, PAYLOAD_D, PP_D, PREDM_D, RECQ_D, ROLLBACK_D, SNDQ_D, STATEQ_D, SYSTEM_D, TIME_D, TOLERANCE_D
 
Fields inherited from interface atropos.lp.ConfigInterface
Dvm, initTolerance, logdir, lvm, ootLimit, pdir, rmlog, rmplots, rmsnmp, runMinutes, snmpdir, VirtualMessageRatio
 
Constructor Summary
Gvt()
          Create a Gvt update process object.
 
Method Summary
 void addProcs(AvnmpLP lp, java.util.Vector proc_queue, long gvtupdate)
          Prepare the GVT object for a calculation.
protected  long calcLocalMinimum()
          Caculate the local minimum.
 long collectMinima(AvnmpPacket ap)
          Collect all the local minima from all processes and compute a global minimum.
abstract  long getlvt()
          This method is expected to be over-ridden by the logical process.
 int getNumProcs()
          Return the number of processes expected to report back with their local minimum.
 long getNumUpdates()
          Returns the number of GVT update requests since the object was created.
 int getProcReport()
          Return the current value of the number of processes which have reported their current local minimum.
 java.lang.String getState()
          Return the state of the Gvt process.
 long getTimeSinceLastUpdate()
          Returns relative time since the Gvt was last updated.
 long getUpdateInterval()
          Returns the GVT update interval.
 boolean isDone()
          Is the GVT computation complete ?
 boolean isUpdateTime()
          Return true if time for a new GVT update.
abstract  java.lang.String myname()
          This method is expected to be over-ridden by the logical process.
 AvnmpQueue reportIn(AvnmpPacket p)
          Send GVT minima information to all processes which sent input messages to this process.
 AvnmpQueue reportLocalMinimum()
          Report the local minimum back to the Gvt Initiator.
 void resetGvt()
          Prepare the GVT for a new calculation.
 AvnmpQueue startGvt()
          Initiate the GVT calculation process.
 void storeIn(AvnmpPacket ap)
          Record GVT status information upon the receipt of ANY input message.
 void storeOut(AvnmpPacket ap)
          Store GVT status information for every message sent from this process.
 java.lang.String toString()
          Display this GVT status object as a string.
 
Methods inherited from class atropos.lp.AvnmpDebug
debugType, getRealTime, log, log, log, log, measure, resetLog, setLevel, writeLog
 
Methods inherited from class atropos.lp.AvnmpTime
add, adjustRelative, diff, now, resetRelative, set, startTime, time
 
Methods inherited from class java.util.Date
after, before, clone, compareTo, compareTo, equals, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setTime, setYear, toGMTString, toLocaleString, UTC
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

GvtUpdateRequest

public static final byte GvtUpdateRequest
Indicate a GVT update message type.

GvtUpdateResponse

public static final byte GvtUpdateResponse
Indicate a GVT response message type.

GvtReportInput

public static final byte GvtReportInput
Indicate a GVT report message type.

IDLE

public static final int IDLE
The Gvt process is not currently in operation.

START

public static final int START
The Gvt process is starting to broadcast Gvt update requests.

REPORTLOCAL

public static final int REPORTLOCAL
The Gvt process is reporting it's local minimum.

COLLECTMIN

public static final int COLLECTMIN
The Gvt process is finishing the Gvt calculation.

lm

protected long lm
The local minimum.
Constructor Detail

Gvt

public Gvt()
Create a Gvt update process object.
Method Detail

addProcs

public void addProcs(AvnmpLP lp,
                     java.util.Vector proc_queue,
                     long gvtupdate)
Prepare the GVT object for a calculation.
Parameters:
lp - This logical process.
proc_queue - The names of all the other logical processes.
gvtupdate - The GVT update interval.

resetGvt

public void resetGvt()
Prepare the GVT for a new calculation.

startGvt

public AvnmpQueue startGvt()
Initiate the GVT calculation process.
Returns:
Queue containing all messages to be broadcast.

storeIn

public void storeIn(AvnmpPacket ap)
Record GVT status information upon the receipt of ANY input message.
Parameters:
ap - Incomming message.

reportIn

public AvnmpQueue reportIn(AvnmpPacket p)
Send GVT minima information to all processes which sent input messages to this process.
Parameters:
p - The incomming packet from a GVT Initiator.
Returns:
GvtReportMessages to all processes which sent messages to this process.

storeOut

public void storeOut(AvnmpPacket ap)
Store GVT status information for every message sent from this process.
Parameters:
ap - The message sent.

calcLocalMinimum

protected long calcLocalMinimum()
Caculate the local minimum.
Returns:
The local minimum.

reportLocalMinimum

public AvnmpQueue reportLocalMinimum()
Report the local minimum back to the Gvt Initiator.
Returns:
Queue with message containing Local Minimum to return to the Gvt Initiator.

collectMinima

public long collectMinima(AvnmpPacket ap)
Collect all the local minima from all processes and compute a global minimum.
Parameters:
ap - A GvtUpdateResponse message.
Returns:
The final GVT value.

isDone

public boolean isDone()
Is the GVT computation complete ?
Returns:
True if the computation is complete, false if the computation is still running.

getProcReport

public int getProcReport()
Return the current value of the number of processes which have reported their current local minimum. This value will be zero when the Gvt process is idle, i.e. between updates.
Returns:
The number of processes which reported back.

getNumProcs

public int getNumProcs()
Return the number of processes expected to report back with their local minimum. The Gvt process will not complete until this number of processes has reported.
Returns:
The number of processes expected to report their local minimum.

toString

public java.lang.String toString()
Display this GVT status object as a string.
Overrides:
toString in class AvnmpTime
Returns:
The GVT status object as a string.

getState

public java.lang.String getState()
Return the state of the Gvt process.
Returns:
The current state of the process.
See Also:
IDLE, START, REPORTLOCAL, COLLECTMIN

getNumUpdates

public long getNumUpdates()
Returns the number of GVT update requests since the object was created.
Returns:
The number of GVT update requests since the object was created.

getUpdateInterval

public long getUpdateInterval()
Returns the GVT update interval.
Returns:
The GVT update interval.

getTimeSinceLastUpdate

public long getTimeSinceLastUpdate()
Returns relative time since the Gvt was last updated.
Returns:
The relative time since the Gvt was last updated.

isUpdateTime

public boolean isUpdateTime()
Return true if time for a new GVT update.
Returns:
True if time for a new GVT update.

getlvt

public abstract long getlvt()
This method is expected to be over-ridden by the logical process.
Overrides:
getlvt in class AvnmpDebug
Returns:
The process's local virtual time.

myname

public abstract java.lang.String myname()
This method is expected to be over-ridden by the logical process.
Overrides:
myname in class AvnmpDebug
Returns:
The name of this logical process.


Copyright © 2002 GE Corporate Research and Development. All Rights Reserved.