OMK::Process Class Reference

How the distributed kernel for a message passing architecture sees processes. More...

#include <OMKProcess.h>

Inheritance diagram for OMK::Process:

Inheritance graph
[legend]
Collaboration diagram for OMK::Process:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Process (const std::string &np, const std::string &mac)
 Constructor.
virtual ~Process ()
 Destructor.
virtual void unpack (IncomingSynchronisationMessage &)
 unpack from a message
virtual void pack (OutgoingSynchronisationMessage &) const
 pack in a message
const NamegetProcessName () const
 name of the process
const NamegetHostMachineName () const
 name of the machine associated to this process
const FrequencygetFrequency () const
 Frequency of the controller of the process.
const FrequencygetMaxFrequencyOfHostedObjects () const
 maximum frequency of the hosted simulated objects
SvmLinkgetSvmLink () const
 link to the global controller
const DategetDateOfLastMessage () const
 Date of the last received message from that process.
const DategetPeriod () const
 get the period (in seconds) of the process
void setDateOfLastMessage (const Date &d)
 change the date of last message received for this process in this adress space
void setFrequency (const Frequency &val)
 change the frequency of this process
void setMaxHostedFrequency (const Frequency &val)
 maximum frequency of hosted referentials
void setSvmLink (SvmLink *val)
 change the link to the global controller
void incrementeIterationFlag ()
 CHADI.
int getIterationFlag ()
void resetIterationFlag ()
bool disconnectedProcess ()

Protected Attributes

Date _dateOfLastMessage
 date of last reception of a message from this process
Date _period
 time interval between two supposed receptions from this process.
Name _processName
 name of the process
Name _machineName
 machine hosting the process
Frequency _processFrequency
 frequency of the process
Frequency _maxHostedFrequency
 highest frequency of the process
SvmLink_svmLink
 pointer to the link to the global controller
int _iterationFlag
 CHADI.

Detailed Description

How the distributed kernel for a message passing architecture sees processes.

Author:
Siames
Version:
1.0

Definition at line 32 of file OMKProcess.h.


Constructor & Destructor Documentation

Process::Process ( const std::string &  np,
const std::string &  mac 
)

Constructor.

Definition at line 25 of file OMKProcess.cxx.

References OMK::Controller::lcm().

00026   : Packable(),
00027     _dateOfLastMessage ( Controller::initialSimulationDate ), //why not ?
00028     _processName(np),
00029     _machineName(mac),
00030     _processFrequency (1), //give a stable point when calculing least common
00031     _maxHostedFrequency (0), //gives a stable point in calculating max
00032     // multiplier 
00034     _iterationFlag(0)
00036 {
00037    assert ( Controller::lcm ( 13 , 1 ) == 13 ) ; //make sure lcm implementation has 1 as stable point.
00038 }

Process::~Process (  )  [virtual]

Destructor.

Definition at line 42 of file OMKProcess.cxx.

00042                    {
00043 
00044 }


Member Function Documentation

void Process::unpack ( IncomingSynchronisationMessage  )  [virtual]

unpack from a message

Implements OMK::Packable.

Definition at line 56 of file OMKProcess.cxx.

References _processName, and _svmLink.

00057 {
00058 #ifdef _DEBUGPVMMESS 
00059   std::cerr<<"Process::extract "<<std::endl;
00060 #endif
00061    in >> _processName >> *_svmLink ;
00062 
00063 #ifdef _DEBUGPVMMESS 
00064    std::cerr<<"process named "<<_processName<<std::endl;
00065 #endif
00066 }

void Process::pack ( OutgoingSynchronisationMessage  )  const [virtual]

pack in a message

Implements OMK::Packable.

Definition at line 48 of file OMKProcess.cxx.

References _processName, _svmLink, OMK::Packable::pack(), and OMK::Name::pack().

00049 {
00050    _processName.pack(out) ;
00051    _svmLink->pack(out) ;
00052 }

const Name & Process::getProcessName (  )  const

name of the process

Definition at line 71 of file OMKProcess.cxx.

References _processName.

Referenced by OMK::Svm::addNewSiteToSimulation(), OMK::Svm::relaxedSynchroniseReceiveAndProcessMessages(), OMK::Svm::synchroniseReceiveAndProcessMessages(), and OMK::Svm::testIfNewProcessAdded().

00072 {
00073    return _processName ;
00074 }

const Name & Process::getHostMachineName (  )  const

name of the machine associated to this process

Definition at line 78 of file OMKProcess.cxx.

References _machineName.

Referenced by OMK::Svm::addNewSiteToSimulation(), OMK::PvmSvm::spawnProcess(), and OMK::PvmSvm::testIfSiteRecovered().

00079 {
00080    return _machineName ;
00081 }

const Frequency & Process::getFrequency (  )  const

Frequency of the controller of the process.

Definition at line 86 of file OMKProcess.cxx.

References _processFrequency.

Referenced by OMK::PvmController::PvmController().

00087 {
00088   return _processFrequency ;
00089 }

const Frequency & Process::getMaxFrequencyOfHostedObjects (  )  const

maximum frequency of the hosted simulated objects

Definition at line 93 of file OMKProcess.cxx.

References _maxHostedFrequency.

Referenced by OMK::PvmController::PvmController().

00094 {
00095    return _maxHostedFrequency ;
00096 }

SvmLink * Process::getSvmLink (  )  const

link to the global controller

Definition at line 100 of file OMKProcess.cxx.

References _svmLink.

Referenced by OMK::Svm::addNewSiteToSimulation(), OMK::Svm::createDistributedSimulation(), OMK::Svm::relaxedSynchroniseReceiveAndProcessMessages(), OMK::Svm::synchroniseReceiveAndProcessMessages(), and OMK::PvmSvm::testIfSiteRecovered().

00101 {
00102    return _svmLink ;
00103 }

const Date & Process::getDateOfLastMessage (  )  const

Date of the last received message from that process.

Definition at line 136 of file OMKProcess.cxx.

References _dateOfLastMessage.

00137 {
00138    return _dateOfLastMessage ;
00139 }

const Date & Process::getPeriod (  )  const

get the period (in seconds) of the process

Definition at line 142 of file OMKProcess.cxx.

References _period.

00143 {
00144    return _period ;
00145 }

void Process::setDateOfLastMessage ( const Date d  ) 

change the date of last message received for this process in this adress space

Definition at line 129 of file OMKProcess.cxx.

References _dateOfLastMessage.

Referenced by OMK::Svm::relaxedSynchroniseReceiveAndProcessMessages(), and OMK::Svm::synchroniseReceiveAndProcessMessages().

00130 {
00131    _dateOfLastMessage = d ;
00132 }

void Process::setFrequency ( const Frequency val  ) 

change the frequency of this process

Definition at line 107 of file OMKProcess.cxx.

References _period, and _processFrequency.

Referenced by OMK::PvmController::PvmController().

00108 {
00109    _processFrequency = val ;
00110    _period = static_cast< double>( 1. / val ) ;
00111 }

void Process::setMaxHostedFrequency ( const Frequency val  ) 

maximum frequency of hosted referentials

Definition at line 115 of file OMKProcess.cxx.

References _maxHostedFrequency.

Referenced by OMK::PvmController::PvmController().

00116 {
00117    _maxHostedFrequency = val ;
00118 } 

void Process::setSvmLink ( SvmLink val  ) 

change the link to the global controller

Definition at line 122 of file OMKProcess.cxx.

References _svmLink.

Referenced by OMK::Svm::addNewSiteToSimulation(), OMK::Svm::connectToDistributedSimulation(), OMK::Svm::createDistributedSimulation(), and OMK::Svm::testIfNewProcessAdded().

00123 {
00124    _svmLink = val ;
00125 }

void Process::incrementeIterationFlag (  ) 

CHADI.

Definition at line 149 of file OMKProcess.cxx.

References _iterationFlag.

00150 {
00151   _iterationFlag++;
00152 }

int Process::getIterationFlag (  ) 

Definition at line 154 of file OMKProcess.cxx.

References _iterationFlag.

Referenced by disconnectedProcess().

00155 {
00156   return _iterationFlag;
00157 }

void Process::resetIterationFlag (  ) 

Definition at line 159 of file OMKProcess.cxx.

References _iterationFlag.

00160 {
00161   _iterationFlag=0;
00162 }

bool Process::disconnectedProcess (  ) 

Definition at line 164 of file OMKProcess.cxx.

References getIterationFlag().

00165 {
00166   if( getIterationFlag() >= 50000)
00167     {return true;}
00168   else  return false;
00169 }


Member Data Documentation

Date OMK::Process::_dateOfLastMessage [protected]

date of last reception of a message from this process

Definition at line 95 of file OMKProcess.h.

Referenced by getDateOfLastMessage(), and setDateOfLastMessage().

Date OMK::Process::_period [protected]

time interval between two supposed receptions from this process.

should be equal to 1/frequency

Definition at line 101 of file OMKProcess.h.

Referenced by getPeriod(), and setFrequency().

Name OMK::Process::_processName [protected]

name of the process

Definition at line 104 of file OMKProcess.h.

Referenced by getProcessName(), pack(), and unpack().

Name OMK::Process::_machineName [protected]

machine hosting the process

Definition at line 107 of file OMKProcess.h.

Referenced by getHostMachineName().

Frequency OMK::Process::_processFrequency [protected]

frequency of the process

Definition at line 110 of file OMKProcess.h.

Referenced by getFrequency(), and setFrequency().

Frequency OMK::Process::_maxHostedFrequency [protected]

highest frequency of the process

Definition at line 113 of file OMKProcess.h.

Referenced by getMaxFrequencyOfHostedObjects(), and setMaxHostedFrequency().

SvmLink* OMK::Process::_svmLink [protected]

pointer to the link to the global controller

Definition at line 116 of file OMKProcess.h.

Referenced by getSvmLink(), pack(), setSvmLink(), and unpack().

int OMK::Process::_iterationFlag [protected]

CHADI.

Definition at line 119 of file OMKProcess.h.

Referenced by getIterationFlag(), incrementeIterationFlag(), and resetIterationFlag().


logo OpenMask

Documentation generated on Mon Jun 9 11:46:03 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007