-#test avec plus de neouds, c'est enfin best qui va plus vite, meme s'il effectue plus d'échange
+#test avec plus de noeuds, c'est enfin best qui va plus vite, meme s'il effectue plus d'échange
../loba -c1e6,0 -C1e4,0 -M10 -Tline -a2best -N0 -L-1000 -t10000 cluster256.xml -l100 -b -Z
../loba -c1e6,0 -C1e4,0 -M10 -Tline -abest -N0 -L-1000 -t10000 cluster256.xml -l100 -b -Z
-../loba -c1e6,0 -C1e4,0 -M10 -Tline -amakhoul -N0 -L-1000 -t10000 cluster256.xml -l100 -b -Z
\ No newline at end of file
+../loba -c1e6,0 -C1e4,0 -M10 -Tline -amakhoul -N0 -L-1000 -t10000 cluster256.xml -l100 -b -Z
+
+#tres leger avant pour best en calcul, avant pour makhoul en comm
+
+../loba -c1e6,0 -C1e4,0 -M10 -Tline -a2best -N0 -L-1000 -t10000 cluster256.xml -l100 -b -Z -R -r34
+../loba -c1e6,0 -C1e4,0 -M10 -Tline -abest -N0 -L-1000 -t10000 cluster256.xml -l100 -b -Z -R -r 34
+../loba -c1e6,0 -C1e4,0 -M10 -Tline -amakhoul -N0 -L-1000 -t10000 cluster256.xml -l100 -b -Z -R -r34
+
+# kifkif
+../loba -c1e8,0 -C1e4,0 -M10 -Tline -abest -N0 -L-1000 -t10000 cluster256.xml -l100 -b -Z -R -r 34
+../loba -c1e8,0 -C1e4,0 -M10 -Tline -amakhoul -N0 -L-1000 -t10000 cluster256.xml -l100 -b -Z -R -r34
+
+
+#idem calcul, makhoul bcp - de comm
+../loba -c1e6,0 -C1e4,0 -M10 -Thcube -abest -N0 -L-1000 -t2000 cluster256.xml -l100 -b -Z -R -r 34
+../loba -c1e6,0 -C1e4,0 -M10 -Thcube -amakhoul -N0 -L-1000 -t2000 cluster256.xml -l100 -b -Z -R -r34
\ No newline at end of file
--- /dev/null
+#include <xbt/log.h>
+
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(loba);
+
+#include "loba_makhoul3.h"
+
+void loba_makhoul3::load_balance()
+{
+ pneigh_sort_by_load(std::less<double>());
+ print_loads_p(false, xbt_log_priority_debug);
+
+ int nb_less_loaded=0;
+ for (unsigned i = 0 ; i < pneigh.size() ; ++i) {
+ nb_less_loaded+=(pneigh[i]->get_load()<=get_load());
+ }
+
+ double alpha = 1.0 / (nb_less_loaded );
+ double my_load = get_load();
+ bool cont = true;
+ for (unsigned i = 0 ;
+ cont && i < pneigh.size() && pneigh[i]->get_load() < my_load ; ++i) {
+
+ double delta = my_load - pneigh[i]->get_load();
+ double transfer = alpha * delta;
+ XBT_DEBUG("delta = %g ; transfer = %g", delta, transfer);
+ if (pneigh[i]->get_load() + transfer <= get_load() - transfer) {
+ send(pneigh[i], transfer);
+ XBT_DEBUG("sent %g to %s", transfer, pneigh[i]->get_name());
+ } else {
+ cont = false;
+ }
+ }
+}
+
+// Local variables:
+// mode: c++
+// End:
--- /dev/null
+#ifndef LOBA_MAKHOUL3_H
+#define LOBA_MAKHOUL3_H
+
+#include "process.h"
+
+class loba_makhoul3: public process {
+public:
+ loba_makhoul3(int argc, char* argv[]): process(argc, argv) { }
+ ~loba_makhoul3() { }
+
+private:
+ void load_balance();
+};
+
+#endif //!LOBA_MAKHOUL3_H
+
+// Local variables:
+// mode: c++
+// End:
#include "loba_lln.h"
#include "loba_makhoul.h"
#include "loba_makhoul2.h"
+#include "loba_makhoul3.h"
#include "loba_simple.h"
#include "misc.h"
loba_makhoul);
NOL_INSERT("makhoul2", "balance with Makhoul's source code",
loba_makhoul2);
+ NOL_INSERT("makhoul3", "describe your algorithm here...",
+ loba_makhoul3);
NOL_INSERT("none", "no load-balancing (for testing only)",
process);
NOL_INSERT("simple", "balance with least loaded neighbor",