Salome HOME
Add Engines.ResourcesManager.ListAllResourcesInCatalog method
authorAnthony Geay <anthony.geay@edf.fr>
Fri, 6 Jan 2023 08:25:18 +0000 (09:25 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Fri, 6 Jan 2023 08:25:18 +0000 (09:25 +0100)
idl/SALOME_ResourcesManager.idl
src/ResourcesManager/SALOME_ResourcesManager.cxx
src/ResourcesManager/SALOME_ResourcesManager.hxx

index 3504075f63b9c925f7fb668cda6c8ef0ed8f9f9e..bd1afb85a25a1622c973208ca5cae55a8837d134 100644 (file)
@@ -196,6 +196,8 @@ interface ResourcesManager
 
   //! Return list of resources available (regarding content of CatalogResources.xml). And for each resource the number of proc available of it.
   void ListAllAvailableResources(out ResourceList machines, out IntegerList nbProcsOfMachines) raises (SALOME::SALOME_Exception);
+
+  ResourceList ListAllResourcesInCatalog() raises (SALOME::SALOME_Exception);
 };
 
 };
index f4897ad89ad1c6d9ecd4b64a77b87c7a3b110c6f..c81b240f3e948d60539ee88f54d3fd82d20fffeb 100644 (file)
@@ -146,7 +146,10 @@ void SALOME_ResourcesManager::Shutdown()
 }
 
 /*!
- * Return list of resources available (regarding content of CatalogResources.xml). And for each resource the number of proc available of it.
+ * Return list of resources available (regarding content of CatalogResources.xml) but select only those with canRunContainers attribute set to true.
+ * And for each resource the number of proc available of it.
+ * 
+ * \sa SALOME_ResourcesManager::ListAllResourcesInCatalog
  */
 void SALOME_ResourcesManager::ListAllAvailableResources(Engines::ResourceList_out machines, Engines::IntegerList_out nbProcsOfMachines)
 {
@@ -173,6 +176,25 @@ void SALOME_ResourcesManager::ListAllAvailableResources(Engines::ResourceList_ou
     }
 }
 
+/*!
+ * Return list of resources available (regarding content of CatalogResources.xml) whatever canRunContainers attribute value.
+ * 
+ * \sa SALOME_ResourcesManager::ListAllAvailableResources
+ */
+Engines::ResourceList *SALOME_ResourcesManager::ListAllResourcesInCatalog()
+{
+  const MapOfParserResourcesType& zeList(_rm->GetList());
+  auto sz = zeList.size();
+  Engines::ResourceList *ret(new Engines::ResourceList);
+  ret->length( sz );
+  CORBA::ULong i(0);
+  for(auto it : zeList)
+  {
+    (*ret)[i++] = CORBA::string_dup( it.second.HostName.c_str() );
+  }
+  return ret;
+}
+
 //=============================================================================
 //! get the name of resources fitting the specified constraints (params)
 /*!
index 48a014cb06585de6ac4edc7e46c192199a94f300..ccf13de88dbfccafcebe5cc5d481e4a1a09a1261 100644 (file)
@@ -74,6 +74,8 @@ class SALOMERESOURCESMANAGER_EXPORT SALOME_ResourcesManager:
                          CORBA::Long nb_procs,
                          const char * parallelLib);
     void ListAllAvailableResources(Engines::ResourceList_out machines, Engines::IntegerList_out nbProcsOfMachines);
+    
+    Engines::ResourceList *ListAllResourcesInCatalog();
     // Cpp Methods
     void Shutdown();
     std::shared_ptr<ResourcesManager_cpp>& GetImpl() { return _rm; }