From: Ovidiu Mircescu Date: Tue, 21 Apr 2020 11:42:06 +0000 (+0200) Subject: Work in progress : workload manager step 1 X-Git-Tag: V9_6_0a1~7^2~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8627adfce2c28f387ae3f110ed540561f6e4b680;p=modules%2Fyacs.git Work in progress : workload manager step 1 Workload manager is used to manage the threads, but its recommendations for resource use are ignored for the moment. Some tests randomly fail for HPContainers (YACS_YacsLoaderTest_swig). --- diff --git a/src/engine/Executor.cxx b/src/engine/Executor.cxx index 2795d6a6d..baa82d3d8 100644 --- a/src/engine/Executor.cxx +++ b/src/engine/Executor.cxx @@ -1787,6 +1787,8 @@ void Executor::newRun(Scheduler *graph,int debug, bool fromScratch) for(Task * t : readyTasks) if(_runningTasks.find(t) == _runningTasks.end()) _tasks.push_back(t); + // TODO: to be removed + FilterTasksConsideringContainers(_tasks); numberAllTasks=_numberOfRunningTasks+_tasks.size(); } // --- End of critical section if (debug > 2) _displayDot(graph); diff --git a/src/runtime/Test/runtimeTest.cxx b/src/runtime/Test/runtimeTest.cxx index 04e09a831..115763f6f 100644 --- a/src/runtime/Test/runtimeTest.cxx +++ b/src/runtime/Test/runtimeTest.cxx @@ -81,6 +81,32 @@ int RuntimeTest::_ibloc = 0; Runtime *RuntimeTest::_myRuntime = 0; bool RuntimeTest::endTests = false; +RuntimeForTest::RuntimeForTest() +: RuntimeSALOME(UsePython+UseCorba+UseXml+UseCpp+UseSalome, 0, nullptr) +{ +} + +RuntimeForTest::~RuntimeForTest() +{ +} + +std::vector< std::pair > +RuntimeForTest::getCatalogOfComputeNodes() const +{ + std::vector< std::pair > result(1); + std::pair localhost; + localhost.first = "localhost"; + localhost.second = 8; + result[0] = localhost; + return result; +} + +void RuntimeForTest::setRuntime() +{ + if (! Runtime::_singleton) + Runtime::_singleton = new RuntimeForTest; +} + void RuntimeTest::setUp() { if (_ltc.size() == 0) @@ -103,7 +129,7 @@ void RuntimeTest::initRuntimeTypeCode() { // --- init runtime std::cerr << std::endl; - RuntimeSALOME::setRuntime(); + RuntimeForTest::setRuntime(); _myRuntime = getRuntime(); // --- init typecodes diff --git a/src/runtime/Test/runtimeTest.hxx b/src/runtime/Test/runtimeTest.hxx index bfe4c1e11..e037d67ea 100644 --- a/src/runtime/Test/runtimeTest.hxx +++ b/src/runtime/Test/runtimeTest.hxx @@ -42,6 +42,15 @@ namespace YACS { + class RuntimeForTest : public YACS::ENGINE::RuntimeSALOME + { + public: + static void setRuntime(); + RuntimeForTest(); + virtual ~RuntimeForTest(); + std::vector< std::pair > getCatalogOfComputeNodes() const override; + }; + class RuntimeTest #ifdef USE_CPPUNIT : public CppUnit::TestFixture