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
dkrz-sw
yaxt
Commits
e0d5d025
Commit
e0d5d025
authored
Jun 01, 2021
by
Thomas Jahns
🤸
Browse files
Merge buffer allocations.
parent
770ee6bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/xt_redist.c
View file @
e0d5d025
...
...
@@ -272,9 +272,12 @@ xt_create_compound_datatype(size_t count,
if
(
num_datatypes
!=
count
)
{
if
(
num_datatypes
>
max_auto_dt
)
{
datatypes_
=
xmalloc
(
num_datatypes
*
sizeof
(
*
datatypes_
));
displacements_
=
xmalloc
(
num_datatypes
*
sizeof
(
*
displacements_
));
block_lengths_
=
xmalloc
(
num_datatypes
*
sizeof
(
*
block_lengths_
));
size_t
buf_size
=
num_datatypes
*
sizeof
(
*
datatypes_
)
+
num_datatypes
*
sizeof
(
*
displacements_
)
+
num_datatypes
*
sizeof
(
*
block_lengths_
);
displacements_
=
xmalloc
(
buf_size
);
datatypes_
=
(
MPI_Datatype
*
)(
displacements_
+
num_datatypes
);
block_lengths_
=
(
int
*
)(
datatypes_
+
num_datatypes
);
}
else
{
datatypes_
=
dt_auto
;
displacements_
=
disp_auto
;
...
...
@@ -309,11 +312,8 @@ xt_create_compound_datatype(size_t count,
xt_mpi_call
(
MPI_Type_commit
(
&
datatype
),
comm
);
if
(
num_datatypes
!=
count
&&
num_datatypes
>
max_auto_dt
)
{
free
(
block_lengths_
);
if
(
num_datatypes
!=
count
&&
num_datatypes
>
max_auto_dt
)
free
(
displacements_
);
free
(
datatypes_
);
}
return
datatype
;
}
...
...
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