Salome HOME
The modfications sent by Jean are for the use of Salome on a batch V3_2_3pre4 V3_2_3pre5
authormkr <mkr@opencascade.com>
Mon, 27 Nov 2006 12:15:18 +0000 (12:15 +0000)
committermkr <mkr@opencascade.com>
Mon, 27 Nov 2006 12:15:18 +0000 (12:15 +0000)
cluster like CCRT.

src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx
src/ResourcesManager/SALOME_ResourcesManager.cxx

index 8575f1b1c25ae1b2170dd8291ba5a74867f58acd..53162f87c22eac4529f5514222d9e8aae0c1d102 100755 (executable)
@@ -230,8 +230,26 @@ endElement(const QString&,
   if ((qName.compare(QString(test_modules)) == 0))
     _resource.ModulesPath[previous_module_name] = previous_module_path;
 
-  if ((qName.compare(QString(test_machine)) == 0))
-    _resources_list[_resource.DataForSort._hostName] = _resource;
+  if ((qName.compare(QString(test_machine)) == 0)){
+    int nbnodes = _resource.DataForSort._nbOfNodes;
+    if( nbnodes > 1 ){
+      string clusterNode = _resource.DataForSort._hostName ;
+      for(int i=0;i<nbnodes;i++){
+        char inode[64];
+        inode[0] = '\0' ;
+        sprintf(inode,"%s%d",clusterNode.c_str(),i+1);
+        std::string nodeName(inode);
+//        _resource.DataForSort._nbOfNodes = 1;
+        _resource.DataForSort._hostName = nodeName ;
+        _resources_list[nodeName] = _resource;
+        //cout << "SALOME_ResourcesCatalog_Handler::endElement _resources_list["
+        //     << nodeName << "] = _resource " << _resource.DataForSort._hostName.c_str()
+        //     << endl ;
+      }
+    }
+    else
+      _resources_list[_resource.DataForSort._hostName] = _resource;
+  }
 
   return true;
 }
index 4fe50b01ff02c015563f450290a5fe2c1c60c6b8..48da06e370caabc81c0db671a1109abe04dd3884 100644 (file)
@@ -153,9 +153,23 @@ throw(SALOME_Exception)
 
       else
         {
+// Cas d'un cluster: nombre de noeuds > 1
+          int cpt=0;
+          for (map<string, ParserResourcesType>::const_iterator iter = _resourcesList.begin(); iter != _resourcesList.end(); iter++){
+           if( (*iter).second.DataForSort._nbOfNodes > 1 ){
+             if( strncmp(hostname,(*iter).first.c_str(),strlen(hostname)) == 0 ){
+                ret.push_back((*iter).first.c_str());
+                //cout << "SALOME_ResourcesManager::GetFittingResources vector["
+                //     << cpt << "] = " << (*iter).first.c_str() << endl ;
+                cpt++;
+              }
+            }
+          }
+          if(cpt==0){
           // --- user specified an unknown hostame so notify him.
-          MESSAGE("ResourcesManager::GetFittingResources : SALOME_Exception");
-          throw SALOME_Exception("unknown host");
+            MESSAGE("ResourcesManager::GetFittingResources : SALOME_Exception");
+            throw SALOME_Exception("unknown host");
+          }
         }
     }