Termination.c File Reference

#include <stdlib.h>
#include <pvm3.h>
#include "Termination.h"
#include "FilterData.h"
#include "../Messages.h"

Include dependency graph for Termination.c:

Go to the source code of this file.

Functions

GlobalTerminationinitGlobalTermination (Layout *layout, int numFilterInstances)
int findFilterInstId (filterInstTid)
int verifyGlobalTermination (int filterInstTid, int filterInstTag)
TerminationDetectionstoreNeighborTids (TerminationDetection *tdd, int numNeighbors, int *neighborTids, int portTag)
TerminationDetectioninitTerminationDetection ()
void sendTerminationToNeighbors ()
void sendTerminationToLeader ()
int beginTerminationDetection ()
 Begin a new termination detection round.
int findNeighborId (int neighborTid)
int terminationDetectionRound (int neighborTid, int neighborTag)
int updateTermStreamToEmpty (int neighborTid)


Function Documentation

int beginTerminationDetection  ) 
 

Begin a new termination detection round.

Definition at line 224 of file Termination.c.

References _TerminationDetection_::localTag, PARTICIPATING, sendTerminationToNeighbors(), _TerminationDetection_::status, and tdd.

Referenced by dsReadBuffer().

Here is the call graph for this function:

int findFilterInstId filterInstTid   ) 
 

Definition at line 63 of file Termination.c.

References _TerminationFilterInstancesData_::filterInstanceTid, gt, _GlobalTermination_::numFilterInstances, and _GlobalTermination_::tfid.

Referenced by verifyGlobalTermination().

int findNeighborId int  neighborTid  ) 
 

Definition at line 239 of file Termination.c.

References _TerminationDetection_::nd, _NeighborsData_::neighborStreamId, _NeighborsData_::neighborTid, _TerminationDetection_::numNeighbors, and tdd.

Referenced by terminationDetectionRound(), and updateTermStreamToEmpty().

GlobalTermination* initGlobalTermination Layout layout,
int  numFilterInstances
 

Definition at line 12 of file Termination.c.

References _GlobalTermination_::currentRoundTag, gt, NOTTERMINATED, _GlobalTermination_::numFilterInstances, _TerminationFilterInstancesData_::terminate, and _GlobalTermination_::tfid.

TerminationDetection* initTerminationDetection  ) 
 

Definition at line 157 of file Termination.c.

References fd, __FilterData__::inputPorts, _TerminationDetection_::localTag, MAXINSTANCES, _TerminationDetection_::nd, NOTPARTICIPATING, __FilterData__::numInputPorts, _TerminationDetection_::numNeighbors, __FilterData__::numOutputPorts, InputPort::numSources, _TerminationDetection_::status, storeNeighborTids(), InputPort::tag, tdd, and InputPort::tidsSources.

Referenced by runFilter().

Here is the call graph for this function:

void sendTerminationToLeader  ) 
 

used to notify manager this filter has nothing to do

Definition at line 214 of file Termination.c.

References _TerminationDetection_::localTag, MSGT_LOCALTERM, and tdd.

void sendTerminationToNeighbors  ) 
 

filters send to their neighbors when they think there is nothing to be done

Definition at line 200 of file Termination.c.

References _TerminationDetection_::localTag, MSGT_INITTERM, _TerminationDetection_::nd, _NeighborsData_::neighborPortTag, _NeighborsData_::neighborTid, _TerminationDetection_::numNeighbors, and tdd.

Referenced by beginTerminationDetection(), and terminationDetectionRound().

TerminationDetection* storeNeighborTids TerminationDetection tdd,
int  numNeighbors,
int *  neighborTids,
int  portTag
 

Definition at line 136 of file Termination.c.

References _TerminationDetection_::nd, _NeighborsData_::neighborTid, and _TerminationDetection_::numNeighbors.

Referenced by initTerminationDetection().

int terminationDetectionRound int  neighborTid,
int  neighborTag
 

Definition at line 252 of file Termination.c.

References EMPTY, findNeighborId(), _TerminationDetection_::localTag, _TerminationDetection_::nd, _NeighborsData_::neighborTerm, NOTTERMINATED, _TerminationDetection_::numNeighbors, PARTICIPATING, sendTerminationToNeighbors(), _TerminationDetection_::status, _TerminationDetection_::stream, tdd, and TERMINATED.

Referenced by dsReadBuffer(), and dsReadNonBlockingBuffer().

Here is the call graph for this function:

int updateTermStreamToEmpty int  neighborTid  ) 
 

Definition at line 312 of file Termination.c.

References findNeighborId(), FULL, NOTPARTICIPATING, PARTICIPATING, _TerminationDetection_::status, _TerminationDetection_::stream, and tdd.

Referenced by dsReadBuffer(), and dsReadNonBlockingBuffer().

Here is the call graph for this function:

int verifyGlobalTermination int  filterInstTid,
int  filterInstTag
 

used to notify manager this filter ended its work

Definition at line 74 of file Termination.c.

References _GlobalTermination_::currentRoundTag, findFilterInstId(), gt, _GlobalTermination_::numFilterInstances, _TerminationFilterInstancesData_::terminate, TERMINATED, and _GlobalTermination_::tfid.

Here is the call graph for this function:


Generated on Tue Jan 17 19:27:55 2006 for Void by  doxygen 1.4.6