|
PaCO++
0.05
|
#include <ParisBlock.h>


Public Member Functions | |
| virtual void | clientFree ()=0 |
| virtual PieceToSend * | computePiecesToSend (unsigned &size)=0 |
| bool | computeReceive (Abstrait *darray) |
| Compute communication schedule on the server side. | |
| void | computeSend (const void *data, vAbstrait &vdarray, vector< unsigned > &destid) |
| Compute communication schedule on the client side. | |
| virtual bool | freeComId (long id) |
| virtual void * | getClientData (void *pid, int server_node, long &size, long &length, bool &end)=0 |
| void * | getConfig () |
| virtual void * | getDescr ()=0 |
| virtual PaCO::PacoTopology_t | getDestTopology ()=0 |
| const PaCO::distLoc_t & | getMode () const |
| virtual long | getNodeRank ()=0 |
| Abstrait * | getResult () const |
| If computeReceive returns ok, get the data. | |
| virtual void * | getServerData (long &length)=0 |
| virtual PaCO::PacoTopology_t | getSourceTopology ()=0 |
| virtual bool | insertData (void *rcptBuf, unsigned long element_nb)=0 |
| ParisBlock (Fabrique *f) | |
| ParisBlock (Fabrique *f, unsigned int blocksize) | |
| void | reset () |
| virtual void | serverFree ()=0 |
| bool | setClientConfiguration (const PaCO::PacoTopology_t &ctopo) |
| virtual bool | setComId (long id) |
| void | setCommunicator (void *comm) |
| int | setConfig (void *config) |
| virtual void | setDataPtr (void *dataPtr)=0 |
| virtual void | setDescr (void *descr)=0 |
| virtual void | setDestTopology (PaCO::PacoTopology_t topo)=0 |
| void | setFabric (Fabrique *f) |
| bool | setGlobalDataConfiguration (const PaCO::PacoGlobalData_t &gd) |
| bool | setLocalDataConfiguration (const PaCO::PacoLocalData_t &ld) |
| bool | setMode (const PaCO::distLoc_t mode) |
| virtual void | setNodeRank (long Rank)=0 |
| bool | setServerConfiguration (const PaCO::PacoTopology_t &stopo) |
| virtual void | setSourceTopology (PaCO::PacoTopology_t topo)=0 |
| virtual | ~ParisBlock () |
Private Attributes | |
| PaCO::PacoTopology_t | _clttopo |
| void * | _comm |
| Abstrait * | _darray |
| Fabrique * | _fab |
| PaCO::PacoGlobalData_t | _gd |
| LocalData_t | _ld |
| PaCO::distLoc_t | _mode |
| ParisBlock_param_t | _param |
| int | _remaining |
| PaCO::PacoTopology_t | _srvtopo |
| vAbstrait * | _vdarray |
Definition at line 9 of file ParisBlock.h.
| ParisBlock::ParisBlock | ( | Fabrique * | f | ) |
Definition at line 5 of file ParisBlock.cc.
References _clttopo, _darray, _param, _srvtopo, _vdarray, ParisBlock_param_t::blocksize, PARISBLOCK_BLOCK, setFabric(), PaCO::PacoTopology_s::total, ParisBlock_param_t::type, and ParisBlock_param_t::unitblocksize.
{
setFabric(f);
_darray = f->creer();
_vdarray = f->vcreer();
_vdarray->clear();
_clttopo.total = 123; // debug
_srvtopo.total = 123; // debug
// param
_param.type = PARISBLOCK_BLOCK; // default is bloc
_param.blocksize = 1; // default is cyclic(1)
_param.unitblocksize = 1; // by default
}

