OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GeometricStrategy Class Reference

#include <GeometricStrategy.h>

Inheritance diagram for GeometricStrategy:
Inheritance graph
[legend]
Collaboration diagram for GeometricStrategy:
Collaboration graph
[legend]

Public Member Functions

 GeometricStrategy (size_t num_masters, boost::shared_ptr< CommTopology > topology, MPI_Comm comm)
 
virtual ~GeometricStrategy ()
 
void split ()
 

Protected Member Functions

void splitInLargestDim ()
 
void splitRegionAt (int split_at_coordinate, int split_in_direction)
 
bool isSplittable (double origin, double split_at_coordinate, double extension)
 
void computeCentroid (region_t &region)
 
void coordinatesToPID (coordinates_t coordinate, std::vector< int > &pid)
 
void printRegion (region_t region)
 
- Protected Member Functions inherited from SplitStrategy
 SplitStrategy (CmdArguments_t args, MPI_Comm comm=MPI_COMM_WORLD)
 
virtual ~SplitStrategy ()
 
virtual int getNrWorkerGroups () const =0
 Get number of worker groups. More...
 
MPI_Comm getComm () const
 
int getRank () const
 
int getGlobalRank () const
 
int getNP () const
 
Role_t getRole () const
 
int getLeader () const
 
int getPoller () const
 

Protected Attributes

std::vector< region_tregions_
 
- Protected Attributes inherited from SplitStrategy
int rank_
 
int global_rank_
 
int num_procs_
 
int group_id_
 
CmdArguments_t cmd_args_
 
Role_t role_
 
std::vector< unsigned int > colorings_
 defines comm splitting More...
 
int leader_
 every core specifies a leader (master is its own leader) More...
 
int poller_
 every core can specifies a master More...
 

Detailed Description

The geometric strategy partitions the network graph in num_masters equally sized regions and then places a master at the centroid of each region. Workers inside a region are assigned to the master at its centroid.

Definition at line 24 of file GeometricStrategy.h.

Constructor & Destructor Documentation

GeometricStrategy::GeometricStrategy ( size_t  num_masters,
boost::shared_ptr< CommTopology topology,
MPI_Comm  comm 
)
inline

Definition at line 28 of file GeometricStrategy.h.

virtual GeometricStrategy::~GeometricStrategy ( )
inlinevirtual

Definition at line 33 of file GeometricStrategy.h.

Member Function Documentation

void GeometricStrategy::computeCentroid ( region_t region)
inlineprotected

Definition at line 169 of file GeometricStrategy.h.

References coordinatesToPID(), region_t::extensions, region_t::master_pid, and region_t::origin.

Referenced by split().

Here is the call graph for this function:

void GeometricStrategy::coordinatesToPID ( coordinates_t  coordinate,
std::vector< int > &  pid 
)
inlineprotected

Definition at line 184 of file GeometricStrategy.h.

References SplitStrategy::comm_, and SplitStrategy::rank_.

Referenced by computeCentroid(), and split().

bool GeometricStrategy::isSplittable ( double  origin,
double  split_at_coordinate,
double  extension 
)
inlineprotected

Definition at line 164 of file GeometricStrategy.h.

Referenced by splitRegionAt().

void GeometricStrategy::printRegion ( region_t  region)
inlineprotected

Definition at line 197 of file GeometricStrategy.h.

References endl(), region_t::extensions, region_t::origin, and SplitStrategy::rank_.

Here is the call graph for this function:

void GeometricStrategy::split ( )
inlinevirtual

Forcing concrete implementation to split and assign poller, optimizer and worker nodes.

Implements SplitStrategy.

Definition at line 36 of file GeometricStrategy.h.

References SplitStrategy::comm_, computeCentroid(), coordinatesToPID(), region_t::extensions, region_t::origin, SplitStrategy::rank_, regions_, and splitInLargestDim().

Here is the call graph for this function:

void GeometricStrategy::splitInLargestDim ( )
inlineprotected

Definition at line 100 of file GeometricStrategy.h.

References regions_, and splitRegionAt().

Referenced by split().

Here is the call graph for this function:

void GeometricStrategy::splitRegionAt ( int  split_at_coordinate,
int  split_in_direction 
)
inlineprotected

Definition at line 125 of file GeometricStrategy.h.

References region_t::extensions, isSplittable(), region_t::origin, and regions_.

Referenced by splitInLargestDim().

Here is the call graph for this function:

Member Data Documentation

std::vector<region_t> GeometricStrategy::regions_
protected

Definition at line 98 of file GeometricStrategy.h.

Referenced by split(), splitInLargestDim(), and splitRegionAt().


The documentation for this class was generated from the following file: