Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
kwant
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Joseph Weston
kwant
Commits
f994df79
Commit
f994df79
authored
12 years ago
by
Michael Wimmer
Committed by
Christoph Groth
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
more descriptive error messages for more common MUMPS errors; catch error -8 like error -9
parent
4e135ac7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kwant/linalg/mumps.py
+22
-7
22 additions, 7 deletions
kwant/linalg/mumps.py
with
22 additions
and
7 deletions
kwant/linalg/mumps.py
+
22
−
7
View file @
f994df79
...
...
@@ -57,11 +57,26 @@ def possible_orderings():
return
_possible_orderings
_error_messages
=
{
-
5
:
"
Not enough memory during analysis phase
"
,
-
6
:
"
Matrix is singular in structure
"
,
-
7
:
"
Not enough memory during analysis phase
"
,
-
10
:
"
Matrix is numerically singular
"
,
-
11
:
"
That
'
s an error the Mumps programmers would like to hear about
"
,
-
12
:
"
That
'
s an error the Mumps programmers would like to hear about
"
,
-
13
:
"
Not enough memory
"
}
class
MUMPSError
(
RuntimeError
):
def
__init__
(
self
,
error
):
self
.
error
=
error
RuntimeError
.
__init__
(
self
,
"
MUMPS failed with error
"
+
str
(
error
))
def
__init__
(
self
,
infog
):
self
.
error
=
infog
[
1
]
if
self
.
error
in
_error_messages
:
msg
=
_error_messages
[
self
.
error
]
+
\
"
(Mumps error
"
+
str
(
self
.
error
)
+
"
)
"
else
:
msg
=
"
MUMPS failed with error
"
+
str
(
self
.
error
)
RuntimeError
.
__init__
(
self
,
msg
)
class
AnalysisStatistics
(
object
):
...
...
@@ -224,7 +239,7 @@ class MUMPSContext(object):
self
.
factored
=
False
if
self
.
mumps_instance
.
infog
[
1
]
<
0
:
raise
MUMPSError
(
self
.
mumps_instance
.
infog
[
1
]
)
raise
MUMPSError
(
self
.
mumps_instance
.
infog
)
self
.
analysis_stats
=
AnalysisStatistics
(
self
.
mumps_instance
,
t2
-
t1
)
...
...
@@ -309,10 +324,10 @@ class MUMPSContext(object):
self
.
mumps_instance
.
call
()
t2
=
time
.
clock
()
# error -9 (not enough allocated memory) is treated
# error
-8,
-9 (not enough allocated memory) is treated
# specially, by increasing the memory relaxation parameter
if
self
.
mumps_instance
.
infog
[
1
]
<
0
:
if
self
.
mumps_instance
.
infog
[
1
]
==
-
9
:
if
self
.
mumps_instance
.
infog
[
1
]
in
(
-
8
,
-
9
)
:
# double the additional memory
self
.
mumps_instance
.
icntl
[
14
]
*=
2
else
:
...
...
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