| ParisBlock::ParisBlock | ( | Fabrique * | f, |
| unsigned int | blocksize | ||
| ) |
| ParisBlock::~ParisBlock | ( | ) | [virtual] |
| virtual void DistributionLibrary::clientFree | ( | ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, GaBro, and ParisBasicExample.
| virtual PieceToSend* DistributionLibrary::computePiecesToSend | ( | unsigned & | size | ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, and GaBro.
| bool ParisBlock::computeReceive | ( | Abstrait * | darray | ) |
Compute communication schedule on the server side.
Definition at line 59 of file ParisBlock.cc.
References _clttopo, _comm, _darray, _ld, _mode, _param, _remaining, _srvtopo, _vdarray, computeReceiveDataBlock1D(), nbofPart(), posofPart(), setClientConfiguration(), setMode(), and PaCO::PacoTopology_s::total.
{
this->setClientConfiguration(darray->topo());
// Get the mode of the client
this->setMode(darray->mode());
unsigned nb = nbofPart(_mode, _clttopo.total, _srvtopo.total, _ld.rank);
unsigned pos;
// In server side redistribution, empty dist for server nodes whose id > max client node
if (darray->dist().length() != 0 ) {
pos = posofPart(_mode, _srvtopo.total, darray->dist()[0].rank);
} else {
pos = 0;
}
// Initialize _vdarray & remaining (assumed clean)
if (_vdarray->size() == 0) {
// _vdarray is empty: so let's define its size
_vdarray->size(nb);
_remaining = nb;
}
// fprintf(stderr, "computeReceive: Node %d : set entry %d/%d to %p\n", _ld.rank, pos, nb, darray);
_vdarray->setAbstrait(pos, darray);
_remaining--;
// fprintf(stderr, "computeReceive: Node %d : got %d of %d data\n", _ld.rank, _vdarray->size() - _remaining, _vdarray->size());
if (_remaining == 0) {
computeReceiveDataBlock1D(_vdarray, _mode, _srvtopo.total, _ld.rank, &_param, _darray, _comm);
return true;
} else {
return false;
}
}

| void ParisBlock::computeSend | ( | const void * | data, |
| vAbstrait & | vdarray, | ||
| vector< unsigned > & | destid | ||
| ) |
Compute communication schedule on the client side.
Definition at line 53 of file ParisBlock.cc.
References _clttopo, _comm, _gd, _ld, _mode, _param, _srvtopo, and computeSendDataBlock1D().
{
_ld.base = (char*) data;
computeSendDataBlock1D(_gd, _ld, _clttopo, _srvtopo, &_param, vdarray, destid, _mode, _comm);
}

| virtual bool DistributionLibrary::freeComId | ( | long | id | ) | [inline, virtual, inherited] |
Reimplemented in BasicBC, and GaBro.
Definition at line 41 of file DistributionLibrairie.h.
{ return false;}
| virtual void* DistributionLibrary::getClientData | ( | void * | pid, |
| int | server_node, | ||
| long & | size, | ||
| long & | length, | ||
| bool & | end | ||
| ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, and GaBro.
| void * ParisBlock::getConfig | ( | ) |
| virtual void* DistributionLibrary::getDescr | ( | ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, GaBro, and ParisBasicExample.
| virtual PaCO::PacoTopology_t DistributionLibrary::getDestTopology | ( | ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, GaBro, and ParisBasicExample.
| const PaCO::distLoc_t & ParisBlock::getMode | ( | ) | const |
| virtual long DistributionLibrary::getNodeRank | ( | ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, GaBro, and ParisBasicExample.
| Abstrait * ParisBlock::getResult | ( | ) | const |
If computeReceive returns ok, get the data.
Definition at line 99 of file ParisBlock.cc.
References _darray.
{ return _darray; }
| virtual void* DistributionLibrary::getServerData | ( | long & | length | ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, GaBro, and ParisBasicExample.
| virtual PaCO::PacoTopology_t DistributionLibrary::getSourceTopology | ( | ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, GaBro, and ParisBasicExample.
| virtual bool DistributionLibrary::insertData | ( | void * | rcptBuf, |
| unsigned long | element_nb | ||
| ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, and GaBro.
| void ParisBlock::reset | ( | ) |
| virtual void DistributionLibrary::serverFree | ( | ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, GaBro, and ParisBasicExample.
| bool ParisBlock::setClientConfiguration | ( | const PaCO::PacoTopology_t & | ctopo | ) |
Definition at line 33 of file ParisBlock.cc.
References _clttopo.
Referenced by computeReceive().
{ _clttopo = ctopo; return true; }
| virtual bool DistributionLibrary::setComId | ( | long | id | ) | [inline, virtual, inherited] |
Reimplemented in BasicBC, and GaBro.
Definition at line 40 of file DistributionLibrairie.h.
{ return false;}
| void ParisBlock::setCommunicator | ( | void * | comm | ) | [inline, virtual] |
Implements DistributionLibrary.
Definition at line 39 of file ParisBlock.h.
References _comm.
{ _comm = comm;}
| int ParisBlock::setConfig | ( | void * | config | ) |
Definition at line 44 of file ParisBlock.cc.
References _param.
{
_param = * ( ParisBlock_param_t*) config;
return 0;
}
| virtual void DistributionLibrary::setDataPtr | ( | void * | dataPtr | ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, GaBro, and ParisBasicExample.
| virtual void DistributionLibrary::setDescr | ( | void * | descr | ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, GaBro, and ParisBasicExample.
| virtual void DistributionLibrary::setDestTopology | ( | PaCO::PacoTopology_t | topo | ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, GaBro, and ParisBasicExample.
Referenced by PaCO_operation::configureTopo().
| void ParisBlock::setFabric | ( | Fabrique * | f | ) |
Definition at line 25 of file ParisBlock.cc.
References _fab.
Referenced by ParisBlock().
{ _fab = f; }
| bool ParisBlock::setGlobalDataConfiguration | ( | const PaCO::PacoGlobalData_t & | gd | ) |
| bool ParisBlock::setLocalDataConfiguration | ( | const PaCO::PacoLocalData_t & | ld | ) |
Definition at line 37 of file ParisBlock.cc.
References _ld, PaCO::PacoLocalData_s::len, PaCO::PacoLocalData_s::rank, and PaCO::PacoLocalData_s::start.
| bool ParisBlock::setMode | ( | const PaCO::distLoc_t | mode | ) |
Definition at line 31 of file ParisBlock.cc.
References _mode.
Referenced by computeReceive().
{ _mode = mode; return true; } // true if ok
| virtual void DistributionLibrary::setNodeRank | ( | long | Rank | ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, GaBro, and ParisBasicExample.
Referenced by PaCO_operation::configureTopo().
| bool ParisBlock::setServerConfiguration | ( | const PaCO::PacoTopology_t & | stopo | ) |
Definition at line 34 of file ParisBlock.cc.
References _srvtopo.
{ _srvtopo = stopo; return true; }
| virtual void DistributionLibrary::setSourceTopology | ( | PaCO::PacoTopology_t | topo | ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, GaBro, and ParisBasicExample.
Referenced by PaCO_operation::configureTopo().
PaCO::PacoTopology_t ParisBlock::_clttopo [private] |
Definition at line 13 of file ParisBlock.h.
Referenced by computeReceive(), computeSend(), ParisBlock(), and setClientConfiguration().
void* ParisBlock::_comm [private] |
Definition at line 20 of file ParisBlock.h.
Referenced by computeReceive(), computeSend(), and setCommunicator().
Abstrait* ParisBlock::_darray [private] |
Definition at line 23 of file ParisBlock.h.
Referenced by computeReceive(), getResult(), ParisBlock(), and ~ParisBlock().
Fabrique* ParisBlock::_fab [private] |
Definition at line 22 of file ParisBlock.h.
Referenced by setFabric(), and ~ParisBlock().
PaCO::PacoGlobalData_t ParisBlock::_gd [private] |
Definition at line 15 of file ParisBlock.h.
Referenced by computeSend(), and setGlobalDataConfiguration().
LocalData_t ParisBlock::_ld [private] |
Definition at line 18 of file ParisBlock.h.
Referenced by computeReceive(), computeSend(), and setLocalDataConfiguration().
PaCO::distLoc_t ParisBlock::_mode [private] |
Definition at line 12 of file ParisBlock.h.
Referenced by computeReceive(), computeSend(), getMode(), and setMode().
ParisBlock_param_t ParisBlock::_param [private] |
Definition at line 28 of file ParisBlock.h.
Referenced by computeReceive(), computeSend(), getConfig(), ParisBlock(), and setConfig().
int ParisBlock::_remaining [private] |
Definition at line 25 of file ParisBlock.h.
Referenced by computeReceive().
PaCO::PacoTopology_t ParisBlock::_srvtopo [private] |
Definition at line 14 of file ParisBlock.h.
Referenced by computeReceive(), computeSend(), ParisBlock(), and setServerConfiguration().
vAbstrait* ParisBlock::_vdarray [private] |
Definition at line 24 of file ParisBlock.h.
Referenced by computeReceive(), ParisBlock(), reset(), and ~ParisBlock().