|
||||||||||
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.migration.MigrationTopology
public abstract class MigrationTopology
A migration topology is a topology that encapsulates the comunication between islands in an island model (parallel evolutionary algorithm).
A migration operator uses an instance of this class to perform the necessary
communication among islands making use of the send(es.udc.gii.common.eaf.algorithm.parallel.topology.migration.MigrationObject)
and receive()
methods.
This is an abstract class, so it can not be directly used. Instead, some
subclasses are provided and the user can code their own. Subclasses of this class
are responsible for populating the protected atributes from Topology
and
may optionally override de protected methods doSend(es.udc.gii.common.eaf.algorithm.parallel.topology.migration.MigrationObject)
and
doReceive()
in order to change the behaviour of the
send(es.udc.gii.common.eaf.algorithm.parallel.topology.migration.MigrationObject)
and receive()
methods.
However, a default implementation of the protected methods is given.
Field Summary | |
---|---|
private java.util.Map<mpi.Request,MigrationObject[]> |
pendingRecvRequest
|
private java.util.Map<mpi.Request,MigrationObject[]> |
pendingSendRequest
|
private static int |
TAG
Tag used for sending and receiving. |
Fields inherited from class es.udc.gii.common.eaf.algorithm.parallel.topology.Topology |
---|
communicator, receivers, senders, topologyRank |
Constructor Summary | |
---|---|
MigrationTopology()
|
|
MigrationTopology(int races)
|
Method Summary | |
---|---|
private void |
addRecvRequest(mpi.Request request,
MigrationObject[] migrant)
|
private void |
addSendRequest(mpi.Request request,
MigrationObject[] migrant)
|
protected java.util.List<MigrationObject> |
doReceive()
Each subclass can implement the receive method accordingly. |
protected void |
doSend(MigrationObject migrant)
Each subclass can implement the send method accordingly. |
void |
finish()
|
java.util.List<MigrationObject> |
receive()
Receives a list of MigrationObject from the senders. |
void |
send(MigrationObject migrant)
Sends a MigrationObject to the receivers. |
private java.util.List<MigrationObject> |
testRecvRequests()
|
private void |
testSendRequests()
|
Methods inherited from class es.udc.gii.common.eaf.algorithm.parallel.topology.Topology |
---|
configure, doConfigure, doConfigure, doInitialize, 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,MigrationObject[]> pendingSendRequest
private java.util.Map<mpi.Request,MigrationObject[]> pendingRecvRequest
private static final int TAG
Constructor Detail |
---|
public MigrationTopology()
public MigrationTopology(int races)
Method Detail |
---|
private void testSendRequests()
private void addSendRequest(mpi.Request request, MigrationObject[] migrant)
private java.util.List<MigrationObject> testRecvRequests()
private void addRecvRequest(mpi.Request request, MigrationObject[] migrant)
protected void doSend(MigrationObject migrant)
public void send(MigrationObject migrant)
MigrationObject
to the receivers. It is a nonblocking
send.
protected java.util.List<MigrationObject> doReceive()
public java.util.List<MigrationObject> receive()
MigrationObject
from the senders. It is a
nonblocking receive. If no message has arrived, an empty list is returned.
public void finish()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |