Commit 8e2bebe5 authored by iker_martin's avatar iker_martin
Browse files

Fixed error when getting median of each iteration

parent 21cd964f
......@@ -137,7 +137,7 @@ void compute_results_iter(results_data *results, int myId, int numP, int root, M
aux_id_iters[j] = aux_all_iters[i+(results->iter_index*j)];
}
// Get Median
qsort(aux_id_iters, results->iter_index, sizeof(double), &compare);
qsort(aux_id_iters, numP, sizeof(double), &compare);
median = aux_id_iters[numP/2];
if (numP % 2 == 0) median = (aux_id_iters[numP/2 - 1] + aux_id_iters[numP/2]) / 2;
results->iters_time[i] = median;
......
......@@ -43,7 +43,7 @@ numP=$(head -$fin $configFile | tail -$diff | cut -d ';' -f1 | grep Procs | cut
for ((i=0; i<qty; i++))
do
echo "Iter $i"
echo "Iter $i -- numP=$numP"
mpirun $dir$codeDir/a.out $configFile $outFileIndex $nodelist $nodes
done
......
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