From 3016db029e1815d651db2e335eee94c165355449 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 3 Jul 2018 11:19:30 +0200 Subject: [PATCH] Add algorithm pstar (not implemented yet). --- loba_pstar.cpp | 15 +++++++++++++++ loba_pstar.h | 19 +++++++++++++++++++ options.cpp | 3 +++ 3 files changed, 37 insertions(+) create mode 100644 loba_pstar.cpp create mode 100644 loba_pstar.h diff --git a/loba_pstar.cpp b/loba_pstar.cpp new file mode 100644 index 0000000..fe676eb --- /dev/null +++ b/loba_pstar.cpp @@ -0,0 +1,15 @@ +#include + +XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(loba); + +#include "loba_pstar.h" + +void loba_pstar::load_balance() +{ + // write code here... + xbt_die("Load-balancing algorithm \"pstar\" not implemented!"); +} + +// Local variables: +// mode: c++ +// End: diff --git a/loba_pstar.h b/loba_pstar.h new file mode 100644 index 0000000..a1d90a3 --- /dev/null +++ b/loba_pstar.h @@ -0,0 +1,19 @@ +#ifndef LOBA_PSTAR_H +#define LOBA_PSTAR_H + +#include "process.h" + +class loba_pstar: public process { +public: + loba_pstar(int argc, char* argv[]): process(argc, argv) { } + ~loba_pstar() { } + +private: + void load_balance(); +}; + +#endif //!LOBA_PSTAR_H + +// Local variables: +// mode: c++ +// End: diff --git a/options.cpp b/options.cpp index b31888f..08c271e 100644 --- a/options.cpp +++ b/options.cpp @@ -18,6 +18,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(main); #include "loba_makhoul.h" #include "loba_makhoul2.h" #include "loba_makhoul3.h" +#include "loba_pstar.h" #include "loba_simple.h" #include "misc.h" @@ -105,6 +106,8 @@ namespace opt { loba_makhoul3); NOL_INSERT("none", "no load-balancing (for testing only)", process); + NOL_INSERT("pstar", "balance with pstar strategy", + loba_pstar); NOL_INSERT("simple", "balance with least loaded neighbor", loba_simple); } -- 2.39.5