_ska.checkNotNull();
_global_ids.checkNotNull();
if(_ska->getNumberOf() != _global_ids->getNumberOfTuples())
- throw INTERP_KERNEL::Exception("ParaSkyLineArray constructor : mismatch between # globalIds and len of indices in SkyLineArray.");
+ {
+ std::ostringstream oss; oss << "ParaSkyLineArray constructor : mismatch between # globalIds (" << _global_ids->getNumberOfTuples() << ") and len of indices in SkyLineArray (" << _ska->getNumberOf() << ").";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
}
std::size_t ParaSkyLineArray::getHeapMemorySizeWithoutChildren() const
{
mcIdType curStart(0),curEnd(0);
DataArrayIdType::GetSlice(0,nbOfEntities,1,curRk,size,curStart,curEnd);
- idsCaptured[curRk] = _global_ids->findIdsInRange(curStart,curEnd);
+ MCAuto<DataArrayIdType> idsInGlobalIds(_global_ids->findIdsInRange(curStart,curEnd));
+ idsCaptured[curRk] = _global_ids->selectByTupleIdSafe(idsInGlobalIds->begin(),idsInGlobalIds->end());
{
DataArrayIdType *tmpValues(nullptr),*tmpIndex(nullptr);
- DataArrayIdType::ExtractFromIndexedArrays(idsCaptured[curRk]->begin(),idsCaptured[curRk]->end(),this->_ska->getValuesArray(),this->_ska->getIndexArray(),tmpValues,tmpIndex);
+ DataArrayIdType::ExtractFromIndexedArrays(idsInGlobalIds->begin(),idsInGlobalIds->end(),this->_ska->getValuesArray(),this->_ska->getIndexArray(),tmpValues,tmpIndex);
+ MCAuto<DataArrayIdType> tmpValues2(tmpValues),tmpIndex2(tmpIndex);
skToBeSent[curRk] = MEDCouplingSkyLineArray::New(tmpIndex,tmpValues);
}
}
values = DataArrayIdType::Aggregate(FromVecAutoToVecOfConst<DataArrayIdType>(myRkSkValues));
}
// Reorder results coming from other procs
- MCAuto<DataArrayIdType> aggregatedIdsSort(aggregatedIds->deepCopy()); aggregatedIds->sort();
+ MCAuto<DataArrayIdType> aggregatedIdsSort(aggregatedIds->deepCopy()); aggregatedIdsSort->sort();
MCAuto<DataArrayIdType> idsIntoAggregatedIds(DataArrayIdType::FindPermutationFromFirstToSecondDuplicate(aggregatedIdsSort,aggregatedIds));
MCAuto<DataArrayIdType> indicesSorted,valuesSorted;
{
}
MCAuto<DataArrayIdType> idxOfSameIds(aggregatedIdsSort->indexOfSameConsecutiveValueGroups());
//
- MCAuto<DataArrayIdType> globalIdsOut(aggregatedIds->buildUnique());
+ MCAuto<DataArrayIdType> globalIdsOut(aggregatedIdsSort->buildUnique());
MCAuto<MEDCouplingSkyLineArray> skOut(MEDCouplingSkyLineArray::New(valuesSorted,indicesSorted));
skOut = skOut->groupPacks(idxOfSameIds);
MCAuto<ParaSkyLineArray> ret(ParaSkyLineArray::New(skOut,globalIdsOut));
class ParaSkyLineArray : public RefCountObject
{
public:
- ParaSkyLineArray(MEDCouplingSkyLineArray *ska, DataArrayIdType *globalIds);
+ static ParaSkyLineArray *New(MEDCouplingSkyLineArray *ska, DataArrayIdType *globalIds);
%extend
{
+ ParaSkyLineArray(MEDCouplingSkyLineArray *ska, DataArrayIdType *globalIds)
+ {
+ return ParaSkyLineArray::New(ska,globalIds);
+ }
+
ParaSkyLineArray *equiRedistribute(mcIdType nbOfEntities) const
{
MCAuto<ParaSkyLineArray> ret(self->equiRedistribute(nbOfEntities));