From 5e43cdf74cfa40b69f5e7e9eb3957c43f4accb86 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 7 Mar 2011 18:20:24 +0100 Subject: [PATCH] Whitespace cleanup. Rename makhoul.txt -> MAKHOUL.txt. --- ALGORITHMS | 2 +- makhoul.txt => MAKHOUL.txt | 52 +++++++++++++++++++------------------- QUESTIONS | 8 +++--- options.cpp | 2 +- 4 files changed, 32 insertions(+), 32 deletions(-) rename makhoul.txt => MAKHOUL.txt (98%) diff --git a/ALGORITHMS b/ALGORITHMS index 449fc12..4a9b03c 100644 --- a/ALGORITHMS +++ b/ALGORITHMS @@ -48,7 +48,7 @@ Comme makhoul, mais la différence est calculée avec la charge courante Références: - le code source :-( - cf. makhoul.txt + cf. MAKHOUL.txt none diff --git a/makhoul.txt b/MAKHOUL.txt similarity index 98% rename from makhoul.txt rename to MAKHOUL.txt index 344206a..61a6b9f 100644 --- a/makhoul.txt +++ b/MAKHOUL.txt @@ -10,7 +10,7 @@ powwow:/home/makhoul# find . -name Fusion.cc -ls 5541828 8 -rw-r--r-- 1 makhoul and 6631 mai 14 2007 ./Desktop/A.Makhoul/DiffusOMNET/Fusion.cc ,---- | void BRITENode::updateLoad(){ -| +| | double deltaSum = 0.; | double deltaMin = this->load; | for (int i = 0; i < gateSize("out"); i++) { @@ -28,7 +28,7 @@ powwow:/home/makhoul# find . -name Fusion.cc -ls | double transfer = alpha * delta[i]; | totalSend[i] += transfer; | this->load -= transfer; -| +| | } | } `---- @@ -41,7 +41,7 @@ powwow:/home/makhoul# find . -name Fusion.cc -ls 6497742 8 -rw-r--r-- 1 makhoul and 8001 juin 12 2007 ./Desktop/AbdallahMakhoul/Recherche/Diffus-OMNET/Fusion.cc ,---- | void BRITENode::updateLoad(){ -| +| | double deltaSum = 0.; | double deltaMin = this->load; | for (int i = 0; i < gateSize("out"); i++) { @@ -59,7 +59,7 @@ powwow:/home/makhoul# find . -name Fusion.cc -ls | double transfer = alpha * delta[i]; | totalSend[i] += transfer; | this->load -= transfer; -| +| | } | } `---- @@ -73,7 +73,7 @@ d0b4ef1a4553ff1c9c408390818cf925 ./FusionOmnet/Fusion.cc | totalSent = 0.; | const double alpha = 1.0 / (gateSize("out") + 1); | const double epsilon = 1.0e-4; -| +| | int nDelta = 0; | for (int i = 0; i < gateSize("out"); i++) { | double d = this->load - neighborsLoad[i]; @@ -83,9 +83,9 @@ d0b4ef1a4553ff1c9c408390818cf925 ./FusionOmnet/Fusion.cc | nDelta++; | } | } -| +| | std::sort(Delta, Delta + nDelta, DeltaCompDec()); -| +| | double neighborLoadMax = 0.0; // maximum load of neighbors to which | // something has been sent | for (int i = 0; i < nDelta; i++) { @@ -93,27 +93,27 @@ d0b4ef1a4553ff1c9c408390818cf925 ./FusionOmnet/Fusion.cc | double delta = this->load - neighborsLoad[index]; | if (delta <= epsilon) | break; -| +| | #if 0 | delta = Delta[i].delta; // does not work well... | #endif -| +| | double transfer = alpha * delta; | double transferMax = | std::min(this->load - neighborLoadMax, | (this->load - neighborsLoad[index]) / 2.0); -| +| | if (transfer > transferMax) // ping-pong violated? | transfer = transferMax; -| +| | totalSend[index] += transfer; | this->load -= transfer; -| +| | double newNeighborLoad = neighborsLoad[index] + transfer; | if (newNeighborLoad > neighborLoadMax) | neighborLoadMax = newNeighborLoad; | } -| +| | // double transfer = alpha * Delta[i].delta; | // if((this->load - totalSent) >= neighborsLoad[Delta[i].index] + transfer) | // break; @@ -123,7 +123,7 @@ d0b4ef1a4553ff1c9c408390818cf925 ./FusionOmnet/Fusion.cc | // totalSent+=transfer; | // } | // } -| +| | // double deltaMax = 1.0e-3; // we consider only positive deltas | // int iMax = -1; // invalid value | // for (int i = 0; i < gateSize("out"); i++) { @@ -133,7 +133,7 @@ d0b4ef1a4553ff1c9c408390818cf925 ./FusionOmnet/Fusion.cc | // iMax = Delta[i].index; | // } | // } -| +| | // if (iMax != -1) { | // double transfer = alpha * Delta[iMax].delta; | // totalSend[iMax] += transfer; @@ -159,7 +159,7 @@ d0b4ef1a4553ff1c9c408390818cf925 ./FusionOmnet/Fusion.cc | totalSent = 0.; | const double alpha = 1.0 / (gateSize("out") + 1); | const double epsilon = par("erreur"); -| +| | int nDelta = 0; | for (int i = 0; i < gateSize("out"); i++) { | double d = this->load - neighborsLoad[i]; @@ -169,9 +169,9 @@ d0b4ef1a4553ff1c9c408390818cf925 ./FusionOmnet/Fusion.cc | nDelta++; | } | } -| +| | std::sort(Delta, Delta + nDelta, DeltaCompDec()); -| +| | double neighborLoadMax = 0.0; // maximum load of neighbors to which | // something has been sent | for (int i = 0; i < nDelta; i++) { @@ -179,27 +179,27 @@ d0b4ef1a4553ff1c9c408390818cf925 ./FusionOmnet/Fusion.cc | double delta = this->load - neighborsLoad[index]; | if (delta <= epsilon) | break; -| +| | #if 0 | delta = Delta[i].delta; // does not work well... | #endif -| +| | double transfer = alpha * delta; | double transferMax = | std::min(this->load - neighborLoadMax, | (this->load - neighborsLoad[index]) / 2.0); -| +| | if (transfer > transferMax) // ping-pong violated? | transfer = transferMax; -| +| | totalSend[index] += transfer; | this->load -= transfer; -| +| | double newNeighborLoad = neighborsLoad[index] + transfer; | if (newNeighborLoad > neighborLoadMax) | neighborLoadMax = newNeighborLoad; | } -| +| | // double transfer = alpha * Delta[i].delta; | // if((this->load - totalSent) >= neighborsLoad[Delta[i].index] + transfer) | // break; @@ -209,7 +209,7 @@ d0b4ef1a4553ff1c9c408390818cf925 ./FusionOmnet/Fusion.cc | // totalSent+=transfer; | // } | // } -| +| | // double deltaMax = 1.0e-3; // we consider only positive deltas | // int iMax = -1; // invalid value | // for (int i = 0; i < gateSize("out"); i++) { @@ -219,7 +219,7 @@ d0b4ef1a4553ff1c9c408390818cf925 ./FusionOmnet/Fusion.cc | // iMax = Delta[i].index; | // } | // } -| +| | // if (iMax != -1) { | // double transfer = alpha * Delta[iMax].delta; | // totalSend[iMax] += transfer; diff --git a/QUESTIONS b/QUESTIONS index 35b7382..e65997e 100644 --- a/QUESTIONS +++ b/QUESTIONS @@ -7,9 +7,9 @@ - B prévoit d'envoyer 0 à A. Comment, sachant que l'équilibrage est asynchrone ? - * Comment définir la charge avec des nœuds hétégrogènes ? +* Comment définir la charge avec des nœuds hétégrogènes ? - * Comment détecter la convergence ? Y en a-t-il vraiment besoin ? - -> les calculs s'arrêtent quand il n'y a plus rien à faire... +* Comment détecter la convergence ? Y en a-t-il vraiment besoin ? + -> les calculs s'arrêtent quand il n'y a plus rien à faire... - * Comment gérer les pannes des liens de communication ? +* Comment gérer les pannes des liens de communication ? diff --git a/options.cpp b/options.cpp index 96542f6..3ec77d4 100644 --- a/options.cpp +++ b/options.cpp @@ -210,7 +210,7 @@ bool opt::parse_args(int* argc, char* argv[]) opt::program_name.erase(0, 1 + opt::program_name.find_last_of('/')); #define PARSE_ARG(x) result = opt_helper::parse_arg(c, optarg, (x)) && result - + int c; opterr = 0; while ((c = getopt(*argc, argv, -- 2.39.5