Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Iker Martín Álvarez
Proteo
Commits
e60d6802
Commit
e60d6802
authored
Jun 04, 2024
by
iker_martin
Browse files
Bugfix around communicators. Most of them must be disconnected to ensure zombies can terminate.
parent
fbe98dff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Codes/malleability/malleabilityDataStructures.c
View file @
e60d6802
...
...
@@ -84,8 +84,8 @@ void MAM_print_comms_state() {
* Función para modificar los comunicadores principales de MaM
*/
void
MAM_comms_update
(
MPI_Comm
comm
)
{
if
(
mall
->
thread_comm
!=
MPI_COMM_WORLD
)
MPI_Comm_
free
(
&
(
mall
->
thread_comm
));
if
(
mall
->
comm
!=
MPI_COMM_WORLD
)
MPI_Comm_
free
(
&
(
mall
->
comm
));
if
(
mall
->
thread_comm
!=
MPI_COMM_WORLD
)
MPI_Comm_
disconnect
(
&
(
mall
->
thread_comm
));
if
(
mall
->
comm
!=
MPI_COMM_WORLD
)
MPI_Comm_
disconnect
(
&
(
mall
->
comm
));
MPI_Comm_dup
(
comm
,
&
(
mall
->
thread_comm
));
MPI_Comm_dup
(
comm
,
&
(
mall
->
comm
));
...
...
Codes/malleability/malleabilityDataStructures.h
View file @
e60d6802
...
...
@@ -18,6 +18,7 @@ typedef struct {
double
spawn_start
,
spawn_time
;
double
sync_start
,
sync_end
;
double
async_start
,
async_end
;
double
user_start
,
user_end
;
double
malleability_start
,
malleability_end
;
MPI_Datatype
times_type
;
...
...
Codes/malleability/spawn_methods/Baseline.c
View file @
e60d6802
...
...
@@ -116,7 +116,7 @@ void multiple_strat_parents(Spawn_data spawn_data, MPI_Comm comm, MPI_Comm *inte
MPI_Comm_connect
(
port_name
,
MPI_INFO_NULL
,
mall
->
root
,
comm
,
child
);
for
(
i
=
0
;
i
<
spawn_data
.
total_spawns
;
i
++
)
{
MPI_Comm_
free
(
&
intercomms
[
i
]);
MPI_Comm_
disconnect
(
&
intercomms
[
i
]);
}
free
(
port_name
);
}
...
...
@@ -153,7 +153,7 @@ void multiple_strat_children(MPI_Comm *parents) {
MPI_Comm_connect
(
port_name
,
MPI_INFO_NULL
,
mall
->
root
,
mall
->
comm
,
&
intercomm
);
MPI_Bcast
(
&
total_spawns
,
1
,
MPI_INT
,
mall
->
root
,
intercomm
);
// FIXME Seems inneficient - Should be performed by parent root?
MPI_Intercomm_merge
(
intercomm
,
1
,
&
newintracomm
);
// Get last ranks
MPI_Comm_
free
(
&
intercomm
);
MPI_Comm_
disconnect
(
&
intercomm
);
}
else
{
start
=
1
;
MPI_Comm_dup
(
mall
->
comm
,
&
newintracomm
);
...
...
@@ -163,9 +163,9 @@ void multiple_strat_children(MPI_Comm *parents) {
for
(
i
=
start
;
i
<
total_spawns
;
i
++
)
{
MPI_Comm_accept
(
port_name
,
MPI_INFO_NULL
,
mall
->
root
,
newintracomm
,
&
intercomm
);
MPI_Bcast
(
&
total_spawns
,
1
,
MPI_INT
,
rootBcast
,
intercomm
);
// FIXME Seems inneficient - Should be performed by parent root?
if
(
newintracomm
!=
MPI_COMM_WORLD
)
MPI_Comm_
free
(
&
newintracomm
);
if
(
newintracomm
!=
MPI_COMM_WORLD
)
MPI_Comm_
disconnect
(
&
newintracomm
);
MPI_Intercomm_merge
(
intercomm
,
0
,
&
newintracomm
);
// Get first ranks
MPI_Comm_
free
(
&
intercomm
);
MPI_Comm_
disconnect
(
&
intercomm
);
if
(
new_root
)
{
MPI_Send
(
&
aux
,
1
,
MPI_CHAR
,
stat
.
MPI_SOURCE
,
stat
.
MPI_TAG
,
parents_comm
);
// Ensures order in the created intracommunicator
...
...
@@ -181,8 +181,8 @@ void multiple_strat_children(MPI_Comm *parents) {
if
(
new_root
)
MPI_Close_port
(
port_name
);
free
(
port_name
);
MPI_Comm_
free
(
&
newintracomm
);
MPI_Comm_
free
(
parents
);
MPI_Comm_
disconnect
(
&
newintracomm
);
MPI_Comm_
disconnect
(
parents
);
*
parents
=
intercomm
;
}
...
...
@@ -207,7 +207,7 @@ void single_strat_parents(Spawn_data spawn_data, MPI_Comm *child) {
MPI_Comm_connect
(
port_name
,
MPI_INFO_NULL
,
mall
->
root
,
spawn_data
.
comm
,
&
newintercomm
);
if
(
mall
->
myId
==
mall
->
root
)
MPI_Comm_
free
(
child
);
MPI_Comm_
disconnect
(
child
);
free
(
port_name
);
*
child
=
newintercomm
;
}
...
...
@@ -237,6 +237,6 @@ void single_strat_children(MPI_Comm *parents) {
MPI_Close_port
(
port_name
);
}
free
(
port_name
);
MPI_Comm_
free
(
parents
);
MPI_Comm_
disconnect
(
parents
);
*
parents
=
newintercomm
;
}
Codes/malleability/spawn_methods/Merge.c
View file @
e60d6802
...
...
@@ -57,7 +57,7 @@ void merge_adapt_expand(MPI_Comm *child, int is_children_group) {
MPI_Intercomm_merge
(
*
child
,
is_children_group
,
&
new_comm
);
//El que pone 0 va primero
MPI_Comm_
free
(
child
);
MPI_Comm_
disconnect
(
child
);
*
child
=
new_comm
;
}
...
...
@@ -72,6 +72,7 @@ void merge_adapt_expand(MPI_Comm *child, int is_children_group) {
void
merge_adapt_shrink
(
int
numC
,
MPI_Comm
*
child
,
MPI_Comm
comm
,
int
myId
)
{
int
color
=
MPI_UNDEFINED
;
if
(
*
child
!=
MPI_COMM_NULL
&&
*
child
!=
MPI_COMM_WORLD
)
MPI_Comm_disconnect
(
child
);
if
(
myId
<
numC
)
{
color
=
1
;
}
...
...
Write
Preview
Supports
Markdown
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