]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Direct manipulation of resource map singleton
authorAnthony Geay <anthony.geay@edf.fr>
Thu, 18 Apr 2024 11:57:12 +0000 (13:57 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Thu, 18 Apr 2024 11:57:12 +0000 (13:57 +0200)
src/Launcher_SWIG/Launcher.i
src/ResourcesManager/ResourcesManager.cxx
src/ResourcesManager/ResourcesManager.hxx

index 9a50dafc1b51a35e5a4b1c077ace2be322111a00..04646de0b31facb847c8c6c2f1cd426e5774f389 100644 (file)
@@ -230,6 +230,30 @@ public:
     new_resource_cpp.working_directory = new_resource.working_directory;
     $self->AddResourceInCatalog(new_resource_cpp);
   }
+
+  void AddResourceInCatalogNoQuestion (const ResourceDefinition_cpp& new_resource)
+  {
+    ParserResourcesType new_resource_cpp;
+    new_resource_cpp.Name = new_resource.name;
+    new_resource_cpp.HostName = new_resource.hostname;
+    new_resource_cpp.setResourceTypeStr( new_resource.type );
+    new_resource_cpp.setAccessProtocolTypeStr( new_resource.protocol );
+    new_resource_cpp.UserName = new_resource.username;
+    new_resource_cpp.AppliPath = new_resource.applipath;
+    new_resource_cpp.OS = new_resource.OS;
+    new_resource_cpp.DataForSort._Name = new_resource.name;
+    new_resource_cpp.DataForSort._memInMB = new_resource.mem_mb;
+    new_resource_cpp.DataForSort._CPUFreqMHz = new_resource.cpu_clock;
+    new_resource_cpp.DataForSort._nbOfNodes = new_resource.nb_node;
+    new_resource_cpp.DataForSort._nbOfProcPerNode = new_resource.nb_proc_per_node;
+    new_resource_cpp.setBatchTypeStr(new_resource.batch);
+    new_resource_cpp.setMpiImplTypeStr(new_resource.mpiImpl);
+    new_resource_cpp.setClusterInternalProtocolStr(new_resource.iprotocol);
+    new_resource_cpp.can_launch_batch_jobs = new_resource.can_launch_batch_jobs;
+    new_resource_cpp.can_run_containers = new_resource.can_run_containers;
+    new_resource_cpp.working_directory = new_resource.working_directory;
+    $self->AddResourceInCatalogNoQuestion(new_resource_cpp);
+  }
   
   void ParseXmlFiles()
   {
index cb85bc0c18ebeddead280a84a456992a335e587d..fc55861785f9652f41dbdb5456dbb457df8cf95b 100644 (file)
@@ -330,6 +330,11 @@ ResourcesManager_cpp::GetFittingResources(const resourceParams& params)
   return vec;
 }
 
+void ResourcesManager_cpp::AddResourceInCatalogNoQuestion (const ParserResourcesType & new_resource)
+{
+  _resourcesList[new_resource.Name] = new_resource;
+}
+
 //=============================================================================
 /*!
  *  add an entry in the resources catalog xml file.
@@ -357,7 +362,7 @@ ResourcesManager_cpp::AddResourceInCatalog(const ParserResourcesType & new_resou
       throw ResourcesException(check);
   }
   // TODO - Add minimal check
-  _resourcesList[new_resource.Name] = new_resource;
+  this->AddResourceInCatalogNoQuestion( new_resource );
 }
 
 void ResourcesManager_cpp::DeleteAllResourcesInCatalog()
index 54f8a75d8d7351cee7038d4083ef350308565c71..11794596656eba516aa7d384bda0c5a643bcdcfe 100644 (file)
@@ -81,6 +81,8 @@ class RESOURCESMANAGER_EXPORT ResourcesManager_cpp
 
     std::string Find(const std::string& policy, const std::vector<std::string>& listOfResources) const;
 
+    void AddResourceInCatalogNoQuestion (const ParserResourcesType & new_resource);
+
     void AddResourceInCatalog (const ParserResourcesType & new_resource);
     
     void DeleteAllResourcesInCatalog();