Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
swiftmpistepsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
SWIFT
swiftmpistepsim
Commits
1d66318b
Commit
1d66318b
authored
5 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Tidy up flushing, we want to see the messages in a test
parent
9d06ea90
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exchange-test.c
+5
-7
5 additions, 7 deletions
exchange-test.c
with
5 additions
and
7 deletions
exchange-test.c
+
5
−
7
View file @
1d66318b
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
fprintf(stderr, "[%03i] %s:%s():%i: " s "\n", myrank, \
fprintf(stderr, "[%03i] %s:%s():%i: " s "\n", myrank, \
__FILE__, __FUNCTION__, __LINE__, \
__FILE__, __FUNCTION__, __LINE__, \
##__VA_ARGS__); \
##__VA_ARGS__); \
fflush(stderr); \
MPI_Abort(MPI_COMM_WORLD, -1); \
MPI_Abort(MPI_COMM_WORLD, -1); \
})
})
...
@@ -38,18 +39,20 @@
...
@@ -38,18 +39,20 @@
({ \
({ \
fprintf(stdout, "[%04i] %s: " s "\n", myrank, \
fprintf(stdout, "[%04i] %s: " s "\n", myrank, \
__FUNCTION__, ##__VA_ARGS__); \
__FUNCTION__, ##__VA_ARGS__); \
fflush(stdout); \
})
})
/* Print MPI error as a string. */
/* Print MPI error as a string. */
#define mpi_error_string(res, s, ...) \
#define mpi_error_string(res, s, ...) \
({ \
({ \
fprintf(std
err
, "[%03i] %s:%s():%i: " s "\n", myrank, \
fprintf(std
out
, "[%03i] %s:%s():%i: " s "\n", myrank, \
__FILE__, __FUNCTION__, __LINE__, \
__FILE__, __FUNCTION__, __LINE__, \
##__VA_ARGS__); \
##__VA_ARGS__); \
int len = 1024; \
int len = 1024; \
char buf[len]; \
char buf[len]; \
MPI_Error_string(res, buf, &len); \
MPI_Error_string(res, buf, &len); \
fprintf(stdout, "%s\n\n", buf); \
fprintf(stdout, "%s\n\n", buf); \
fflush(stdout); \
})
})
...
@@ -98,10 +101,7 @@ static int datacheck_test(unsigned char fill, size_t size, void *data) {
...
@@ -98,10 +101,7 @@ static int datacheck_test(unsigned char fill, size_t size, void *data) {
unsigned
char
*
p
=
(
unsigned
char
*
)
data
;
unsigned
char
*
p
=
(
unsigned
char
*
)
data
;
for
(
size_t
i
=
0
;
i
<
size
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
size
;
i
++
)
{
if
(
p
[
i
]
!=
fill
)
{
if
(
p
[
i
]
!=
fill
)
{
if
(
verbose
)
{
if
(
verbose
)
message
(
"%d != %d"
,
p
[
i
],
fill
);
message
(
"%d != %d"
,
p
[
i
],
fill
);
fflush
(
stdout
);
}
return
0
;
return
0
;
}
}
}
}
...
@@ -304,11 +304,9 @@ int main(int argc, char *argv[]) {
...
@@ -304,11 +304,9 @@ int main(int argc, char *argv[]) {
* updated. */
* updated. */
if
(
datacheck_test
(
myrank
,
recv_datasizes
[
pid
],
recv_datavalues
[
pid
]))
{
if
(
datacheck_test
(
myrank
,
recv_datasizes
[
pid
],
recv_datavalues
[
pid
]))
{
message
(
"Received data buffer has not been modified"
);
message
(
"Received data buffer has not been modified"
);
fflush
(
stdout
);
error
(
"Failed"
);
error
(
"Failed"
);
}
else
{
}
else
{
message
(
"Received data is corrupt"
);
message
(
"Received data is corrupt"
);
fflush
(
stdout
);
error
(
"Failed"
);
error
(
"Failed"
);
}
}
}
else
{
}
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