#include <OverlapMapping.hxx>
Public Member Functions | |
| OverlapMapping (const ProcessorGroup &group) | |
| void | keepTracksOfSourceIds (int procId, DataArrayInt *ids) |
| void | keepTracksOfTargetIds (int procId, DataArrayInt *ids) |
| void | addContributionST (const std::vector< std::map< int, double > > &matrixST, const DataArrayInt *srcIds, int srcProcId, const DataArrayInt *trgIds, int trgProcId) |
| void | prepare (const std::vector< std::vector< int > > &procsInInteraction, int nbOfTrgElems) |
| void | computeDenoConservativeVolumic (int nbOfTuplesTrg) |
| void | computeDenoGlobConstraint () |
| void | multiply (const MEDCouplingFieldDouble *fieldInput, MEDCouplingFieldDouble *fieldOutput) const |
| void | transposeMultiply (const MEDCouplingFieldDouble *fieldInput, MEDCouplingFieldDouble *fieldOutput) |
Private Member Functions | |
| void | serializeMatrixStep0ST (const int *nbOfElemsSrc, int *&bigArr, int *count, int *offsets, int *countForRecv, int *offsetsForRecv) const |
| int | serializeMatrixStep1ST (const int *nbOfElemsSrc, const int *recvStep0, const int *countStep0, const int *offsStep0, int *&bigArrI, double *&bigArrD, int *count, int *offsets, int *countForRecv, int *offsForRecv) const |
| void | unserializationST (int nbOfTrgElems, const int *nbOfElemsSrcPerProc, const int *bigArrRecv, const int *bigArrRecvCounts, const int *bigArrRecvOffs, const int *bigArrRecv2, const double *bigArrDRecv2, const int *bigArrRecv2Count, const int *bigArrRecv2Offs) |
| void | finishToFillFinalMatrixST () |
| void | prepareIdsToSendST () |
| void | updateZipSourceIdsForFuture () |
Private Attributes | |
| const ProcessorGroup & | _group |
| std::vector < MEDCouplingAutoRefCountObjectPtr < DataArrayInt > > | _src_ids_st2 |
| vector of ids | |
| std::vector< int > | _src_proc_st2 |
| std::vector < MEDCouplingAutoRefCountObjectPtr < DataArrayInt > > | _trg_ids_st2 |
| std::vector< int > | _trg_proc_st2 |
| std::vector< int > | _nb_of_src_ids_proc_st2 |
| std::vector< int > | _src_ids_proc_st2 |
| std::vector< std::vector< int > > | _src_ids_zip_st2 |
| std::vector< int > | _src_ids_zip_proc_st2 |
| std::vector< std::vector < std::map< int, double > > > | _matrixes_st |
| vector of matrixes the first entry correspond to source proc id in _source_ids_st | |
| std::vector< std::vector< int > > | _source_ids_st |
| std::vector< int > | _source_proc_id_st |
| std::vector< std::vector< int > > | _target_ids_st |
| std::vector< int > | _target_proc_id_st |
| std::vector< std::vector < std::map< int, double > > > | _the_matrix_st |
| the matrix for matrix-vector product. The first dimension the set of target procs that interacts with local source mesh. The second dimension correspond to nb of local source ids. | |
| std::vector< int > | _the_matrix_st_source_proc_id |
| std::vector< std::vector< int > > | _the_matrix_st_source_ids |
| std::vector< std::vector < std::map< int, double > > > | _the_deno_st |
| std::vector< int > | _proc_ids_to_send_vector_st |
| this attribute stores the proc ids that wait for data from this proc ids for matrix-vector computation | |
| std::vector< int > | _proc_ids_to_recv_vector_st |
| std::vector< std::vector< int > > | _source_ids_to_send_st |
| this attribute is of size _group.size(); for each procId in _group _source_ids_to_send_st[procId] contains tupleId to send abroad | |
| OverlapMapping::OverlapMapping | ( | const ProcessorGroup & | group | ) |
| void OverlapMapping::keepTracksOfSourceIds | ( | int | procId, |
| DataArrayInt * | ids | ||
| ) |
This method keeps tracks of source ids to know in step 6 of main algorithm, which tuple ids to send away. This method incarnates item#1 of step2 algorithm.
References ParaMEDMEM.OverlapMapping._src_ids_st2, ParaMEDMEM.OverlapMapping._src_proc_st2, and ParaMEDMEM.RefCountObject.incrRef().
| void OverlapMapping::keepTracksOfTargetIds | ( | int | procId, |
| DataArrayInt * | ids | ||
| ) |
This method keeps tracks of target ids to know in step 6 of main algorithm. This method incarnates item#0 of step2 algorithm.
References ParaMEDMEM.OverlapMapping._trg_ids_st2, ParaMEDMEM.OverlapMapping._trg_proc_st2, and ParaMEDMEM.RefCountObject.incrRef().
| void OverlapMapping::addContributionST | ( | const std::vector< std::map< int, double > > & | matrixST, |
| const DataArrayInt * | srcIds, | ||
| int | srcProcId, | ||
| const DataArrayInt * | trgIds, | ||
| int | trgProcId | ||
| ) |
This method stores from a matrix in format Target(rows)/Source(cols) for a source procId 'srcProcId' and for a target procId 'trgProcId'. All ids (source and target) are in format of local ids.
References ParaMEDMEM.OverlapMapping._matrixes_st, ParaMEDMEM.OverlapMapping._nb_of_src_ids_proc_st2, ParaMEDMEM.OverlapMapping._source_proc_id_st, ParaMEDMEM.OverlapMapping._src_ids_proc_st2, ParaMEDMEM.OverlapMapping._src_ids_zip_proc_st2, ParaMEDMEM.OverlapMapping._src_ids_zip_st2, ParaMEDMEM.OverlapMapping._target_proc_id_st, ParaMEDMEM.DataArray.getNumberOfTuples(), and TestMedCorba7.s.
| void OverlapMapping::prepare | ( | const std::vector< std::vector< int > > & | procsInInteraction, |
| int | nbOfTrgElems | ||
| ) |
'procsInInteraction' gives the global view of interaction between procs. In 'procsInInteraction' for a proc with id i, is in interaction with procs listed in procsInInteraction[i].
This method is in charge to send matrixes in AlltoAll mode. After the call of this method 'this' contains the matrixST for all source elements of the current proc
References ParaMEDMEM.OverlapMapping._group, ParaMEDMEM.OverlapMapping._matrixes_st, ParaMEDMEM.OverlapMapping._proc_ids_to_recv_vector_st, ParaMEDMEM.OverlapMapping._proc_ids_to_send_vector_st, ParaMEDMEM.OverlapMapping._source_proc_id_st, ParaMEDMEM.OverlapMapping._target_proc_id_st, ParaMEDMEM.CommInterface.allToAll(), ParaMEDMEM.CommInterface.allToAllV(), ParaMEDMEM.OverlapMapping.finishToFillFinalMatrixST(), ParaMEDMEM.MPIProcessorGroup.getComm(), ParaMEDMEM.ProcessorGroup.getCommInterface(), med_test1.group, ParaMEDMEM.ProcessorGroup.myRank(), ParaMEDMEM.OverlapMapping.serializeMatrixStep0ST(), ParaMEDMEM.OverlapMapping.serializeMatrixStep1ST(), ParaMEDMEM.ProcessorGroup.size(), ParaMEDMEM.OverlapMapping.unserializationST(), and ParaMEDMEM.OverlapMapping.updateZipSourceIdsForFuture().
| void OverlapMapping::computeDenoConservativeVolumic | ( | int | nbOfTuplesTrg | ) |
Compute denominators.
References ParaMEDMEM.OverlapMapping._group, ParaMEDMEM.OverlapMapping._the_deno_st, ParaMEDMEM.OverlapMapping._the_matrix_st, ParaMEDMEM.OverlapMapping._the_matrix_st_source_proc_id, ParaMEDMEM.OverlapMapping._trg_ids_st2, ParaMEDMEM.OverlapMapping._trg_proc_st2, ParaMEDMEM.ProcessorGroup.getCommInterface(), and ParaMEDMEM.ProcessorGroup.myRank().
| void OverlapMapping::computeDenoGlobConstraint | ( | ) |
Compute denominators.
References ParaMEDMEM.OverlapMapping._the_deno_st, ParaMEDMEM.OverlapMapping._the_matrix_st, Med_Gen_test.it, and TestMedCorba2.m.
| void OverlapMapping::multiply | ( | const MEDCouplingFieldDouble * | fieldInput, |
| MEDCouplingFieldDouble * | fieldOutput | ||
| ) | const |
This method performs a transpose multiply of 'fieldInput' and put the result into 'fieldOutput'. 'fieldInput' is expected to be the sourcefield and 'fieldOutput' the targetfield.
References ParaMEDMEM.OverlapMapping._group, ParaMEDMEM.OverlapMapping._nb_of_src_ids_proc_st2, ParaMEDMEM.OverlapMapping._proc_ids_to_recv_vector_st, ParaMEDMEM.OverlapMapping._proc_ids_to_send_vector_st, ParaMEDMEM.OverlapMapping._src_ids_proc_st2, ParaMEDMEM.OverlapMapping._src_ids_st2, ParaMEDMEM.OverlapMapping._src_ids_zip_proc_st2, ParaMEDMEM.OverlapMapping._src_ids_zip_st2, ParaMEDMEM.OverlapMapping._src_proc_st2, ParaMEDMEM.OverlapMapping._the_deno_st, ParaMEDMEM.OverlapMapping._the_matrix_st, ParaMEDMEM.OverlapMapping._the_matrix_st_source_proc_id, ParaMEDMEM.OverlapMapping._trg_ids_st2, ParaMEDMEM.OverlapMapping._trg_proc_st2, ParaMEDMEM.CommInterface.allToAllV(), ParaMEDMEM.DataArrayDouble.fillWithZero(), ParaMEDMEM.MEDCouplingFieldDouble.getArray(), ParaMEDMEM.MPIProcessorGroup.getComm(), ParaMEDMEM.ProcessorGroup.getCommInterface(), ParaMEDMEM.DataArrayInt.getConstPointer(), ParaMEDMEM.DataArray.getNbOfElems(), ParaMEDMEM.MEDCouplingFieldDouble.getNumberOfComponents(), ParaMEDMEM.MEDCouplingField.getNumberOfTuplesExpected(), ParaMEDMEM.DataArrayDouble.getPointer(), med_test1.group, testRenumbering.id, testDriverAscii.id2, Med_Gen_test.it, ParaMEDMEM.ProcessorGroup.myRank(), ParaMEDMEM.DataArrayDouble.selectByTupleId(), test_NonCoincidentDEC.size, and ParaMEDMEM.ProcessorGroup.size().
| void OverlapMapping::transposeMultiply | ( | const MEDCouplingFieldDouble * | fieldInput, |
| MEDCouplingFieldDouble * | fieldOutput | ||
| ) |
This method performs a transpose multiply of 'fieldInput' and put the result into 'fieldOutput'. 'fieldInput' is expected to be the targetfield and 'fieldOutput' the sourcefield.
| void OverlapMapping::serializeMatrixStep0ST | ( | const int * | nbOfElemsSrc, |
| int *& | bigArr, | ||
| int * | count, | ||
| int * | offsets, | ||
| int * | countForRecv, | ||
| int * | offsetsForRecv | ||
| ) | const [private] |
This method performs step #0/3 in serialization process.
| count | tells specifies nb of elems to send to corresponding proc id. size equal to _group.size(). |
| offsets | tells for a proc i where to start serialize#0 matrix. size equal to _group.size(). |
| nbOfElemsSrc | of size _group.size(). Comes from previous all2all call. tells how many srcIds per proc contains matrix for current proc. |
References ParaMEDMEM.OverlapMapping._group, ParaMEDMEM.OverlapMapping._matrixes_st, ParaMEDMEM.OverlapMapping._source_proc_id_st, ParaMEDMEM.OverlapMapping._target_proc_id_st, Med_Gen_test.it, ParaMEDMEM.ProcessorGroup.myRank(), and ParaMEDMEM.ProcessorGroup.size().
| int OverlapMapping::serializeMatrixStep1ST | ( | const int * | nbOfElemsSrc, |
| const int * | recvStep0, | ||
| const int * | countStep0, | ||
| const int * | offsStep0, | ||
| int *& | bigArrI, | ||
| double *& | bigArrD, | ||
| int * | count, | ||
| int * | offsets, | ||
| int * | countForRecv, | ||
| int * | offsForRecv | ||
| ) | const [private] |
This method performs step#1 and step#2/3. It returns the size of expected array to get allToAllV.
References ParaMEDMEM.OverlapMapping._group, ParaMEDMEM.OverlapMapping._matrixes_st, ParaMEDMEM.OverlapMapping._source_proc_id_st, ParaMEDMEM.OverlapMapping._target_proc_id_st, MEDMEM.fill(), Med_Gen_test.it, ParaMEDMEM.ProcessorGroup.myRank(), and ParaMEDMEM.ProcessorGroup.size().
| void OverlapMapping::unserializationST | ( | int | nbOfTrgElems, |
| const int * | nbOfElemsSrcPerProc, | ||
| const int * | bigArrRecv, | ||
| const int * | bigArrRecvCounts, | ||
| const int * | bigArrRecvOffs, | ||
| const int * | bigArrRecv2, | ||
| const double * | bigArrDRecv2, | ||
| const int * | bigArrRecv2Count, | ||
| const int * | bigArrRecv2Offs | ||
| ) | [private] |
This is the last step after all2Alls for matrix exchange. _the_matrix_st is the final matrix :
References ParaMEDMEM.OverlapMapping._group, ParaMEDMEM.OverlapMapping._the_matrix_st, ParaMEDMEM.OverlapMapping._the_matrix_st_source_proc_id, and ParaMEDMEM.ProcessorGroup.size().
| void OverlapMapping::finishToFillFinalMatrixST | ( | ) | [private] |
This method should be called when all remote matrix with sourceProcId==thisProcId have been retrieved and are in 'this->_the_matrix_st' and 'this->_the_matrix_st_target_proc_id' and 'this->_the_matrix_st_target_ids'. This method finish the job of filling 'this->_the_matrix_st' and 'this->_the_matrix_st_target_proc_id' by putting candidates in 'this->_matrixes_st' into them.
References ParaMEDMEM.OverlapMapping._group, ParaMEDMEM.OverlapMapping._matrixes_st, ParaMEDMEM.OverlapMapping._source_proc_id_st, ParaMEDMEM.OverlapMapping._the_matrix_st, ParaMEDMEM.OverlapMapping._the_matrix_st_source_proc_id, and ParaMEDMEM.ProcessorGroup.myRank().
| void OverlapMapping::prepareIdsToSendST | ( | ) | [private] |
This method performs the operation of target ids broadcasting.
References ParaMEDMEM.OverlapMapping._group, ParaMEDMEM.OverlapMapping._source_ids_to_send_st, ParaMEDMEM.OverlapMapping._the_matrix_st_source_ids, ParaMEDMEM.OverlapMapping._the_matrix_st_source_proc_id, ParaMEDMEM.CommInterface.allToAll(), ParaMEDMEM.CommInterface.allToAllV(), med_test1.begin, med_test1.end, ParaMEDMEM.MPIProcessorGroup.getComm(), ParaMEDMEM.ProcessorGroup.getCommInterface(), med_test1.group, test_NonCoincidentDEC.size, and ParaMEDMEM.ProcessorGroup.size().
| void OverlapMapping::updateZipSourceIdsForFuture | ( | ) | [private] |
This method should be called immediately after _the_matrix_st has been filled with remote computed matrix put in this proc for Matrix-Vector. This method computes for these matrix the minimal set of source ids corresponding to the source proc id.
References ParaMEDMEM.OverlapMapping._group, ParaMEDMEM.OverlapMapping._src_ids_zip_proc_st2, ParaMEDMEM.OverlapMapping._src_ids_zip_st2, ParaMEDMEM.OverlapMapping._the_matrix_st, ParaMEDMEM.OverlapMapping._the_matrix_st_source_proc_id, ParaMEDMEM.ProcessorGroup.getCommInterface(), ParaMEDMEM.ProcessorGroup.myRank(), and TestMedCorba7.s.
const ProcessorGroup& ParaMEDMEM.OverlapMapping._group [private] |
std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > ParaMEDMEM.OverlapMapping._src_ids_st2 [private] |
vector of ids
std::vector< int > ParaMEDMEM.OverlapMapping._src_proc_st2 [private] |
std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > ParaMEDMEM.OverlapMapping._trg_ids_st2 [private] |
std::vector< int > ParaMEDMEM.OverlapMapping._trg_proc_st2 [private] |
std::vector< int > ParaMEDMEM.OverlapMapping._nb_of_src_ids_proc_st2 [private] |
std::vector< int > ParaMEDMEM.OverlapMapping._src_ids_proc_st2 [private] |
std::vector< std::vector<int> > ParaMEDMEM.OverlapMapping._src_ids_zip_st2 [private] |
std::vector< int > ParaMEDMEM.OverlapMapping._src_ids_zip_proc_st2 [private] |
std::vector< std::vector< std::map<int,double> > > ParaMEDMEM.OverlapMapping._matrixes_st [private] |
vector of matrixes the first entry correspond to source proc id in _source_ids_st
std::vector< std::vector<int> > ParaMEDMEM.OverlapMapping._source_ids_st [private] |
std::vector< int > ParaMEDMEM.OverlapMapping._source_proc_id_st [private] |
std::vector< std::vector<int> > ParaMEDMEM.OverlapMapping._target_ids_st [private] |
std::vector< int > ParaMEDMEM.OverlapMapping._target_proc_id_st [private] |
std::vector< std::vector< std::map<int,double> > > ParaMEDMEM.OverlapMapping._the_matrix_st [private] |
the matrix for matrix-vector product. The first dimension the set of target procs that interacts with local source mesh. The second dimension correspond to nb of local source ids.
std::vector< int > ParaMEDMEM.OverlapMapping._the_matrix_st_source_proc_id [private] |
std::vector< std::vector<int> > ParaMEDMEM.OverlapMapping._the_matrix_st_source_ids [private] |
std::vector< std::vector< std::map<int,double> > > ParaMEDMEM.OverlapMapping._the_deno_st [private] |
std::vector< int > ParaMEDMEM.OverlapMapping._proc_ids_to_send_vector_st [private] |
this attribute stores the proc ids that wait for data from this proc ids for matrix-vector computation
std::vector< int > ParaMEDMEM.OverlapMapping._proc_ids_to_recv_vector_st [private] |
std::vector< std::vector<int> > ParaMEDMEM.OverlapMapping._source_ids_to_send_st [private] |
this attribute is of size _group.size(); for each procId in _group _source_ids_to_send_st[procId] contains tupleId to send abroad