]> SALOME platform Git repositories - modules/yacs.git/blobdiff - src/runtime/SalomeContainerTools.cxx
Salome HOME
Workload manager and attach on cloning.
[modules/yacs.git] / src / runtime / SalomeContainerTools.cxx
index 6cc052191b4088c6f05fef771832c916dd389550..a6c29fe105204de414cbb3dc16bf2bbfe3d8b32e 100644 (file)
@@ -16,7 +16,7 @@
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
+#define _DEVDEBUG_
 #include "SalomeContainerTools.hxx"
 #include "SALOME_LifeCycleCORBA.hxx"
 #include "SALOME_NamingService.hxx"
@@ -334,7 +334,7 @@ void SalomeContainerToolsBase::Start(const std::vector<std::string>& compoNames,
 
   bool isEmptyName;
   std::string str(sct.getNotNullContainerName(cont,askingNode,isEmptyName));
-  DEBTRACE("SalomeContainer::start " << str <<";"<< _sct.getHostName() <<";"<<_type);
+  DEBTRACE("SalomeContainer::start " << str <<";"<< sct.getHostName() );
 
   // Finalize parameters with components found in the container
 
@@ -370,6 +370,7 @@ void SalomeContainerToolsBase::Start(const std::vector<std::string>& compoNames,
       myparams.mode="get";
       try
       {
+          DEBTRACE("GiveContainer " << str << " mode " << myparams.mode);
           trueCont=contManager->GiveContainer(myparams);
       }
       catch( const SALOME::SALOME_Exception& ex )
@@ -386,13 +387,13 @@ void SalomeContainerToolsBase::Start(const std::vector<std::string>& compoNames,
       if(!CORBA::is_nil(trueCont))
         {
           shutdownLevel=3;
-          DEBTRACE( "container found: " << str << " " << _shutdownLevel );
+          DEBTRACE( "container found: " << str << " " << shutdownLevel );
         }
       else
         {
           shutdownLevel=2;
           myparams.mode="start";
-          DEBTRACE( "container not found: " << str << " " << _shutdownLevel);
+          DEBTRACE( "container not found: " << str << " " << shutdownLevel);
         }
     }
 
@@ -403,6 +404,7 @@ void SalomeContainerToolsBase::Start(const std::vector<std::string>& compoNames,
     {
           // --- GiveContainer is used in batch mode to retreive launched containers,
           //     and is equivalent to StartContainer when not in batch.
+          DEBTRACE("GiveContainer " << str << " mode " << myparams.mode);
           trueCont=contManager->GiveContainer(myparams);
     }
     catch( const SALOME::SALOME_Exception& ex )
@@ -414,7 +416,8 @@ void SalomeContainerToolsBase::Start(const std::vector<std::string>& compoNames,
     }
     catch(CORBA::COMM_FAILURE&)
     {
-      std::cerr << "SalomeContainer::start : CORBA Comm failure detected. Make another try!" << std::endl;
+      //std::cerr << "SalomeContainer::start : CORBA Comm failure detected. Make another try!" << std::endl;
+      DEBTRACE("SalomeContainer::start :" << str << " :CORBA Comm failure detected. Make another try!");
       nbTries++;
       if(nbTries > 5)
         throw Exception("SalomeContainer::start : Unable to launch container in Salome : CORBA Comm failure detected");
@@ -428,10 +431,12 @@ void SalomeContainerToolsBase::Start(const std::vector<std::string>& compoNames,
   if(CORBA::is_nil(trueCont))
     throw Exception("SalomeContainer::start : Unable to launch container in Salome. Check your CatalogResources.xml file");
 
+  // TODO : thread safety!
   schelp->setContainer(askingNode,trueCont);
 
   CORBA::String_var containerName(trueCont->name()),hostName(trueCont->getHostName());
-  std::cerr << "SalomeContainer launched : " << containerName << " " << hostName << " " << trueCont->getPID() << std::endl;
+  //std::cerr << "SalomeContainer launched : " << containerName << " " << hostName << " " << trueCont->getPID() << std::endl;
+  DEBTRACE("SalomeContainer launched : " << containerName << " " << hostName << " " << trueCont->getPID() );
 }
 
 CORBA::Object_ptr SalomeContainerToolsBase::LoadComponent(SalomeContainerHelper *launchModeType, Container *cont, Task *askingNode)