|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.udc.gii.common.eaf.algorithm.parallel.topology.Topology
public abstract class Topology
This class encapsulates the topology of the processing nodes in a parallel environment and is responsible for the "low-level" communication between the nodes. It represents an interconnection pattern between nodes.
Each process has an integer associated with it, beeing that number the rank of this process within the topology.
A topology makes it easy to communicate with other nodes by giving methods to send and receive data.
Before using a topology the method initialize()
should be called. This method
might perform communications with the other processes within the parallel environment
depending on the parameters of the topology and will configure the topology
by itself. If the user doesn't call this method, a call to any method who
uses the state of the class will call it.
Note: 'nodes' and 'processes' are used as synonyms. Note for implementors: Subclasses must populate the protected atributes.
Field Summary | |
---|---|
protected mpi.Intracomm |
communicator
For this implementation MPI is used. |
private boolean |
initialized
|
private int |
races
The number of races in the parallel environment. |
protected int[] |
receivers
The ranks of the processes who receive from the process of this object. |
protected int[] |
senders
The ranks of the processes who send to the process of this object. |
protected int |
topologyRank
The rank of this process within this topology. |
Constructor Summary | |
---|---|
Topology()
Creates a new instance of Topology. |
|
Topology(int races)
Creates a new instance of Topology. |
Method Summary | |
---|---|
void |
configure(org.apache.commons.configuration.Configuration conf)
Configures the topology. |
protected abstract void |
doConfigure()
A subclass might need additional configuration. |
protected abstract void |
doConfigure(org.apache.commons.configuration.Configuration conf)
A subclass might need additional configuration. |
protected abstract void |
doInitialize()
A subclass might need additional initialization. |
mpi.Intracomm |
getCommunicator()
|
int |
getRaces()
|
int[] |
getReceivers()
|
int[] |
getSenders()
|
int |
getSize()
|
int |
getTopologyRank()
|
void |
initialize()
Initializes this topology. |
boolean |
isConnected()
Returns true if the process is connected to this topology and
can hence make use of it. |
boolean |
isInitialized()
Returns true if this topology is initialized and can hence be used. |
protected void |
setInitialized(boolean initialized)
|
void |
setRaces(int races)
|
void |
synchronize()
Synchronizes all processes within this topology. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int races
protected mpi.Intracomm communicator
protected int topologyRank
protected int[] receivers
protected int[] senders
private boolean initialized
Constructor Detail |
---|
public Topology()
public Topology(int races)
Method Detail |
---|
public boolean isConnected()
true
if the process is connected to this topology and
can hence make use of it. Returns false
otherwise.
public boolean isInitialized()
true
if this topology is initialized and can hence be used.
Returns false
otherwise.
protected void setInitialized(boolean initialized)
protected abstract void doInitialize()
public void initialize()
public void synchronize()
protected abstract void doConfigure()
protected abstract void doConfigure(org.apache.commons.configuration.Configuration conf)
public void configure(org.apache.commons.configuration.Configuration conf)
configure
in interface Configurable
conf
- a Configuration object.Configuration
public mpi.Intracomm getCommunicator()
public int getTopologyRank()
public int getRaces()
public int getSize()
public void setRaces(int races)
public int[] getReceivers()
public int[] getSenders()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |