F #1843: Sent scheduler like parameter

(cherry picked from commit 31429d8d40)
This commit is contained in:
juanmont authored and Ruben S. Montero committed 2018-03-22 18:18:07 +01:00
1 parent a9573b8d66
commit 9776a388b0
3 files changed
+12 -4

No files matched your search

+8 -3
View File
@@ -43,14 +43,19 @@ class Scheduler: public ActionListener
{
public:
static Scheduler* sched;
void start();
virtual void register_policies(const SchedulerTemplate& conf){};
static Scheduler& instance()
static Scheduler& instance(Scheduler* the_sched=0)
{
static Scheduler _sched;
return _sched;
if ( the_sched != 0)
{
sched = the_sched;
}
return *sched;
}
float get_mem_ds_scale()
+2
View File
@@ -37,6 +37,8 @@
using namespace std;
Scheduler* Scheduler::sched = 0;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
+2 -1
View File
@@ -15,6 +15,7 @@
/* -------------------------------------------------------------------------- */
#include "RankScheduler.h"
#include "Scheduler.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -25,7 +26,7 @@
int main(int argc, char **argv)
{
Scheduler& sched = RankScheduler::instance();
Scheduler& sched = Scheduler::instance(new RankScheduler());
try
{