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
2fce7bb5
Commit
2fce7bb5
authored
Oct 17, 2022
by
iker_martin
Browse files
WIP. Error de memoria para Merge Shrink
parent
7cbd92e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Codes/malleability/malleabilityManager.c
View file @
2fce7bb5
...
@@ -82,6 +82,8 @@ int init_malleability(int myId, int numP, int root, MPI_Comm comm, char *name_ex
...
@@ -82,6 +82,8 @@ int init_malleability(int myId, int numP, int root, MPI_Comm comm, char *name_ex
MPI_Comm_dup
(
comm
,
&
dup_comm
);
MPI_Comm_dup
(
comm
,
&
dup_comm
);
MPI_Comm_dup
(
comm
,
&
thread_comm
);
MPI_Comm_dup
(
comm
,
&
thread_comm
);
MPI_Comm_set_name
(
dup_comm
,
"MPI_COMM_MALL"
);
MPI_Comm_set_name
(
thread_comm
,
"MPI_COMM_MALL_THREAD"
);
mall
->
myId
=
myId
;
mall
->
myId
=
myId
;
mall
->
numP
=
numP
;
mall
->
numP
=
numP
;
...
@@ -107,7 +109,7 @@ int init_malleability(int myId, int numP, int root, MPI_Comm comm, char *name_ex
...
@@ -107,7 +109,7 @@ int init_malleability(int myId, int numP, int root, MPI_Comm comm, char *name_ex
if
(
mall
->
intercomm
!=
MPI_COMM_NULL
)
{
if
(
mall
->
intercomm
!=
MPI_COMM_NULL
)
{
Children_init
();
Children_init
();
return
MALLEABILITY_CHILDREN
;
return
MALLEABILITY_CHILDREN
;
}
}
else
{
printf
(
"P%d/%d MI comm padres es nulo (%d)
\n
"
,
mall
->
myId
,
mall
->
numP
,
MPI_COMM_NULL
);}
zombies_service_init
();
zombies_service_init
();
return
MALLEABILITY_NOT_CHILDREN
;
return
MALLEABILITY_NOT_CHILDREN
;
...
@@ -663,21 +665,35 @@ int end_redistribution() {
...
@@ -663,21 +665,35 @@ int end_redistribution() {
MPI_Comm_dup
(
mall
->
intercomm
,
&
(
mall
->
thread_comm
));
MPI_Comm_dup
(
mall
->
intercomm
,
&
(
mall
->
thread_comm
));
MPI_Comm_dup
(
mall
->
intercomm
,
&
(
mall
->
comm
));
MPI_Comm_dup
(
mall
->
intercomm
,
&
(
mall
->
comm
));
MPI_Comm_dup
(
mall
->
intercomm
,
&
(
mall
->
user_comm
));
MPI_Comm_dup
(
mall
->
intercomm
,
&
(
mall
->
user_comm
));
MPI_Comm_set_name
(
mall
->
thread_comm
,
"MPI_COMM_MALL_THREAD"
);
MPI_Comm_set_name
(
mall
->
comm
,
"MPI_COMM_MALL"
);
MPI_Comm_set_name
(
mall
->
user_comm
,
"MPI_COMM_MALL_USER"
);
}
else
{
// Shrink || Merge Shrink requiere de mas tareas
}
else
{
// Shrink || Merge Shrink requiere de mas tareas
local_state
=
MALL_SPAWN_ADAPT_PENDING
;
local_state
=
MALL_SPAWN_ADAPT_PENDING
;
}
}
}
}
printf
(
"TEST 1 P%d Comm=%d intercomm=%d
\n
"
,
mall
->
myId
,
mall
->
comm
,
mall
->
intercomm
);
char
*
test
=
malloc
(
MPI_MAX_OBJECT_NAME
*
sizeof
(
char
));
int
tester
;
MPI_Comm_get_name
(
mall
->
thread_comm
,
test
,
&
tester
);
printf
(
"TEST 1 P%d Comm=%d name=%s
\n
"
,
mall
->
myId
,
mall
->
thread_comm
,
test
);
MPI_Comm_get_name
(
mall
->
comm
,
test
,
&
tester
);
printf
(
"TEST 2 P%d Comm=%d name=%s
\n
"
,
mall
->
myId
,
mall
->
comm
,
test
);
MPI_Comm_get_name
(
mall
->
user_comm
,
test
,
&
tester
);
printf
(
"TEST 3 P%d Comm=%d name=%s
\n
"
,
mall
->
myId
,
mall
->
user_comm
,
test
);
MPI_Comm_get_name
(
mall
->
intercomm
,
test
,
&
tester
);
printf
(
"TEST 4 P%d Comm=%d name=%s
\n
"
,
mall
->
myId
,
mall
->
intercomm
,
test
);
/*FIXMENOW En algun momento P0 cambia tanto su comm como intercomm respecto al resto...*/
MPI_Barrier
(
mall
->
comm
);
//FIXMENOW Por alguna razon da error en Comm
MPI_Barrier
(
mall
->
comm
);
//FIXMENOW Por alguna razon da error en Comm
if
(
mall
->
intercomm
!=
MPI_COMM_NULL
)
{
if
(
mall
->
intercomm
!=
MPI_COMM_NULL
)
{
if
(
mall
->
intercomm
==
MPI_COMM_WORLD
)
{
//FIXMENOW Intercomm se borra, pero no es COMM WORLD ni COMM NULL
printf
(
"TEST 2 P%d Comm=%d intercomm=%d ES WORLD
\n
"
,
mall
->
myId
,
mall
->
comm
,
mall
->
intercomm
);
//MPI_Comm_disconnect(&(mall->intercomm));
}
//FIXMENOW Intercomm se borra, pero no es COMM WORLD ni COMM NULL
MPI_Comm_disconnect
(
&
(
mall
->
intercomm
));
printf
(
"TEST 3 P%d Borra intercomm = %d
\n
"
,
mall
->
myId
,
mall
->
intercomm
);
}
}
printf
(
"TEST 4 P%d Comm=%d intercomm=%d
\n
"
,
mall
->
myId
,
mall
->
comm
,
mall
->
intercomm
);
MPI_Barrier
(
mall
->
intercomm
);
//FIXMENOW Por alguna razon da error en Comm
printf
(
"TEST 5 P%d Comm=%d intercomm=%d
\n
"
,
mall
->
myId
,
mall
->
comm
,
mall
->
intercomm
);
MPI_Barrier
(
mall
->
comm
);
//FIXMENOW Por alguna razon da error en Comm
MPI_Barrier
(
mall
->
comm
);
//FIXMENOW Por alguna razon da error en Comm
return
local_state
;
return
local_state
;
...
@@ -703,6 +719,10 @@ int shrink_redistribution() {
...
@@ -703,6 +719,10 @@ int shrink_redistribution() {
MPI_Comm_dup
(
mall
->
intercomm
,
&
(
mall
->
comm
));
MPI_Comm_dup
(
mall
->
intercomm
,
&
(
mall
->
comm
));
MPI_Comm_dup
(
mall
->
intercomm
,
&
(
mall
->
user_comm
));
MPI_Comm_dup
(
mall
->
intercomm
,
&
(
mall
->
user_comm
));
MPI_Comm_set_name
(
mall
->
thread_comm
,
"MPI_COMM_MALL_THREAD"
);
MPI_Comm_set_name
(
mall
->
comm
,
"MPI_COMM_MALL"
);
MPI_Comm_set_name
(
mall
->
user_comm
,
"MPI_COMM_MALL_USER"
);
mall_conf
->
results
->
spawn_time
[
mall_conf
->
grp
]
+=
MPI_Wtime
()
-
time_extra
;
mall_conf
->
results
->
spawn_time
[
mall_conf
->
grp
]
+=
MPI_Wtime
()
-
time_extra
;
if
(
malleability_spawn_contains_strat
(
mall_conf
->
spawn_strategies
,
MALL_SPAWN_PTHREAD
,
NULL
))
{
if
(
malleability_spawn_contains_strat
(
mall_conf
->
spawn_strategies
,
MALL_SPAWN_PTHREAD
,
NULL
))
{
mall_conf
->
results
->
spawn_real_time
[
mall_conf
->
grp
]
+=
MPI_Wtime
()
-
time_extra
;
mall_conf
->
results
->
spawn_real_time
[
mall_conf
->
grp
]
+=
MPI_Wtime
()
-
time_extra
;
...
...
Codes/malleability/spawn_methods/GenericSpawn.c
View file @
2fce7bb5
...
@@ -101,7 +101,7 @@ int check_spawn_state(MPI_Comm *child, MPI_Comm comm, double *real_time) {
...
@@ -101,7 +101,7 @@ int check_spawn_state(MPI_Comm *child, MPI_Comm comm, double *real_time) {
}
else
if
(
local_state
==
MALL_SPAWN_ADAPT_POSTPONE
)
{
}
else
if
(
local_state
==
MALL_SPAWN_ADAPT_POSTPONE
)
{
global_state
=
local_state
;
global_state
=
local_state
;
}
else
{
//FIXMENOW Error con Merge Shrink + Pthreads -- Parece algo con updte de estados en TODOS los procesos
}
else
{
printf
(
"Error Check spawn: Configuracion invalida State = %d
\n
"
,
local_state
);
printf
(
"Error Check spawn: Configuracion invalida State = %d
\n
"
,
local_state
);
MPI_Abort
(
MPI_COMM_WORLD
,
-
1
);
MPI_Abort
(
MPI_COMM_WORLD
,
-
1
);
return
-
10
;
return
-
10
;
...
...
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