|
PaCO++
0.05
|
#include <ParisBlockMPC.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 |
| 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 |
| ParisBlockMPC (Fabrique *f) | |
| void | reset () |
| virtual void | serverFree ()=0 |
| bool | setClientConfiguration (const PaCO::PacoTopology_t &ctopo) |
| virtual bool | setComId (long id) |
| void | setCommunicator (void *comm) |
| 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 | ~ParisBlockMPC () |
Private Attributes | |
| PaCO::PacoTopology_t | _clttopo |
| void * | _comm |
| Abstrait * | _darray |
| Fabrique * | _fab |
| PaCO::PacoGlobalData_t | _gd |
| LocalData_t | _ld |
| PaCO::distLoc_t | _mode |
| int | _remaining |
| PaCO::PacoTopology_t | _srvtopo |
| vAbstrait * | _vdarray |
Definition at line 7 of file ParisBlockMPC.h.
| ParisBlockMPC::ParisBlockMPC | ( | Fabrique * | f | ) |
Definition at line 5 of file ParisBlockMPC.cc.
References _clttopo, _darray, _srvtopo, _vdarray, setFabric(), and PaCO::PacoTopology_s::total.
{
setFabric(f);
_darray = f->creer();
_vdarray = f->vcreer();
_vdarray->clear();
_clttopo.total = 123; // debug
_srvtopo.total = 123; // debug
}

| ParisBlockMPC::~ParisBlockMPC | ( | ) | [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 ParisBlockMPC::computeReceive | ( | Abstrait * | darray | ) |
Compute communication schedule on the server side.
Definition at line 44 of file ParisBlockMPC.cc.
References _clttopo, _comm, _darray, _ld, _mode, _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, _darray, _comm);
return true;
} else {
return false;
}
}

| void ParisBlockMPC::computeSend | ( | const void * | data, |
| vAbstrait & | vdarray, | ||
| vector< unsigned > & | destid | ||
| ) |
Compute communication schedule on the client side.
Definition at line 38 of file ParisBlockMPC.cc.
References _clttopo, _comm, _gd, _ld, _mode, _srvtopo, and computeSendDataBlock1D().
{
_ld.base = (char*) data;
computeSendDataBlock1D(_gd, _ld, _clttopo, _srvtopo, 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.
| 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 & ParisBlockMPC::getMode | ( | ) | const |
| virtual long DistributionLibrary::getNodeRank | ( | ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, GaBro, and ParisBasicExample.
| Abstrait * ParisBlockMPC::getResult | ( | ) | const |
If computeReceive returns ok, get the data.
Definition at line 84 of file ParisBlockMPC.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 ParisBlockMPC::reset | ( | ) |
| virtual void DistributionLibrary::serverFree | ( | ) | [pure virtual, inherited] |
Implemented in BasicBC, Controlled, Identity, GaBro, and ParisBasicExample.
| bool ParisBlockMPC::setClientConfiguration | ( | const PaCO::PacoTopology_t & | ctopo | ) |
Definition at line 27 of file ParisBlockMPC.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 ParisBlockMPC::setCommunicator | ( | void * | comm | ) | [inline, virtual] |
Implements DistributionLibrary.
Definition at line 31 of file ParisBlockMPC.h.
References _comm.
{_comm = comm;}
| 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 ParisBlockMPC::setFabric | ( | Fabrique * | f | ) |
Definition at line 19 of file ParisBlockMPC.cc.
References _fab.
Referenced by ParisBlockMPC().
{ _fab = f; }
| bool ParisBlockMPC::setGlobalDataConfiguration | ( | const PaCO::PacoGlobalData_t & | gd | ) |
| bool ParisBlockMPC::setLocalDataConfiguration | ( | const PaCO::PacoLocalData_t & | ld | ) |
Definition at line 31 of file ParisBlockMPC.cc.
References _ld, PaCO::PacoLocalData_s::len, PaCO::PacoLocalData_s::rank, and PaCO::PacoLocalData_s::start.
| bool ParisBlockMPC::setMode | ( | const PaCO::distLoc_t | mode | ) |
Definition at line 25 of file ParisBlockMPC.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 ParisBlockMPC::setServerConfiguration | ( | const PaCO::PacoTopology_t & | stopo | ) |
Definition at line 28 of file ParisBlockMPC.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 ParisBlockMPC::_clttopo [private] |
Definition at line 11 of file ParisBlockMPC.h.
Referenced by computeReceive(), computeSend(), ParisBlockMPC(), and setClientConfiguration().
void* ParisBlockMPC::_comm [private] |
Definition at line 18 of file ParisBlockMPC.h.
Referenced by computeReceive(), computeSend(), and setCommunicator().
Abstrait* ParisBlockMPC::_darray [private] |
Definition at line 21 of file ParisBlockMPC.h.
Referenced by computeReceive(), getResult(), ParisBlockMPC(), and ~ParisBlockMPC().
Fabrique* ParisBlockMPC::_fab [private] |
Definition at line 20 of file ParisBlockMPC.h.
Referenced by setFabric(), and ~ParisBlockMPC().
PaCO::PacoGlobalData_t ParisBlockMPC::_gd [private] |
Definition at line 13 of file ParisBlockMPC.h.
Referenced by computeSend(), and setGlobalDataConfiguration().
LocalData_t ParisBlockMPC::_ld [private] |
Definition at line 16 of file ParisBlockMPC.h.
Referenced by computeReceive(), computeSend(), and setLocalDataConfiguration().
PaCO::distLoc_t ParisBlockMPC::_mode [private] |
Definition at line 10 of file ParisBlockMPC.h.
Referenced by computeReceive(), computeSend(), getMode(), and setMode().
int ParisBlockMPC::_remaining [private] |
Definition at line 23 of file ParisBlockMPC.h.
Referenced by computeReceive().
PaCO::PacoTopology_t ParisBlockMPC::_srvtopo [private] |
Definition at line 12 of file ParisBlockMPC.h.
Referenced by computeReceive(), computeSend(), ParisBlockMPC(), and setServerConfiguration().
vAbstrait* ParisBlockMPC::_vdarray [private] |
Definition at line 22 of file ParisBlockMPC.h.
Referenced by computeReceive(), ParisBlockMPC(), reset(), and ~ParisBlockMPC().