]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
CCAR: add localhost in default CatalogResources.xml catalog
authorcaremoli <caremoli>
Fri, 18 Jan 2008 11:16:59 +0000 (11:16 +0000)
committercaremoli <caremoli>
Fri, 18 Jan 2008 11:16:59 +0000 (11:16 +0000)
bin/appli_gen.py
resources/CatalogResources.xml.in
src/Container/SALOME_ContainerManager.cxx
src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx

index 89e30a94e02a4ff6bba8a68f75465228c548eae2..c24614cc15a3dd705cd34eeb9aac508568d199ff 100644 (file)
@@ -224,6 +224,16 @@ def install(prefix,config_file):
     <parameter name="standalone" value="pyContainer,supervContainer"/>
   </section>
 </document>
+"""
+    f.write(command)    
+    f.close()
+
+    #Add default CatalogResources.xml file
+    f =open(os.path.join(home_dir,'CatalogResources.xml'),'w')
+    command="""<!DOCTYPE ResourcesCatalog>
+<resources>
+   <machine hostname="localhost" />
+</resources>
 """
     f.write(command)    
     f.close()
index 874d32492f1d158e325475ae32baf477440f96f4..11e6b6e2659e128f01a68f4e4ae318afb42e8bc1 100644 (file)
@@ -1,43 +1,4 @@
 <!DOCTYPE ResourcesCatalog>
 <resources>
-
-<machine hostname="is111918" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" protocol="r" mode="i" nbOfNodes="1" nbOfProcPerNode="1" preReqFilePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/env_products.sh" >
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/KERNEL_3.2.6" moduleName="KERNEL" />
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/MED_3.2.6" moduleName="MED" />
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/GEOM_3.2.6" moduleName="GEOM" />
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/SMESH_3.2.6" moduleName="SMESH" />
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/SUPERV_3.2.6" moduleName="SUPERV" />
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/VISU_3.2.6" moduleName="VISU" />
-</machine>
-
-<machine hostname="is102430" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" protocol="r" mode="i" nbOfNodes="1" nbOfProcPerNode="1" preReqFilePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/env_products.sh" >
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/KERNEL_3.2.6" moduleName="KERNEL" />
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/MED_3.2.6" moduleName="MED" />
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/GEOM_3.2.6" moduleName="GEOM" />
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/SMESH_3.2.6" moduleName="SMESH" />
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/SUPERV_3.2.6" moduleName="SUPERV" />
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/VISU_3.2.6" moduleName="VISU" />
-</machine>
-
-<machine hostname="is125604" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" protocol="r" mode="i" nbOfNodes="1" nbOfProcPerNode="1" preReqFilePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/env_products.sh" >
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/KERNEL_3.2.6" moduleName="KERNEL" />
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/MED_3.2.6" moduleName="MED" />
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/GEOM_3.2.6" moduleName="GEOM" />
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/SMESH_3.2.6" moduleName="SMESH" />
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/SUPERV_3.2.6" moduleName="SUPERV" />
-<modules modulePath="/data/tmplgls/rahuel/YACS/Salome_3.2.6pre4/VISU_3.2.6" moduleName="VISU" />
-</machine>
-
-<machine hostname="tantal" alias="tantale.ccc.cea.fr" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" protocol="s" mode="b" nbOfNodes="236" nbOfProcPerNode="4" appliPath="/workdir/rahuel/YACS/Salome_3.2.6pre4/env_products.sh" >
-<modules modulePath="/workdir/rahuel/YACS/Salome_3.2.6pre4/KERNEL_install" moduleName="KERNEL" />
-<modules modulePath="/workdir/rahuel/YACS/Salome_3.2.6pre4/MED_3.2.6" moduleName="MED" />
-<modules modulePath="/workdir/rahuel/YACS/Salome_3.2.6pre4/GEOM_3.2.6" moduleName="GEOM" />
-<modules modulePath="/workdir/rahuel/YACS/Salome_3.2.6pre4/SMESH_3.2.6" moduleName="SMESH" />
-<modules modulePath="/workdir/rahuel/YACS/Salome_3.2.6pre4/NETGENPLUGIN_3.2.6" moduleName="NETGENPLUGIN" />
-<modules modulePath="/workdir/rahuel/YACS/Salome_3.2.6pre4/NETGENPLUGIN_3.2.6" moduleName="NETGENPLUGIN" />
-<modules modulePath="/workdir/rahuel/YACS/Salome_3.2.6pre4/YACS_install" moduleName="YACS" />
-<modules modulePath="/workdir/rahuel/YACS/Salome_3.2.6pre4/SRHEOLEFCPP_install" moduleName="SRHEOLEFCPP" />
-<modules modulePath="/workdir/rahuel/YACS/Salome_3.2.6pre4/SRHEOLEF_install" moduleName="SRHEOLEF" />
-</machine>
-
+  <machine hostname="localhost" />
 </resources>
index 679dc190666f445e61b59f3d24454ac8271a26b1..72a2b7345c2a85f5dbdf70406701cf299456d53f 100644 (file)
@@ -230,6 +230,10 @@ StartContainer(const Engines::MachineParameters& params,
     return Engines::Container::_nil();
   }
 
+  //If the machine name is localhost use the real name
+  if(theMachine == "localhost")
+    theMachine=GetHostname();
+
   MESSAGE("try to launch it on " << theMachine);
 
   // Get Id for container: a parallel container registers in Naming Service
index 58eb63d01e395dce9a87c2f7d2331e82fb62ede4..0b85c6bfb8286167c4f141a5b0f0b1ff2b395c5a 100755 (executable)
@@ -137,37 +137,47 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
          else
            _resource.Alias = "";
 
-         xmlChar* protocol= xmlGetProp(aCurNode, (const xmlChar*)test_protocol);
-         switch ( protocol[0])
-           {
-           case 'r':
-             _resource.Protocol = rsh;
-             break;
-           case 's':
-             _resource.Protocol = ssh;
-             break;
-           default:
-             // If it'not in all theses cases, the protocol is affected to rsh
-             _resource.Protocol = rsh;
-             break;
-           }
-          xmlFree(protocol);
+         if (xmlHasProp(aCurNode, (const xmlChar*)test_protocol))
+            {
+             xmlChar* protocol= xmlGetProp(aCurNode, (const xmlChar*)test_protocol);
+             switch ( protocol[0])
+               {
+               case 'r':
+                 _resource.Protocol = rsh;
+                 break;
+               case 's':
+                 _resource.Protocol = ssh;
+                 break;
+               default:
+                 // If it'not in all theses cases, the protocol is affected to rsh
+                 _resource.Protocol = rsh;
+                 break;
+               }
+              xmlFree(protocol);
+            }
+          else
+            _resource.Protocol = rsh;
          
-         xmlChar* mode=xmlGetProp(aCurNode, (const xmlChar*)test_mode);
-         switch ( mode[0] )
+         if (xmlHasProp(aCurNode, (const xmlChar*)test_mode))
             {
-            case 'i':
-              _resource.Mode = interactive;
-              break;
-           case 'b':
-              _resource.Mode = batch;
-              break;
-            default:
-              // If it'not in all theses cases, the mode is affected to interactive
-              _resource.Mode = interactive;
-              break;
+             xmlChar* mode=xmlGetProp(aCurNode, (const xmlChar*)test_mode);
+             switch ( mode[0] )
+                {
+                case 'i':
+                  _resource.Mode = interactive;
+                  break;
+               case 'b':
+                  _resource.Mode = batch;
+                  break;
+                default:
+                  // If it'not in all theses cases, the mode is affected to interactive
+                  _resource.Mode = interactive;
+                  break;
+                }
+              xmlFree(mode);
             }
-          xmlFree(mode);
+          else
+            _resource.Mode = interactive;
 
          if (xmlHasProp(aCurNode, (const xmlChar*)test_batch))
             {