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
ab2cef1c
Commit
ab2cef1c
authored
Jun 03, 2021
by
Thomas Jahns
🤸
Browse files
Prevent redundant dups.
parent
d88ba9be
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/xt_mpi.c
View file @
ab2cef1c
...
...
@@ -559,15 +559,10 @@ gen_fallback_type(size_t set_start, size_t set_end,
}
if
(
n
==
1
&&
d
[
0
]
==
0
)
{
// At the moment we disable the embed aspect that was used to avoid MPI_Type_dup.
// It turned out this creates more complexity when freeing the intermediate datatypes in the callin function.
// maybe we just forget the whole idea - then we can also remove the embed logic here.
//if (embed)
// *dt = old_type;
//else
xt_mpi_call
(
MPI_Type_dup
(
old_type
,
dt
),
Xt_default_comm
);
*
dt
=
old_type
;
}
else
{
xt_mpi_call
(
MPI_Type_create_indexed_block
(
n
,
1
,
d
,
old_type
,
dt
),
Xt_default_comm
);
xt_mpi_call
(
MPI_Type_create_indexed_block
(
n
,
1
,
d
,
old_type
,
dt
),
Xt_default_comm
);
}
free
(
d
);
...
...
@@ -616,6 +611,8 @@ parse_stripe(const struct Xt_offset_ext *v, size_t vlen, MPI_Datatype old_type)
MPI_Datatype
result_dt
;
if
(
wlen
==
1
)
{
assert
(
wdisp
[
0
]
==
0
);
if
(
wdt
[
0
]
==
old_type
)
xt_mpi_call
(
MPI_Type_dup
(
old_type
,
wdt
),
Xt_default_comm
);
result_dt
=
wdt
[
0
];
}
else
{
MPI_Aint
old_type_lb
,
old_type_extent
;
...
...
@@ -633,7 +630,8 @@ parse_stripe(const struct Xt_offset_ext *v, size_t vlen, MPI_Datatype old_type)
free
(
wblocklength
);
free
(
wbdisp
);
for
(
size_t
i
=
0
;
i
<
wlen
;
i
++
)
xt_mpi_call
(
MPI_Type_free
(
wdt
+
i
),
Xt_default_comm
);
if
(
wdt
[
i
]
!=
old_type
)
xt_mpi_call
(
MPI_Type_free
(
wdt
+
i
),
Xt_default_comm
);
}
xt_mpi_call
(
MPI_Type_commit
(
&
result_dt
),
Xt_default_comm
);
free
(
wdt
);
...
...
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