Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dune-fem
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
20
Issues
20
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dune-fem
dune-fem
Commits
e1a28e1f
Commit
e1a28e1f
authored
Jan 11, 2019
by
Robert K
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[bugfix][Petsc] Guard operations to matrix with omp critical. Petsc
cannot handle this internally.
parent
70a4f189
Pipeline
#15795
passed with stage
in 42 minutes and 58 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
6 deletions
+56
-6
petsccommon.hh
dune/fem/misc/petsc/petsccommon.hh
+50
-5
petscoperator.hh
dune/fem/operator/linear/petscoperator.hh
+6
-1
No files found.
dune/fem/misc/petsc/petsccommon.hh
View file @
e1a28e1f
...
...
@@ -260,16 +260,61 @@ namespace Dune
inline
static
void
MatSetSizes
(
Mat
A
,
PetscInt
m
,
PetscInt
n
,
PetscInt
M
,
PetscInt
N
)
{
ErrorCheck
(
::
MatSetSizes
(
A
,
m
,
n
,
M
,
N
)
);
}
inline
static
void
MatSetFromOptions
(
Mat
B
)
{
ErrorCheck
(
::
MatSetFromOptions
(
B
)
);
}
inline
static
void
MatSetType
(
Mat
mat
,
const
MatType
matype
)
{
ErrorCheck
(
::
MatSetType
(
mat
,
matype
)
);
}
inline
static
void
MatSetValue
(
Mat
v
,
PetscInt
i
,
PetscInt
j
,
PetscScalar
va
,
InsertMode
mode
)
{
ErrorCheck
(
::
MatSetValue
(
v
,
i
,
j
,
va
,
mode
)
);
}
inline
static
void
MatSetValue
(
Mat
v
,
PetscInt
i
,
PetscInt
j
,
PetscScalar
va
,
InsertMode
mode
)
{
#ifdef _OPENMP
#pragma omp critical
#endif
{
ErrorCheck
(
::
MatSetValue
(
v
,
i
,
j
,
va
,
mode
)
);
}
}
inline
static
void
MatSetValues
(
Mat
mat
,
PetscInt
m
,
const
PetscInt
idxm
[],
PetscInt
n
,
const
PetscInt
idxn
[],
const
PetscScalar
v
[],
InsertMode
addv
)
{
ErrorCheck
(
::
MatSetValues
(
mat
,
m
,
idxm
,
n
,
idxn
,
v
,
addv
)
);
}
{
#ifdef _OPENMP
#pragma omp critical
#endif
{
ErrorCheck
(
::
MatSetValues
(
mat
,
m
,
idxm
,
n
,
idxn
,
v
,
addv
)
);
}
}
inline
static
void
MatSetValuesBlocked
(
Mat
mat
,
PetscInt
m
,
const
PetscInt
idxm
[],
PetscInt
n
,
const
PetscInt
idxn
[],
const
PetscScalar
v
[],
InsertMode
addv
)
{
ErrorCheck
(
::
MatSetValuesBlocked
(
mat
,
m
,
idxm
,
n
,
idxn
,
v
,
addv
)
);
}
{
#ifdef _OPENMP
#pragma omp critical
#endif
{
ErrorCheck
(
::
MatSetValuesBlocked
(
mat
,
m
,
idxm
,
n
,
idxn
,
v
,
addv
)
);
}
}
inline
static
void
MatGetValues
(
Mat
mat
,
PetscInt
m
,
const
PetscInt
idxm
[],
PetscInt
n
,
const
PetscInt
idxn
[],
PetscScalar
v
[]
)
{
ErrorCheck
(
::
MatGetValues
(
mat
,
m
,
idxm
,
n
,
idxn
,
v
)
);
}
inline
static
void
MatZeroRows
(
Mat
mat
,
PetscInt
m
,
const
PetscInt
idxm
[],
const
PetscScalar
v
)
{
ErrorCheck
(
::
MatZeroRows
(
mat
,
m
,
idxm
,
v
,
0
,
0
)
);
}
inline
static
void
MatZeroRows
(
Mat
mat
,
PetscInt
m
,
const
PetscInt
idxm
[],
const
PetscScalar
v
)
{
#ifdef _OPENMP
#pragma omp critical
#endif
{
ErrorCheck
(
::
MatZeroRows
(
mat
,
m
,
idxm
,
v
,
0
,
0
)
);
}
}
inline
static
void
MatView
(
Mat
mat
,
PetscViewer
viewer
)
{
ErrorCheck
(
::
MatView
(
mat
,
viewer
)
);
}
inline
static
void
MatZeroEntries
(
Mat
mat
)
{
ErrorCheck
(
::
MatZeroEntries
(
mat
)
);
}
inline
static
void
MatZeroEntries
(
Mat
mat
)
{
#ifdef _OPENMP
#pragma omp critical
#endif
{
ErrorCheck
(
::
MatZeroEntries
(
mat
)
);
}
}
inline
static
void
PetscBarrier
(
PetscObject
obj
)
{
ErrorCheck
(
::
PetscBarrier
(
obj
)
);
}
inline
static
void
PetscFinalize
()
{
ErrorCheck
(
::
PetscFinalize
()
);
}
inline
static
void
PetscInitialize
(
int
*
argc
,
char
***
args
,
const
char
file
[],
const
char
help
[]
)
{
ErrorCheck
(
::
PetscInitialize
(
argc
,
args
,
file
,
help
)
);
}
...
...
dune/fem/operator/linear/petscoperator.hh
View file @
e1a28e1f
...
...
@@ -558,7 +558,12 @@ namespace Dune
void
setStatus
(
const
Status
&
newstatus
)
const
{
status_
=
newstatus
;
#ifdef _OPENMP
#pragma omp critical
#endif
{
status_
=
newstatus
;
}
}
template
<
class
DFS
,
class
Entity
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment