|
||||||||||
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
es.udc.gii.common.eaf.algorithm.parallel.topology.evaluation.EvaluationTopology
public class EvaluationTopology
A evaluation topology is used by a DistributedEvaluation
and
hides the details of the underlying distributed evironment.
This class provides methods for sending and receiving individuals
(using EvaluationObject
): see (send(es.udc.gii.common.eaf.algorithm.parallel.topology.evaluation.EvaluationObject)
and
receive()
).
Field Summary | |
---|---|
protected boolean |
master
true if this process is the master in this topology. |
protected static int |
MASTER
Rank of the default master process. |
protected static int |
MSG_TAG
|
protected int |
myMaster
The rank of the master of this topology. |
static int |
NONE
Special return value for getMaster() . |
private java.util.Map<mpi.Request,EvaluationObject[]> |
pendingSendRequest
|
Fields inherited from class es.udc.gii.common.eaf.algorithm.parallel.topology.Topology |
---|
communicator, receivers, senders, topologyRank |
Constructor Summary | |
---|---|
EvaluationTopology()
Creates a new instance of EvaluationTopology. |
|
EvaluationTopology(int races)
Creates a new instance of EvaluationTopology. |
Method Summary | |
---|---|
private void |
addSendRequest(mpi.Request request,
EvaluationObject[] evalObj)
|
protected void |
doConfigure()
A subclass might need additional configuration. |
protected void |
doConfigure(org.apache.commons.configuration.Configuration conf)
A subclass might need additional configuration. |
protected void |
doInitialize()
Performs the initialization. |
protected EvaluationObject |
doReceive()
Performs the receive operation. |
protected void |
doSend(EvaluationObject evalObj)
Performs the send operation. |
boolean |
evaluationObjectReceived()
Checks if some evaluation object has been received. |
void |
finish()
|
int |
getMaster()
Retuns the rank of the master of this topology. |
boolean |
isMaster()
Returns true if the calling process is the master process
of this topology. |
EvaluationObject |
receive()
Receives a EvaluationObject from a slave or from a master. |
void |
send(EvaluationObject evalObj)
Sends a EvaluationObject to a slave or to the master. |
private void |
testSendRequests()
|
Methods inherited from class es.udc.gii.common.eaf.algorithm.parallel.topology.Topology |
---|
configure, getCommunicator, getRaces, getReceivers, getSenders, getSize, getTopologyRank, initialize, isConnected, isInitialized, setInitialized, setRaces, synchronize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Map<mpi.Request,EvaluationObject[]> pendingSendRequest
protected static final int MSG_TAG
protected static final int MASTER
protected boolean master
true
if this process is the master in this topology.
public static final int NONE
getMaster()
.
protected int myMaster
Constructor Detail |
---|
public EvaluationTopology()
public EvaluationTopology(int races)
Method Detail |
---|
protected void doInitialize()
doInitialize
in class Topology
protected void doConfigure()
Topology
doConfigure
in class Topology
protected void doConfigure(org.apache.commons.configuration.Configuration conf)
Topology
doConfigure
in class Topology
private void testSendRequests()
private void addSendRequest(mpi.Request request, EvaluationObject[] evalObj)
protected void doSend(EvaluationObject evalObj)
public void send(EvaluationObject evalObj)
EvaluationObject
to a slave or to the master. The receiver
is known by the method EvaluationObject.getDest()
of evalObj
.
This method is implemented with the doSend(es.udc.gii.common.eaf.algorithm.parallel.topology.evaluation.EvaluationObject)
method.
It is a nonblocking send.
protected EvaluationObject doReceive()
public EvaluationObject receive()
EvaluationObject
from a slave or from a master. For slaves
it returns null
when the evaluation process is finished.
For all processes it returns null
when an object is received
that's not an instance of EvaluationObject
.
This method is implemented with the doReceive()
method.
It is a blocking receive, so the caller waits until a message is arrived.
public boolean evaluationObjectReceived()
true
if an evaluation object has been received,
false
otherwise.public int getMaster()
NONE
.
public boolean isMaster()
true
if the calling process is the master process
of this topology. Returns false
otherwise.
public void finish()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |