Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
e269fd47
Commit
e269fd47
authored
Nov 19, 2013
by
Thomas Jahns
🤸
Browse files
Ensure scattered variables sizes match the index list.
parent
7428c48e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/pio_interface.c
View file @
e269fd47
...
...
@@ -648,6 +648,7 @@ struct scatterGatherDesc
const
int
*
blocklengths
,
*
displacements
;
size_t
elemSize
;
unsigned
numBlocks
;
unsigned
numElems
;
};
static
void
...
...
@@ -661,9 +662,16 @@ scatterGatherPackFunc(void *dataDesc, void *buf, int size, int *pos,
unsigned
char
*
dstBuf
=
buf
+
pos_
,
*
bufEnd
=
(
unsigned
char
*
)
buf
+
size
;
size_t
elemSize
=
p
->
elemSize
;
const
unsigned
char
*
data
=
p
->
data
;
for
(
unsigned
j
=
0
;
j
<
numBlocks
;
++
j
)
unsigned
copyCount
=
0
,
numElems
=
p
->
numElems
;
for
(
unsigned
j
=
0
;
j
<
numBlocks
&&
copyCount
<
numElems
;
++
j
)
{
int
bl
=
bls
[
j
];
if
(
bl
+
copyCount
>
numElems
)
{
bl
=
numElems
-
copyCount
;
Warning
(
"%s: %s"
,
"streamWriteScatteredVarPart"
,
"blocks longer than number of elements in index list!"
);
}
if
(
bl
>
0
)
{
size_t
bsize
=
(
size_t
)
bl
*
elemSize
;
...
...
@@ -687,7 +695,9 @@ cdiPioBufferPartDataGather(int streamID, int varID, const double *data,
&
(
struct
scatterGatherDesc
)
{
.
data
=
(
void
*
)
data
,
.
blocklengths
=
blocklengths
,
.
displacements
=
displacements
,
.
elemSize
=
sizeof
(
data
[
0
]),
.
numBlocks
=
numBlocks
},
.
elemSize
=
sizeof
(
data
[
0
]),
.
numBlocks
=
numBlocks
,
.
numElems
=
(
unsigned
)
xt_idxlist_get_num_indices
(
partDesc
)
},
scatterGatherPackFunc
,
nmiss
,
partDesc
);
}
...
...
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