Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 9456e729 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Fix coverity warning

parent 66bf31b9
No related branches found
No related tags found
1 merge request!53Fix corner cases in distributed
......@@ -38,7 +38,10 @@ int main( int argc, char **argv )
/*
* Generate a sparse matrix using one of the many drivers.
*/
spmReadDriver( SpmDriverLaplacian, "10:10:10:2", &spm );
rc = spmReadDriver( SpmDriverLaplacian, "10:10:10:2", &spm );
if ( rc != SPM_SUCCESS ) {
return 0;
}
/*
* Just for this example. If the driver do not provide values, let's create
......
......@@ -154,11 +154,21 @@ spm_scatter_csx_get_locals( const spmatrix_t *oldspm,
spm_int_t dofj;
const spm_int_t *oldcol;
const spm_int_t *oldrow;
const spm_int_t *glob2loc = spm_get_glob2loc( newspm );
const spm_int_t *glob2loc;
const spm_int_t *dofs;
spm_int_t baseval = newspm->baseval;
/* Shift the pointer to avoid extra baseval computations */
/*
* Make sure the gN field is set before calling glob2loc to avoid possible
* issue with spmUpdateComputedFields()
*/
assert( newspm->gN > 0 );
/*
* Initialize glob2loc collaborately before non involved processes return from the function.
* The pointer is shifted to avoid extra baseval computations
*/
glob2loc = spm_get_glob2loc( newspm );
glob2loc -= baseval;
if ( !allcounts ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment