Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
YAC
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
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
dkrz-sw
YAC
Commits
454a9cf8
Commit
454a9cf8
authored
7 years ago
by
Thomas Jahns
Browse files
Options
Downloads
Patches
Plain Diff
Add test for further MPICH fail.
* See
https://github.com/pmodels/mpich/commit/62f750cca3
.
parent
b6882523
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/checkdoc/test_mpi_pack_external_3.txt
+1
-0
1 addition, 0 deletions
config/checkdoc/test_mpi_pack_external_3.txt
config/checksrc/test_mpi_pack_external_3.c
+85
-0
85 additions, 0 deletions
config/checksrc/test_mpi_pack_external_3.c
with
86 additions
and
0 deletions
config/checkdoc/test_mpi_pack_external_3.txt
0 → 120000
+
1
−
0
View file @
454a9cf8
test_mpi_pack_external_1.txt
\ No newline at end of file
This diff is collapsed.
Click to expand it.
config/checksrc/test_mpi_pack_external_3.c
0 → 100644
+
85
−
0
View file @
454a9cf8
#include
<stdbool.h>
#include
<stdio.h>
#include
<stdlib.h>
#include
<string.h>
#include
<mpi.h>
static
const
char
datarep
[]
=
"external32"
;
enum
{
hdr_words
=
2
,
dta_words
=
12
};
#ifdef NO_DETECT_TRAILING_CORRUPTION
/* used to investigate with valgrind */
enum
{
trailing_size
=
0
};
#else
enum
{
trailing_size
=
8
};
#endif
int
main
(
int
argc
,
char
**
argv
)
{
unsigned
header
[
hdr_words
];
const
double
dbl_canary
=
0
.
356789
;
size_t
dta_words_extra
=
trailing_size
>
0
;
double
*
data
;
size_t
data_chars
=
sizeof
data
[
0
]
*
(
dta_words
+
dta_words_extra
);
data
=
malloc
(
data_chars
);
if
(
!
data
)
{
fprintf
(
stderr
,
"memory allocation for %zu bytes failed!
\n
"
,
data_chars
);
MPI_Abort
(
MPI_COMM_WORLD
,
1
);
}
MPI_Aint
header_size
,
data_size
;
MPI_Init
(
&
argc
,
&
argv
);
header
[
0
]
=
2
;
header
[
1
]
=
3
;
MPI_Pack_external_size
(
datarep
,
hdr_words
,
MPI_UNSIGNED
,
&
header_size
);
MPI_Pack_external_size
(
datarep
,
dta_words
,
MPI_DOUBLE
,
&
data_size
);
MPI_Aint
buf_size
=
header_size
+
data_size
;
for
(
size_t
i
=
0
;
i
<
dta_words
;
++
i
)
data
[
i
]
=
(
double
)
i
*
1
.
25
;
unsigned
char
*
buf
=
malloc
((
size_t
)
buf_size
+
trailing_size
);
if
(
!
buf
)
{
fprintf
(
stderr
,
"memory allocation for %zu bytes failed!
\n
"
,
(
size_t
)
buf_size
+
trailing_size
);
MPI_Abort
(
MPI_COMM_WORLD
,
1
);
}
for
(
size_t
i
=
0
;
i
<
trailing_size
;
++
i
)
buf
[
buf_size
+
i
]
=
(
unsigned
char
)
i
;
{
MPI_Aint
pos_pack
=
0
;
MPI_Pack_external
(
datarep
,
header
,
hdr_words
,
MPI_UNSIGNED
,
buf
,
buf_size
,
&
pos_pack
);
MPI_Pack_external
(
datarep
,
data
,
dta_words
,
MPI_DOUBLE
,
buf
,
buf_size
,
&
pos_pack
);
}
for
(
size_t
i
=
0
;
i
<
dta_words_extra
;
++
i
)
data
[
dta_words
+
i
]
=
dbl_canary
;
bool
mismatch
=
false
;
for
(
size_t
i
=
0
;
i
<
trailing_size
;
++
i
)
mismatch
|=
buf
[
buf_size
+
i
]
!=
(
unsigned
char
)
i
;
if
(
mismatch
)
{
fputs
(
"data corruption after external32 packing detected
\n
"
,
stderr
);
MPI_Abort
(
MPI_COMM_WORLD
,
1
);
}
{
MPI_Aint
pos_unpack
=
0
;
MPI_Unpack_external
(
datarep
,
buf
,
104
,
&
pos_unpack
,
header
,
hdr_words
,
MPI_UNSIGNED
);
MPI_Unpack_external
(
datarep
,
buf
,
104
,
&
pos_unpack
,
data
,
dta_words
,
MPI_DOUBLE
);
}
mismatch
=
(
header
[
0
]
!=
2
||
header
[
1
]
!=
3
);
for
(
size_t
i
=
0
;
i
<
dta_words
;
++
i
)
mismatch
|=
(
data
[
i
]
!=
(
double
)
i
*
1
.
25
);
for
(
size_t
i
=
0
;
i
<
dta_words_extra
;
++
i
)
{
fprintf
(
stderr
,
"data[%zu]=%f
\n
"
,
dta_words
+
i
,
data
[
dta_words
+
i
]);
mismatch
|=
(
data
[
dta_words
+
i
]
!=
dbl_canary
);
}
if
(
mismatch
)
{
fputs
(
"data corruption after external32 unpacking detected
\n
"
,
stderr
);
MPI_Abort
(
MPI_COMM_WORLD
,
1
);
}
free
(
buf
);
MPI_Finalize
();
return
0
;
}
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