Changeset 18254


Ignore:
Timestamp:
07/17/14 08:17:58 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: added check on allocation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp

    r18063 r18254  
    4242        MatSetSizes(this->matrix,m,n,M,N);
    4343        MatSetFromOptions(this->matrix);
    44         MatMPIAIJSetPreallocation(this->matrix,0,d_nnz,0,o_nnz);
     44        PetscErrorCode ierr = MatMPIAIJSetPreallocation(this->matrix,0,d_nnz,0,o_nnz);
     45        if(ierr) _error_("PETSc could not allocate matrix (probably not enough memory)");
    4546//      MatSetOption(this->matrix,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_FALSE);
    4647
     
    160161void PetscMat::SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){/*{{{*/
    161162
    162         PetscErrorCode ierr;
    163         ierr = MatSetValues(this->matrix,m,idxm,n,idxn,values,ISSMToPetscInsertMode(mode));
    164         if(ierr) _error_("PETSC's MatSetValues reported an error");
     163        PetscErrorCode ierr = MatSetValues(this->matrix,m,idxm,n,idxn,values,ISSMToPetscInsertMode(mode));
     164        if(ierr) _error_("PETSc's MatSetValues reported an error");
    165165
    166166}
Note: See TracChangeset for help on using the changeset viewer.