Commit 9f7e4ad1 authored by iker_martin's avatar iker_martin
Browse files

Guardar tiempos reales de merge shrink

parent 9add1817
...@@ -650,7 +650,7 @@ int end_redistribution() { ...@@ -650,7 +650,7 @@ int end_redistribution() {
///============================================= ///=============================================
///============================================= ///=============================================
///============================================= ///=============================================
double time_adapt; double time_adapt, time_adapt_end;
int state_shrink=0; //TODO Refactor int state_shrink=0; //TODO Refactor
pthread_t thread_shrink; pthread_t thread_shrink;
MPI_Comm comm_shrink; MPI_Comm comm_shrink;
...@@ -670,6 +670,7 @@ int thread_shrink_creation() { ...@@ -670,6 +670,7 @@ int thread_shrink_creation() {
} }
void* thread_shrink_work() { void* thread_shrink_work() {
proc_adapt_shrink(mall->numC, &comm_shrink, mall->myId); proc_adapt_shrink(mall->numC, &comm_shrink, mall->myId);
time_adapt_end = MPI_Wtime();
state_shrink=2; state_shrink=2;
pthread_exit(NULL); pthread_exit(NULL);
} }
...@@ -678,6 +679,7 @@ void* thread_shrink_work() { ...@@ -678,6 +679,7 @@ void* thread_shrink_work() {
///============================================= ///=============================================
int shrink_redistribution() { int shrink_redistribution() {
int global_state; int global_state;
double time_aux;
MPI_Comm aux_comm; MPI_Comm aux_comm;
if(mall_conf->spawn_type == COMM_SPAWN_MERGE_PTHREAD) { if(mall_conf->spawn_type == COMM_SPAWN_MERGE_PTHREAD) {
...@@ -691,6 +693,7 @@ int shrink_redistribution() { ...@@ -691,6 +693,7 @@ int shrink_redistribution() {
MPI_Allreduce(&state_shrink, &global_state, 1, MPI_INT, MPI_MIN, mall->comm); MPI_Allreduce(&state_shrink, &global_state, 1, MPI_INT, MPI_MIN, mall->comm);
if(global_state < 2) return MAL_SPAWN_PENDING; if(global_state < 2) return MAL_SPAWN_PENDING;
time_aux = MPI_Wtime();
if(pthread_join(thread_shrink, NULL)) { if(pthread_join(thread_shrink, NULL)) {
printf("Error al esperar al hilo\n"); printf("Error al esperar al hilo\n");
MPI_Abort(MPI_COMM_WORLD, -1); MPI_Abort(MPI_COMM_WORLD, -1);
...@@ -717,6 +720,9 @@ int shrink_redistribution() { ...@@ -717,6 +720,9 @@ int shrink_redistribution() {
mall->user_comm = aux_comm; mall->user_comm = aux_comm;
mall_conf->results->spawn_time[mall_conf->grp] = MPI_Wtime() - time_adapt; mall_conf->results->spawn_time[mall_conf->grp] = MPI_Wtime() - time_adapt;
if(mall_conf->spawn_type == COMM_SPAWN_MERGE_PTHREAD) {
mall_conf->results->spawn_real_time[mall_conf->grp] = time_adapt_end - time_adapt + MPI_Wtime() - time_aux;
}
return MAL_DIST_COMPLETED; //FIXME Refactor Poner a SPAWN_COMPLETED return MAL_DIST_COMPLETED; //FIXME Refactor Poner a SPAWN_COMPLETED
} else { } else {
return MAL_ZOMBIE; return MAL_ZOMBIE;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment