Salome HOME
Work in progress : workload manager step 1
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Tue, 21 Apr 2020 11:42:06 +0000 (13:42 +0200)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Tue, 21 Apr 2020 11:42:06 +0000 (13:42 +0200)
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).

src/engine/Executor.cxx
src/runtime/Test/runtimeTest.cxx
src/runtime/Test/runtimeTest.hxx

index 2795d6a6d5391e7af81ef8c8e8fdf41b0d13ecfc..baa82d3d89927e8e5ce0c3c3ad5e1052007620ef 100644 (file)
@@ -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);
index 04e09a831f68bce0c8144ca1df095e1834d90392..115763f6f47a861185a0bda2896fec4e953df8f5 100644 (file)
@@ -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<std::string,int> >
+RuntimeForTest::getCatalogOfComputeNodes() const
+{
+  std::vector< std::pair<std::string,int> > result(1);
+  std::pair<std::string,int> 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
index bfe4c1e118fcabb44db22d5eb26d1594a9fc00ef..e037d67ea52267d1595afeb34fefd45363f70695 100644 (file)
 
 namespace YACS
 {
+  class RuntimeForTest : public YACS::ENGINE::RuntimeSALOME
+  {
+  public:
+    static void setRuntime();
+    RuntimeForTest();
+    virtual ~RuntimeForTest();
+    std::vector< std::pair<std::string,int> > getCatalogOfComputeNodes() const override;
+  };
+
   class RuntimeTest
 #ifdef USE_CPPUNIT
                      : public CppUnit::TestFixture