Salome HOME
Patch for new version of LIBBATCH
[modules/kernel.git] / src / Launcher / SALOME_Launcher_Handler.cxx
index 31b4e7ce1c0beec25eb2fb3f8b05c1f3ad814834..db9f316005ec864ddad7803c54dfd2ba07c57665 100755 (executable)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -19,6 +19,7 @@
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
 //  File   : SALOME_Laucher_Handler.cxx
 //  Author : Bernard Secher
 #include <iostream>
 #include <map>
 
-using namespace std;
-
-#ifdef _DEBUG_
-static int MYDEBUG = 1;
-#else
-static int MYDEBUG = 0;
-#endif
-
 //=============================================================================
 /*!
  *  Constructor
@@ -108,26 +101,26 @@ void SALOME_Launcher_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
     if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_machine_list) ){
       xmlNodePtr aCurNode2 = aCurNode->xmlChildrenNode;
       while(aCurNode2 != NULL){
-       if ( !xmlStrcmp(aCurNode2->name,(const xmlChar*)test_machine) ){
-         _machp.Clear();
-         xmlChar* name = xmlNodeGetContent(aCurNode2);
-         string clusterName = (const char*)name;
-         xmlFree(name);
-       
-         if (xmlHasProp(aCurNode2, (const xmlChar*)test_env_file)){
-           xmlChar* envfile = xmlGetProp(aCurNode2, (const xmlChar*)test_env_file);
-           _machp.EnvFile = (const char*)envfile;
-           xmlFree(envfile);
-         }
-
-         if (xmlHasProp(aCurNode2, (const xmlChar*)test_work_directory)){
-           xmlChar* workdirectory = xmlGetProp(aCurNode2, (const xmlChar*)test_work_directory);
-           _machp.WorkDirectory = (const char*)workdirectory;
-           xmlFree(workdirectory);
-         }
-         _launch.MachinesList[clusterName]=_machp ;
-       }
-       aCurNode2 = aCurNode2->next;
+        if ( !xmlStrcmp(aCurNode2->name,(const xmlChar*)test_machine) ){
+          _machp.Clear();
+          xmlChar* name = xmlNodeGetContent(aCurNode2);
+          std::string clusterName = (const char*)name;
+          xmlFree(name);
+        
+          if (xmlHasProp(aCurNode2, (const xmlChar*)test_env_file)){
+            xmlChar* envfile = xmlGetProp(aCurNode2, (const xmlChar*)test_env_file);
+            _machp.EnvFile = (const char*)envfile;
+            xmlFree(envfile);
+          }
+
+          if (xmlHasProp(aCurNode2, (const xmlChar*)test_work_directory)){
+            xmlChar* workdirectory = xmlGetProp(aCurNode2, (const xmlChar*)test_work_directory);
+            _machp.WorkDirectory = (const char*)workdirectory;
+            xmlFree(workdirectory);
+          }
+          _launch.MachinesList[clusterName]=_machp ;
+        }
+        aCurNode2 = aCurNode2->next;
       }
     }
 
@@ -136,31 +129,31 @@ void SALOME_Launcher_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
       _launch.RefDirectory = (const char*)refdirectory;
       xmlFree(refdirectory);
     }
-         
+          
     if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_nb_processes) ){
       xmlChar* nbofprocesses = xmlNodeGetContent(aCurNode);
       _launch.NbOfProcesses = atoi((const char*)nbofprocesses);
       xmlFree(nbofprocesses);
     }
-         
+          
     if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_input_file) ){
       xmlChar* inputfile = xmlNodeGetContent(aCurNode);
       _launch.InputFile.push_back((const char*)inputfile);
       xmlFree(inputfile);
     }
-         
+          
     if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_output_file) ){
       xmlChar* outputfile = xmlNodeGetContent(aCurNode);
       _launch.OutputFile.push_back((const char*)outputfile);
       xmlFree(outputfile);
     }
-         
+          
     if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_command) ){
       xmlChar* command = xmlNodeGetContent(aCurNode);
       _launch.Command = (const char*)command;
       xmlFree(command);
     }
-         
+          
     aCurNode = aCurNode->next;
   }