int myProcId=_group.myRank();
for(std::size_t i=0;i<_matrixes_st.size();i++)
{
- if(_source_proc_id_st[i]==myProcId)// && _target_proc_id_st[i]!=myProcId
+ if(_source_proc_id_st[i]==myProcId && _matrixes_st[i].size())// && _target_proc_id_st[i]!=myProcId
{
count[_target_proc_id_st[i]]=(int)_matrixes_st[i].size()+1;
szz+=_matrixes_st[i].size()+1;
offsets[i]=offsets[i-1]+count[i-1];
for(std::size_t i=0;i<_matrixes_st.size();i++)
{
- if(_source_proc_id_st[i]==myProcId)
+ if(_source_proc_id_st[i]==myProcId && _matrixes_st[i].size())
{
mcIdType start=offsets[_target_proc_id_st[i]];
mcIdType *work=bigArr+start;
std::size_t fullLgth=0;
for(std::size_t i=0;i<_matrixes_st.size();i++)
{
- if(_source_proc_id_st[i]==myProcId)
+ if(_source_proc_id_st[i]==myProcId && _matrixes_st[i].size())
{
const std::vector< SparseDoubleVec >& mat=_matrixes_st[i];
mcIdType lgthToSend=0;
fullLgth=0;
for(std::size_t i=0;i<_matrixes_st.size();i++)
{
- if(_source_proc_id_st[i]==myProcId)
+ if(_source_proc_id_st[i]==myProcId && _matrixes_st[i].size())
{
const std::vector< SparseDoubleVec >& mat=_matrixes_st[i];
for(std::vector< SparseDoubleVec >::const_iterator it1=mat.begin();it1!=mat.end();it1++)
INTERP_KERNEL::AutoPtr<double> tmp=new double[nbOfCompo];
// By default field value set to default value - so mark which cells are hit
- INTERP_KERNEL::AutoPtr<bool> hit_cells = new bool[fieldOutput->getNumberOfTuples()];
+ mcIdType ntup = fieldOutput->getNumberOfTuples();
+ INTERP_KERNEL::AutoPtr<bool> hit_cells = new bool[ntup];
+ std::fill((bool *)hit_cells, (bool *)hit_cells+ntup, false);
for(vector<int>::const_iterator itProc=_the_matrix_st_source_proc_id.begin(); itProc != _the_matrix_st_source_proc_id.end();itProc++)
// For each source processor corresponding to a locally held matrix:
// Fill in default values for cells which haven't been hit:
int i = 0;
- for(bool * hit_cells_ptr=hit_cells; i< fieldOutput->getNumberOfTuples(); hit_cells_ptr++,i++)
+ for(bool * hit_cells_ptr=hit_cells; i< ntup; hit_cells_ptr++,i++)
if (!(*hit_cells_ptr))
{
double * targetPt=fieldOutput->getArray()->getPointer();