A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Misc code simplifications guided by Sonar smells.
[simgrid.git]
/
examples
/
cpp
/
exec-cpu-factors
/
s4u-exec-cpu-factors.cpp
diff --git
a/examples/cpp/exec-cpu-factors/s4u-exec-cpu-factors.cpp
b/examples/cpp/exec-cpu-factors/s4u-exec-cpu-factors.cpp
index c62b7c3d542274675bb53535efe8648c03373875..6f6ce5381ed5cea4da5840de18ebf84692188570 100644
(file)
--- a/
examples/cpp/exec-cpu-factors/s4u-exec-cpu-factors.cpp
+++ b/
examples/cpp/exec-cpu-factors/s4u-exec-cpu-factors.cpp
@@
-31,11
+31,7
@@
static double cpu_variability(const sg4::Host* host, double flops)
{
/* creates variability for tasks smaller than 1% of CPU power.
* unrealistic, for learning purposes */
- double factor = 1.0;
- double speed = host->get_speed();
- if (flops < speed / 100) {
- factor = 0.5;
- }
+ double factor = (flops < host->get_speed() / 100) ? 0.5 : 1.0;
XBT_INFO("Host %s, task with %lf flops, new factor %lf", host->get_cname(), flops, factor);
return factor;
}