Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
4cd3f512
Commit
4cd3f512
authored
Jul 25, 2012
by
Thomas Jahns
🤸
Browse files
Clarify error-handling by decreasing redundant symbols.
parent
56a045a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/pio_util.c
View file @
4cd3f512
...
...
@@ -112,25 +112,24 @@ void * pcdiXrealloc ( void *p, size_t size, const char *functionname,
#ifdef USE_MPI
void
pcdiXMPI
(
int
iret
,
const
char
*
filename
,
int
line
)
{
char
errorString1
[
MPI_MAX_ERROR_STRING
+
1
];
char
errorString2
[
MPI_MAX_ERROR_STRING
+
1
];
char
errorString
[
2
][
MPI_MAX_ERROR_STRING
+
1
];
int
len
,
errorClass
,
rank
;
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
rank
);
if
(
iret
!=
MPI_SUCCESS
)
{
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
rank
);
MPI_Error_class
(
iret
,
&
errorClass
);
MPI_Error_string
(
errorClass
,
errorString
1
,
&
len
);
errorString
1
[
len
]
=
'\0'
;
MPI_Error_string
(
iret
,
errorString
2
,
&
len
);
errorString
2
[
len
]
=
'\0'
;
MPI_Error_string
(
errorClass
,
errorString
[
0
]
,
&
len
);
errorString
[
0
]
[
len
]
=
'\0'
;
MPI_Error_string
(
iret
,
errorString
[
1
]
,
&
len
);
errorString
[
1
]
[
len
]
=
'\0'
;
fprintf
(
stderr
,
"MPI ERROR, pe%d, %s, line %d,"
"errorClass:
\"
%s
\"
"
"errorString:
\"
%s
\"\n
"
,
rank
,
filename
,
line
,
errorString
1
,
errorString
2
);
errorString
[
0
]
,
errorString
[
1
]
);
MPI_Abort
(
MPI_COMM_WORLD
,
iret
);
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment