Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
spm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
spm
Commits
9456e729
Commit
9456e729
authored
4 years ago
by
Mathieu Faverge
Browse files
Options
Downloads
Patches
Plain Diff
Fix coverity warning
parent
66bf31b9
No related branches found
No related tags found
1 merge request
!53
Fix corner cases in distributed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/example_drivers.c
+4
-1
4 additions, 1 deletion
examples/example_drivers.c
src/spm_scatter.c
+12
-2
12 additions, 2 deletions
src/spm_scatter.c
with
16 additions
and
3 deletions
examples/example_drivers.c
+
4
−
1
View file @
9456e729
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/spm_scatter.c
+
12
−
2
View file @
9456e729
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment