Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
sensei
sensei
Commits
702964dc
Commit
702964dc
authored
Sep 05, 2018
by
Burlen Loring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better mpi error handler
parent
eb41995b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
utils/timer/Timer.cxx
utils/timer/Timer.cxx
+19
-10
No files found.
utils/timer/Timer.cxx
View file @
702964dc
...
...
@@ -26,11 +26,19 @@ void MPIErrorHandler(MPI_Comm *comm, int *code, ...)
int
rank
=
0
;
MPI_Comm_rank
(
*
comm
,
&
rank
);
int
estrLen
=
0
;
char
estr
[
MPI_MAX_ERROR_STRING
]
=
{
'\0'
};
MPI_Error_string
(
*
code
,
estr
,
&
estrLen
);
std
::
ostringstream
oss
;
oss
<<
"rank "
<<
rank
<<
" encountered MPI error "
<<
*
code
<<
std
::
endl
<<
"========================================================="
<<
std
::
endl
<<
vtksys
::
SystemInformation
::
GetProgramStack
(
1
,
0
)
<<
"========================================================="
<<
std
::
endl
;
oss
<<
"+--------------------------------------------------------+"
<<
std
::
endl
<<
"MPI rank "
<<
rank
<<
" encountered error "
<<
*
code
<<
std
::
endl
<<
std
::
endl
<<
estr
<<
std
::
endl
<<
std
::
endl
<<
vtksys
::
SystemInformation
::
GetProgramStack
(
3
,
0
)
<<
"+--------------------------------------------------------+"
<<
std
::
endl
;
std
::
cerr
<<
oss
.
str
()
<<
std
::
endl
;
...
...
@@ -314,6 +322,11 @@ void SetCommunicator(MPI_Comm comm)
if
(
impl
::
Comm
!=
MPI_COMM_NULL
)
MPI_Comm_free
(
&
impl
::
Comm
);
// install an error handler
MPI_Errhandler
meh
;
MPI_Comm_create_errhandler
(
MPIErrorHandler
,
&
meh
);
MPI_Comm_set_errhandler
(
comm
,
meh
);
MPI_Comm_dup
(
comm
,
&
impl
::
Comm
);
}
...
...
@@ -346,7 +359,7 @@ void Initialize()
{
// always use isolated comm space
if
(
impl
::
Comm
==
MPI_COMM_NULL
)
MPI_Comm_dup
(
MPI_COMM_WORLD
,
&
impl
::
Comm
);
timer
::
SetCommunicator
(
MPI_COMM_WORLD
);
impl
::
MemProf
.
SetCommunicator
(
impl
::
Comm
);
...
...
@@ -389,13 +402,9 @@ void Initialize()
impl
::
MemProf
.
Initialize
();
}
// enable diagnostic info about crashes
and MPI errors
// enable diagnostic info about crashes
vtksys
::
SystemInformation
::
SetStackTraceOnError
(
1
);
MPI_Errhandler
meh
;
MPI_Comm_create_errhandler
(
MPIErrorHandler
,
&
meh
);
MPI_Comm_set_errhandler
(
impl
::
Comm
,
meh
);
// report what options are in use
int
rank
=
0
;
MPI_Comm_rank
(
impl
::
Comm
,
&
rank
);
...
...
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