Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

PVMInterface Class Reference

Handles communication between Talker and PVM. More...

#include <pvminterface.h>

Collaboration diagram for PVMInterface:

Collaboration graph
[legend]
List of all members.

Public Methods

 PVMInterface (const char *name, bool ismaster, int ntasks, int stardid, int stopid) throw (runtime_error)
 Starts the PVM interface and syncs all the tasks. More...

 ~PVMInterface ()
 Closes down the PVM connection and notifies pvmd. More...

void BroadcastCommand (const char *commandline) throw (runtime_error)
 Sends a string command to every member of the STANDBY group. More...

void SendCommand (int taskno, const char *commandline) throw (runtime_error)
void GetCommandWithTimeout (char *commandline) throw (runtime_error)
 Waits for and reads a command line sent by the master If no command has arrived after a delay, returns with "". More...

bool MessagePending ()
int LastMessageOriginator ()
 returns the task number of the last received message or -1 if not found. More...

bool AllStandby () throw (runtime_error)
void LeaveStandbyGroup ()
void JoinStandbyGroup ()
int FindTask (uint32 id)
 Returns tasklist index of first task which contains the id number. Returns -1 if not found. More...

const char * Name (int k)
int NumberOfTasks ()
int NumberOfOtherTasks ()
uint32 StartID (int k)
uint32 StopID (int k)
bool IsMaster ()
bool IsSlave ()
void GetLeafCounts (unsigned int *countsarray, uint32 *size) throw (runtime_error)
 Fills the countsarray with a list of occupied LeafNodes from another task. More...

void SendLeafCounts (int tid, unsigned int *countsarray, uint32 size) throw (runtime_error)

Private Attributes

PVMTaskInfo myinfo
bool is_master
int num_tasks
PVMTaskInfotasklist
int last_message_tid
int last_message_size
int last_message_msgtag

Detailed Description

Handles communication between Talker and PVM.

Definition at line 47 of file pvminterface.h.


Constructor & Destructor Documentation

PVMInterface::PVMInterface const char *    name,
bool    ismaster,
int    ntasks,
int    startid,
int    stopid
throw (runtime_error)
 

Starts the PVM interface and syncs all the tasks.

Every task collects some information about itself which must be sent to all others. The PVMInterface constructor's job is to synchronize all tasks, broadcast this task's details and read all other tasks' details into the tasklist array.

Definition at line 33 of file pvminterface.cc.

References PVMINTERFACE_NAMELEN, and PVMINTERFACE_SENDINFO.

PVMInterface::~PVMInterface  
 

Closes down the PVM connection and notifies pvmd.

Definition at line 112 of file pvminterface.cc.

References tasklist.


Member Function Documentation

bool PVMInterface::AllStandby   throw (runtime_error)
 

Definition at line 154 of file pvminterface.cc.

void PVMInterface::BroadcastCommand const char *    commandline throw (runtime_error)
 

Sends a string command to every member of the STANDBY group.

Definition at line 215 of file pvminterface.cc.

References PVMINTERFACE_SENDCOMMAND.

Referenced by Talker::ProcessCommand().

int PVMInterface::FindTask uint32    id
 

Returns tasklist index of first task which contains the id number. Returns -1 if not found.

Definition at line 130 of file pvminterface.cc.

References num_tasks, PVMTaskInfo::start_id, PVMTaskInfo::stop_id, tasklist, and uint32.

void PVMInterface::GetCommandWithTimeout char *    commandline throw (runtime_error)
 

Waits for and reads a command line sent by the master If no command has arrived after a delay, returns with "".

Definition at line 266 of file pvminterface.cc.

References PVMINTERFACE_SENDCOMMAND.

Referenced by Talker::ProcessCommand().

void PVMInterface::GetLeafCounts unsigned int *    countsarray,
uint32   size
throw (runtime_error)
 

Fills the countsarray with a list of occupied LeafNodes from another task.

The size parameter should be set to the maximum allowable size of the countsarray. The returned value of size is the actual size of the countsarray.

Definition at line 299 of file pvminterface.cc.

References PVMINTERFACE_SENDLEAFUPD, and uint32.

Referenced by Talker::ProcessCommand().

bool PVMInterface::IsMaster   [inline]
 

Definition at line 76 of file pvminterface.h.

References is_master.

Referenced by Talker::ProcessCommand().

bool PVMInterface::IsSlave   [inline]
 

Definition at line 78 of file pvminterface.h.

References is_master, and num_tasks.

void PVMInterface::JoinStandbyGroup  
 

Definition at line 176 of file pvminterface.cc.

int PVMInterface::LastMessageOriginator  
 

returns the task number of the last received message or -1 if not found.

Definition at line 247 of file pvminterface.cc.

References last_message_tid, num_tasks, tasklist, and PVMTaskInfo::tid.

Referenced by Talker::ProcessCommand().

void PVMInterface::LeaveStandbyGroup  
 

Definition at line 169 of file pvminterface.cc.

bool PVMInterface::MessagePending  
 

Definition at line 121 of file pvminterface.cc.

References PVMINTERFACE_SENDCOMMAND.

Referenced by Talker::ProcessCommand().

const char * PVMInterface::Name int    k
 

Definition at line 145 of file pvminterface.cc.

References PVMTaskInfo::name, num_tasks, and tasklist.

int PVMInterface::NumberOfOtherTasks   [inline]
 

Definition at line 69 of file pvminterface.h.

References num_tasks.

Referenced by Talker::ProcessCommand().

int PVMInterface::NumberOfTasks   [inline]
 

Definition at line 67 of file pvminterface.h.

References num_tasks.

Referenced by Talker::ProcessCommand().

void PVMInterface::SendCommand int    taskno,
const char *    commandline
throw (runtime_error)
 

Definition at line 183 of file pvminterface.cc.

References PVMINTERFACE_SENDCOMMAND.

Referenced by Talker::ProcessCommand().

void PVMInterface::SendLeafCounts int    tid,
unsigned int *    countsarray,
uint32    size
throw (runtime_error)
 

Definition at line 326 of file pvminterface.cc.

References PVMINTERFACE_SENDLEAFUPD, and uint32.

uint32 PVMInterface::StartID int    k [inline]
 

Definition at line 71 of file pvminterface.h.

References num_tasks, PVMTaskInfo::start_id, tasklist, and uint32.

Referenced by Talker::ProcessCommand().

uint32 PVMInterface::StopID int    k [inline]
 

Definition at line 73 of file pvminterface.h.

References num_tasks, PVMTaskInfo::stop_id, tasklist, and uint32.

Referenced by Talker::ProcessCommand().


Member Data Documentation

bool PVMInterface::is_master [private]
 

Definition at line 86 of file pvminterface.h.

Referenced by IsMaster(), and IsSlave().

int PVMInterface::last_message_msgtag [private]
 

Definition at line 93 of file pvminterface.h.

int PVMInterface::last_message_size [private]
 

Definition at line 92 of file pvminterface.h.

int PVMInterface::last_message_tid [private]
 

Definition at line 91 of file pvminterface.h.

Referenced by LastMessageOriginator().

PVMTaskInfo PVMInterface::myinfo [private]
 

Definition at line 85 of file pvminterface.h.

int PVMInterface::num_tasks [private]
 

Definition at line 87 of file pvminterface.h.

Referenced by FindTask(), IsSlave(), LastMessageOriginator(), Name(), NumberOfOtherTasks(), NumberOfTasks(), StartID(), and StopID().

PVMTaskInfo* PVMInterface::tasklist [private]
 

Definition at line 89 of file pvminterface.h.

Referenced by FindTask(), LastMessageOriginator(), Name(), StartID(), StopID(), and ~PVMInterface().


Generated on Wed May 29 11:37:27 2002 for MarkovPR by doxygen1.2.15