Commit 970d1d6f authored by iker_martin's avatar iker_martin
Browse files

Fast bugfix in Distribution check with requests. For some reason Testall fails...

Fast bugfix in Distribution check with requests. For some reason Testall fails in some cases. Bug encountered in results when shrink merge method used, where a Barrier solves the problem, does not make sense. Both problems should be studied.
parent b0cb85d8
...@@ -174,6 +174,7 @@ void compute_results_stages(results_data *results, int myId, int numP, int root, ...@@ -174,6 +174,7 @@ void compute_results_stages(results_data *results, int myId, int numP, int root,
MPI_Reduce(results->stage_times[i], NULL, results->iter_index, MPI_DOUBLE, MPI_MAX, root, comm); MPI_Reduce(results->stage_times[i], NULL, results->iter_index, MPI_DOUBLE, MPI_MAX, root, comm);
} }
} }
MPI_Barrier(comm);
} }
//======================================================|| //======================================================||
......
...@@ -159,7 +159,6 @@ int main(int argc, char *argv[]) { ...@@ -159,7 +159,6 @@ int main(int argc, char *argv[]) {
res = work(); res = work();
if(res == MALL_ZOMBIE) break; if(res == MALL_ZOMBIE) break;
if(res==1) { // Se ha llegado al final de la aplicacion if(res==1) { // Se ha llegado al final de la aplicacion
MPI_Barrier(comm); MPI_Barrier(comm);
results->exec_time = MPI_Wtime() - results->exec_start - results->wasted_time; results->exec_time = MPI_Wtime() - results->exec_start - results->wasted_time;
......
...@@ -653,9 +653,10 @@ int start_redistribution() { ...@@ -653,9 +653,10 @@ int start_redistribution() {
*/ */
int check_redistribution() { int check_redistribution() {
int is_intercomm, req_qty, completed, local_completed, all_completed, test_err; int is_intercomm, req_qty, completed, local_completed, all_completed, test_err;
size_t i; size_t i, j;
MPI_Request *req_completed; MPI_Request *req_completed;
local_completed = 1; local_completed = 1;
test_err = 0;
//FIXME Modificar para que se tenga en cuenta rep_a_data //FIXME Modificar para que se tenga en cuenta rep_a_data
for(i=0; i<dist_a_data->entries; i++) { for(i=0; i<dist_a_data->entries; i++) {
...@@ -663,10 +664,14 @@ int check_redistribution() { ...@@ -663,10 +664,14 @@ int check_redistribution() {
req_qty = dist_a_data->request_qty[i]; req_qty = dist_a_data->request_qty[i];
if(malleability_red_contains_strat(mall_conf->red_strategies, MALL_RED_IBARRIER, NULL)) { //FIXME Strategy not fully implemented if(malleability_red_contains_strat(mall_conf->red_strategies, MALL_RED_IBARRIER, NULL)) { //FIXME Strategy not fully implemented
test_err = MPI_Test(&(req_completed[req_qty-1]), &completed, MPI_STATUS_IGNORE); test_err = MPI_Test(&(req_completed[req_qty-1]), &completed, MPI_STATUS_IGNORE);
local_completed = local_completed && completed;
} else { } else {
test_err = MPI_Testall(req_qty, req_completed, &completed, MPI_STATUSES_IGNORE); for(j=0; j<req_qty; j++) {
test_err = MPI_Test(&(req_completed[j]), &completed, MPI_STATUS_IGNORE);
local_completed = local_completed && completed;
}
// test_err = MPI_Testall(req_qty, req_completed, &completed, MPI_STATUSES_IGNORE);
} }
local_completed = local_completed && completed;
} }
if (test_err != MPI_SUCCESS && test_err != MPI_ERR_PENDING) { if (test_err != MPI_SUCCESS && test_err != MPI_ERR_PENDING) {
......
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