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
8e2bebe5
Commit
8e2bebe5
authored
Nov 13, 2022
by
iker_martin
Browse files
Fixed error when getting median of each iteration
parent
21cd964f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Codes/IOcodes/results.c
View file @
8e2bebe5
...
...
@@ -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
;
...
...
Exec/singleRun.sh
View file @
8e2bebe5
...
...
@@ -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
...
...
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