Commit 2e91efb9 authored by BRAMAS Berenger's avatar BRAMAS Berenger

remove sendable abstraction for POD classes

parent 33e7351a
......@@ -103,59 +103,6 @@ public:
memset(up->multipole_exp, 0, sizeof(FReal) * NRHS * NVALS * VectorSize);
memset(down->local_exp, 0, sizeof(FReal) * NLHS * NVALS * VectorSize);
}
///////////////////////////////////////////////////////
// to extend FAbstractSendable
///////////////////////////////////////////////////////
template <class BufferWriterClass>
void serializeUp(BufferWriterClass& buffer) const{
buffer.write(up->multipole_exp, VectorSize*NVALS*NRHS);
}
template <class BufferReaderClass>
void deserializeUp(BufferReaderClass& buffer){
buffer.fillArray(up->multipole_exp, VectorSize*NVALS*NRHS);
}
template <class BufferWriterClass>
void serializeDown(BufferWriterClass& buffer) const{
buffer.write(down->local_exp, VectorSize*NVALS*NLHS);
}
template <class BufferReaderClass>
void deserializeDown(BufferReaderClass& buffer){
buffer.fillArray(down->local_exp, VectorSize*NVALS*NLHS);
}
///////////////////////////////////////////////////////
// to extend Serializable
///////////////////////////////////////////////////////
template <class BufferWriterClass>
void save(BufferWriterClass& buffer) const{
buffer << symb->mortonIndex << symb->coordinates[0]
<< symb->coordinates[1] << symb->coordinates[2];
buffer.write(up->multipole_exp, VectorSize*NVALS*NRHS);
buffer.write(down->local_exp, VectorSize*NVALS*NLHS);
}
template <class BufferReaderClass>
void restore(BufferReaderClass& buffer){
buffer >> symb->mortonIndex >> symb->coordinates[0]
>> symb->coordinates[1] >> symb->coordinates[2];
buffer.fillArray(up->multipole_exp, VectorSize*NVALS*NRHS);
buffer.fillArray(down->local_exp, VectorSize*NVALS*NLHS);
}
int getSavedSize() const {
return int(sizeof(FReal) * VectorSize*(NRHS+NLHS)*NVALS + sizeof(symb->mortonIndex) + sizeof(symb->coordinates[0]) +
sizeof(symb->coordinates[1]) + sizeof(symb->coordinates[2]));
}
int getSavedSizeUp() const {
return int(sizeof(FReal)) * VectorSize*(NRHS)*NVALS;
}
int getSavedSizeDown() const {
return int(sizeof(FReal)) * VectorSize*(NLHS)*NVALS;
}
};
......
......@@ -109,59 +109,6 @@ public:
down->local_exp[idx].setRealImag(FReal(0.0), FReal(0.0));
}
}
///////////////////////////////////////////////////////
// to extend FAbstractSendable
///////////////////////////////////////////////////////
template <class BufferWriterClass>
void serializeUp(BufferWriterClass& buffer) const{
buffer.write(up->multipole_exp, up->MultipoleSize);
}
template <class BufferReaderClass>
void deserializeUp(BufferReaderClass& buffer){
buffer.fillArray(up->multipole_exp, up->MultipoleSize);
}
template <class BufferWriterClass>
void serializeDown(BufferWriterClass& buffer) const{
buffer.write(down->local_exp, down->LocalSize);
}
template <class BufferReaderClass>
void deserializeDown(BufferReaderClass& buffer){
buffer.fillArray(down->local_exp, down->LocalSize);
}
///////////////////////////////////////////////////////
// to extend Serializable
///////////////////////////////////////////////////////
template <class BufferWriterClass>
void save(BufferWriterClass& buffer) const{
buffer << symb->mortonIndex << symb->coordinates[0]
<< symb->coordinates[1] << symb->coordinates[2];
buffer.write(up->multipole_exp, up->MultipoleSize);
buffer.write(down->local_exp, down->LocalSize);
}
template <class BufferReaderClass>
void restore(BufferReaderClass& buffer){
buffer >> symb->mortonIndex >> symb->coordinates[0]
>> symb->coordinates[1] >> symb->coordinates[2];
buffer.fillArray(up->multipole_exp, up->MultipoleSize);
buffer.fillArray(down->local_exp, down->LocalSize);
}
int getSavedSize() const {
return int(sizeof(FComplex)*(up->MultipoleSize + down->LocalSize) + sizeof(symb->mortonIndex) + sizeof(symb->coordinates[0]) +
sizeof(symb->coordinates[1]) + sizeof(symb->coordinates[2]));
}
int getSavedSizeUp() const {
return ((int) sizeof(FComplex)) * (up->MultipoleSize);
}
int getSavedSizeDown() const {
return ((int) sizeof(FComplex)) * (down->LocalSize);
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment