Salome HOME
ADD a end user module (services.py) to help the manipulation of SALOME KERNEL service...
[modules/kernel.git] / src / ParallelContainer / SALOME_ParallelContainer_i.cxx
index d39f0a799a1baecc7747a21128207cad0ae1ac80..888b1e358a4ffb448d7509f95cc9761f8582051b 100644 (file)
@@ -1,25 +1,24 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011  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
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//  SALOME_ParallelContainer : implementation of container and engine for ParallelKernel
 //  File   : SALOME_ParallelContainer_i.cxx
 //  Author : André RIBES, EDF
 
@@ -50,7 +49,6 @@ int SIGUSR1 = 1000;
 #include <Python.h>
 #include "Container_init_python.hxx"
 
-using namespace std;
 
 bool _Sleeping = false ;
 
@@ -73,11 +71,11 @@ extern "C" {void SigIntHandler( int ) ; }
 //=============================================================================
 
 Engines_Parallel_Container_i::Engines_Parallel_Container_i (CORBA::ORB_ptr orb, 
-                                                           char * ior, 
-                                                           int rank,
-                                                           PortableServer::POA_ptr poa,
-                                                           std::string containerName,
-                                                           bool isServantAloneInProcess) :
+                                                            char * ior, 
+                                                            int rank,
+                                                            PortableServer::POA_ptr poa,
+                                                            std::string containerName,
+                                                            bool isServantAloneInProcess) :
   InterfaceParallel_impl(orb,ior,rank), 
   Engines::PACO_Container_serv(orb,ior,rank),
   Engines::PACO_Container_base_serv(orb,ior,rank),
@@ -243,7 +241,7 @@ void Engines_Parallel_Container_i::Shutdown()
   /* For each seq component contained in this container
   * tell it to self-destroy
   */
-  std::map<std::string, Engines::Component_var>::iterator itm;
+  std::map<std::string, Engines::EngineComponent_var>::iterator itm;
   for (itm = _listInstances_map.begin(); itm != _listInstances_map.end(); itm++)
   {
     try
@@ -289,15 +287,17 @@ void Engines_Parallel_Container_i::Shutdown()
 //=============================================================================
 
 bool
-Engines_Parallel_Container_i::load_component_Library(const char* componentName)
+Engines_Parallel_Container_i::load_component_Library(const char* componentName, CORBA::String_out reason)
 {
+  reason=CORBA::string_dup("");
+
   MESSAGE("Begin of load_component_Library : " << componentName)
   bool ret = false;
   std::string aCompName = componentName;
 #ifndef WIN32
-  string impl_name = string ("lib") + aCompName + string("Engine.so");
+  std::string impl_name = string ("lib") + aCompName + string("Engine.so");
 #else
-  string impl_name = aCompName + string("Engine.dll");
+  std::string impl_name = aCompName + string("Engine.dll");
 #endif
 
   _numInstanceMutex.lock(); // lock to be alone 
@@ -347,8 +347,8 @@ Engines_Parallel_Container_i::load_component_Library(const char* componentName)
     PyObject *globals = PyModule_GetDict(mainmod);
     PyObject *pyCont = PyDict_GetItemString(globals, "pyCont");
     PyObject *result = PyObject_CallMethod(pyCont,
-                                          (char*)"import_component",
-                                          (char*)"s",componentName);
+                                           (char*)"import_component",
+                                           (char*)"s",componentName);
     std::string ret_p= PyString_AsString(result);
     Py_XDECREF(result);
     Py_RELEASE_NEW_THREAD;
@@ -381,24 +381,51 @@ Engines_Parallel_Container_i::load_component_Library(const char* componentName)
  *  \return a loaded component
  */
 //=============================================================================
-
-Engines::Component_ptr
+Engines::EngineComponent_ptr
 Engines_Parallel_Container_i::create_component_instance(const char*genericRegisterName,
-                                                       CORBA::Long studyId)
+                                                        CORBA::Long studyId)
+{
+  Engines::FieldsDict_var env = new Engines::FieldsDict;
+  char* reason;
+  Engines::EngineComponent_ptr compo = create_component_instance_env(genericRegisterName,studyId,env, reason);
+  CORBA::string_free(reason);
+  return compo;
+}
+
+//=============================================================================
+//! Create a new component instance
+/*! 
+ *  CORBA method: Creates a new servant instance of a component.
+ *  The servant registers itself to naming service and Registry.
+ *  \param genericRegisterName  Name of the component instance to register
+ *                         in Registry & Name Service (without _inst_n suffix)
+ *  \param studyId         0 for multiStudy instance, 
+ *                         study Id (>0) otherwise
+ *  \param env             dict of environment variables
+ *  \return a loaded component
+ */
+//=============================================================================
+
+Engines::EngineComponent_ptr
+Engines_Parallel_Container_i::create_component_instance_env(const char*genericRegisterName,
+                                                            CORBA::Long studyId,
+                                                            const Engines::FieldsDict& env,
+                                                            CORBA::String_out reason)
 {
   MESSAGE("Begin of create_component_instance in node : " << getMyRank());
+  reason=CORBA::string_dup("");
 
   if (studyId < 0)
   {
     INFOS("studyId must be > 0 for mono study instance, =0 for multiStudy");
-    return Engines::Component::_nil() ;
+    return Engines::EngineComponent::_nil() ;
   }
 
   std::string aCompName = genericRegisterName;
 #ifndef WIN32
-  string impl_name = string ("lib") + aCompName +string("Engine.so");
+  std::string impl_name = string ("lib") + aCompName +string("Engine.so");
 #else
-  string impl_name = aCompName +string("Engine.dll");
+  std::string impl_name = aCompName +string("Engine.dll");
 #endif
 
   _numInstanceMutex.lock();
@@ -416,10 +443,10 @@ Engines_Parallel_Container_i::create_component_instance(const char*genericRegist
   {
     std::cerr << "Component library is not loaded or imported ! lib was : " << aCompName << std::endl;
     _numInstanceMutex.unlock();
-    return Engines::Component::_nil();
+    return Engines::EngineComponent::_nil();
   }
 
-  Engines::Component_var iobject = Engines::Component::_nil();
+  Engines::EngineComponent_var iobject = Engines::EngineComponent::_nil();
   if (type_of_lib == "cpp")
     iobject = createCPPInstance(aCompName, handle, studyId);
   else
@@ -441,21 +468,21 @@ Engines_Parallel_Container_i::create_component_instance(const char*genericRegist
  */
 //=============================================================================
 
-Engines::Component_ptr Engines_Parallel_Container_i::find_component_instance( const char* registeredName,
-                                                                             CORBA::Long studyId)
+Engines::EngineComponent_ptr Engines_Parallel_Container_i::find_component_instance( const char* registeredName,
+                                                                              CORBA::Long studyId)
 {
-  Engines::Component_var anEngine = Engines::Component::_nil();
-  map<string,Engines::Component_var>::iterator itm =_listInstances_map.begin();
+  Engines::EngineComponent_var anEngine = Engines::EngineComponent::_nil();
+  std::map<std::string,Engines::EngineComponent_var>::iterator itm =_listInstances_map.begin();
   while (itm != _listInstances_map.end())
   {
-    string instance = (*itm).first;
+    std::string instance = (*itm).first;
     SCRUTE(instance);
     if (instance.find(registeredName) == 0)
     {
       anEngine = (*itm).second;
       if (studyId == anEngine->getStudyId())
       {
-       return anEngine._retn();
+        return anEngine._retn();
       }
     }
     itm++;
@@ -478,12 +505,14 @@ Engines::Component_ptr Engines_Parallel_Container_i::find_component_instance( co
  */
 //=============================================================================
 
-Engines::Component_ptr Engines_Parallel_Container_i::load_impl( const char* genericRegisterName,
-                                                               const char* componentName )
+Engines::EngineComponent_ptr Engines_Parallel_Container_i::load_impl( const char* genericRegisterName,
+                                                                const char* componentName )
 {
-  Engines::Component_var iobject = Engines::Component::_nil();
-  if (load_component_Library(genericRegisterName))
+  Engines::EngineComponent_var iobject = Engines::EngineComponent::_nil();
+  char* reason;
+  if (load_component_Library(genericRegisterName,reason))
     iobject = find_or_create_instance(genericRegisterName);
+  CORBA::string_free(reason);
   return iobject._retn();
 }
 
@@ -496,13 +525,13 @@ Engines::Component_ptr Engines_Parallel_Container_i::load_impl( const char* gene
  */
 //=============================================================================
 
-void Engines_Parallel_Container_i::remove_impl(Engines::Component_ptr component_i)
+void Engines_Parallel_Container_i::remove_impl(Engines::EngineComponent_ptr component_i)
 {
   ASSERT(!CORBA::is_nil(component_i));
-  string instanceName = component_i->instanceName();
+  std::string instanceName = component_i->instanceName();
   _numInstanceMutex.lock() ; // lock to be alone (stl container write)
   // Test if the component is in this container
-  std::map<std::string, Engines::Component_var>::iterator itm;
+  std::map<std::string, Engines::EngineComponent_var>::iterator itm;
   itm = _listInstances_map.find(instanceName);
   if (itm != _listInstances_map.end())
   {
@@ -529,11 +558,11 @@ void Engines_Parallel_Container_i::finalize_removal()
   MESSAGE("WARNING FINALIZE DOES CURRENTLY NOTHING !!!");
 
   // (see decInstanceCnt, load_component_Library)
-  //map<string, void *>::iterator ith;
+  //std::map<std::string, void *>::iterator ith;
   //for (ith = _toRemove_map.begin(); ith != _toRemove_map.end(); ith++)
   //{
   //  void *handle = (*ith).second;
-  //  string impl_name= (*ith).first;
+  //  std::string impl_name= (*ith).first;
   //  if (handle)
   //  {
   //    SCRUTE(handle);
@@ -559,8 +588,8 @@ void Engines_Parallel_Container_i::finalize_removal()
 bool Engines_Parallel_Container_i::Kill_impl()
 {
   MESSAGE("Engines_Parallel_Container_i::Kill() my pid is "<< _pid 
-         << " my containerName is " << _containerName.c_str() 
-         << " my machineName is " << _hostname.c_str());
+          << " my containerName is " << _containerName.c_str() 
+          << " my machineName is " << _hostname.c_str());
   INFOS("===============================================================");
   INFOS("= REMOVE calls to Kill_impl in C++ container                  =");
   INFOS("===============================================================");
@@ -585,7 +614,7 @@ bool Engines_Parallel_Container_i::Kill_impl()
 Engines::fileRef_ptr
 Engines_Parallel_Container_i::createFileRef(const char* origFileName)
 {
-  string origName(origFileName);
+  std::string origName(origFileName);
   Engines::fileRef_var theFileRef = Engines::fileRef::_nil();
 
   if (origName[0] != '/')
@@ -680,33 +709,33 @@ Engines_Parallel_Container_i::createSalome_file(const char* origFileName)
  */
 //=============================================================================
 
-Engines::Component_ptr
-Engines_Parallel_Container_i::find_or_create_instance(string genericRegisterName)
+Engines::EngineComponent_ptr
+Engines_Parallel_Container_i::find_or_create_instance(std::string genericRegisterName)
 {
-  Engines::Component_var iobject = Engines::Component::_nil();
+  Engines::EngineComponent_var iobject = Engines::EngineComponent::_nil();
   try
   {
-    string aGenRegisterName = genericRegisterName;
+    std::string aGenRegisterName = genericRegisterName;
     // --- find a registered instance in naming service, or create
-    string component_registerBase = _containerName + "/" + aGenRegisterName;
+    std::string component_registerBase = _containerName + "/" + aGenRegisterName;
     CORBA::Object_var obj = _NS->ResolveFirst(component_registerBase.c_str());
     if (CORBA::is_nil( obj ))
     {
       iobject = create_component_instance(genericRegisterName.c_str(), 
-                                         0); // force multiStudy instance here !
+                                          0); // force multiStudy instance here !
     }
     else
     { 
-      iobject = Engines::Component::_narrow(obj) ;
+      iobject = Engines::EngineComponent::_narrow(obj) ;
       Engines_Component_i *servant = dynamic_cast<Engines_Component_i*>(_poa->reference_to_servant(iobject));
       ASSERT(servant)
       int studyId = servant->getStudyId();
       ASSERT (studyId >= 0);
       if (studyId != 0)  // monoStudy instance: NOK
       {
-       iobject = Engines::Component::_nil();
-       INFOS("load_impl & find_component_instance methods "
-             << "NOT SUITABLE for mono study components");
+        iobject = Engines::EngineComponent::_nil();
+        INFOS("load_impl & find_component_instance methods "
+              << "NOT SUITABLE for mono study components");
       }
     }
   }
@@ -738,36 +767,39 @@ Engines_Parallel_Container_i::find_or_create_instance(string genericRegisterName
  *  component_registerName = /Containers/cli76ce/FactoryServer/COMPONENT_inst_1
  */
 //=============================================================================
-Engines::Component_ptr
-Engines_Parallel_Container_i::createPythonInstance(string genericRegisterName, int studyId)
+Engines::EngineComponent_ptr
+Engines_Parallel_Container_i::createPythonInstance(std::string genericRegisterName, int studyId)
 {
 
-  Engines::Component_var iobject = Engines::Component::_nil();
+  Engines::EngineComponent_var iobject = Engines::EngineComponent::_nil();
 
   int numInstance = _numInstance;
   char aNumI[12];
   sprintf( aNumI , "%d" , numInstance ) ;
-  string instanceName = genericRegisterName + "_inst_" + aNumI ;
-  string component_registerName = _containerName + "/" + instanceName;
+  std::string instanceName = genericRegisterName + "_inst_" + aNumI ;
+  std::string component_registerName = _containerName + "/" + instanceName;
 
   Py_ACQUIRE_NEW_THREAD;
   PyObject *mainmod = PyImport_AddModule("__main__");
   PyObject *globals = PyModule_GetDict(mainmod);
   PyObject *pyCont = PyDict_GetItemString(globals, "pyCont");
   PyObject *result = PyObject_CallMethod(pyCont,
-                                        (char*)"create_component_instance",
-                                        (char*)"ssl",
-                                        genericRegisterName.c_str(),
-                                        instanceName.c_str(),
-                                        studyId);
-  std::string iors = PyString_AsString(result);
+                                         (char*)"create_component_instance",
+                                         (char*)"ssl",
+                                         genericRegisterName.c_str(),
+                                         instanceName.c_str(),
+                                         studyId);
+  const char *ior;
+  const char *error;
+  PyArg_ParseTuple(result,"ss", &ior, &error);
+  string iors = ior;
   Py_DECREF(result);
   Py_RELEASE_NEW_THREAD;
 
   if( iors!="" )
   {
     CORBA::Object_var obj = _orb->string_to_object(iors.c_str());
-    iobject = Engines::Component::_narrow(obj);
+    iobject = Engines::EngineComponent::_narrow(obj);
     _listInstances_map[instanceName] = iobject;
   }
   else
@@ -797,17 +829,17 @@ Engines_Parallel_Container_i::createPythonInstance(string genericRegisterName, i
  *  component_registerName = /Containers/cli76ce/FactoryServer/COMPONENT_inst_1
  */
 //=============================================================================
-Engines::Component_ptr
-Engines_Parallel_Container_i::createCPPInstance(string genericRegisterName,
-                                               void *handle,
-                                               int studyId)
+Engines::EngineComponent_ptr
+Engines_Parallel_Container_i::createCPPInstance(std::string genericRegisterName,
+                                                void *handle,
+                                                int studyId)
 {
   MESSAGE("Entering Engines_Parallel_Container_i::createCPPInstance");
 
   // --- find the factory
 
-  string aGenRegisterName = genericRegisterName;
-  string factory_name = aGenRegisterName + string("Engine_factory");
+  std::string aGenRegisterName = genericRegisterName;
+  std::string factory_name = aGenRegisterName + string("Engine_factory");
 
   typedef  PortableServer::ObjectId * (*FACTORY_FUNCTION_2)
     (CORBA::ORB_ptr,
@@ -829,25 +861,25 @@ Engines_Parallel_Container_i::createCPPInstance(string genericRegisterName,
 #ifndef WIN32
     INFOS("dlerror() result is : " << dlerror());
 #endif
-    return Engines::Component::_nil() ;
+    return Engines::EngineComponent::_nil() ;
   }
 
   // --- create instance
-  Engines::Component_var iobject = Engines::Component::_nil() ;
+  Engines::EngineComponent_var iobject = Engines::EngineComponent::_nil() ;
   try
   {
     int numInstance = _numInstance;
     char aNumI[12];
     sprintf( aNumI , "%d" , numInstance );
-    string instanceName = aGenRegisterName + "_inst_" + aNumI;
-    string component_registerName =
+    std::string instanceName = aGenRegisterName + "_inst_" + aNumI;
+    std::string component_registerName =
       _containerName + "/" + instanceName;
 
     // --- Instanciate required CORBA object
 
     PortableServer::ObjectId *id; //not owner, do not delete (nore use var)
     id = (Component_factory) ( _orb, _poa, _id, instanceName.c_str(),
-                              aGenRegisterName.c_str() );
+                               aGenRegisterName.c_str() );
     if (id == NULL)
     {
       INFOS("Factory function returns NULL !");
@@ -856,7 +888,7 @@ Engines_Parallel_Container_i::createCPPInstance(string genericRegisterName,
 
     // --- get reference & servant from id
     CORBA::Object_var obj = _poa->id_to_reference(*id);
-    iobject = Engines::Component::_narrow(obj);
+    iobject = Engines::EngineComponent::_narrow(obj);
 
     Engines_Component_i *servant = 
       dynamic_cast<Engines_Component_i*>(_poa->reference_to_servant(iobject));
@@ -885,12 +917,12 @@ Engines_Parallel_Container_i::createCPPInstance(string genericRegisterName,
 
 void
 Engines_Parallel_Container_i::create_paco_component_node_instance(const char* componentName,
-                                                                 const char* proxy_containerName,
-                                                                 CORBA::Long studyId)
+                                                                  const char* proxy_containerName,
+                                                                  CORBA::Long studyId)
 {
   // Init de la méthode
   char * proxy_ior;
-  Engines::Component_PaCO_var work_node;
+  Engines::EngineComponent_PaCO_var work_node;
   std::string aCompName = componentName;
   std::string _proxy_containerName = proxy_containerName;
 
@@ -911,7 +943,7 @@ Engines_Parallel_Container_i::create_paco_component_node_instance(const char* co
   // Step 1 : Get proxy !
   string component_registerName = _proxy_containerName + "/" + instanceName;
   CORBA::Object_var temp = _NS->Resolve(component_registerName.c_str());
-  Engines::Component_var obj_proxy = Engines::Component::_narrow(temp);
+  Engines::EngineComponent_var obj_proxy = Engines::EngineComponent::_narrow(temp);
   if (CORBA::is_nil(obj_proxy))
   {
     INFOS("Proxy reference from NamingService is nil !");
@@ -943,8 +975,8 @@ Engines_Parallel_Container_i::create_paco_component_node_instance(const char* co
   {
     char aNumI2[12];
     sprintf(aNumI2 , "%d" , getMyRank()) ;
-    string instanceName = aCompName + "_inst_" + aNumI + "_work_node_" + aNumI2;
-    string component_registerName = _containerName + "/" + instanceName;
+    std::string instanceName = aCompName + "_inst_" + aNumI + "_work_node_" + aNumI2;
+    std::string component_registerName = _containerName + "/" + instanceName;
 
     // --- Instanciate work node
     PortableServer::ObjectId *id ; //not owner, do not delete (nore use var)
@@ -953,7 +985,7 @@ Engines_Parallel_Container_i::create_paco_component_node_instance(const char* co
 
     // --- get reference & servant from id
     CORBA::Object_var obj = _poa->id_to_reference(*id);
-    work_node = Engines::Component_PaCO::_narrow(obj) ;
+    work_node = Engines::EngineComponent_PaCO::_narrow(obj) ;
     if (CORBA::is_nil(work_node))
     {
       INFOS("work_node reference from factory is nil !");
@@ -984,11 +1016,11 @@ Engines_Parallel_Container_i::create_paco_component_node_instance(const char* co
  */
 //=============================================================================
 
-void Engines_Parallel_Container_i::decInstanceCnt(string genericRegisterName)
+void Engines_Parallel_Container_i::decInstanceCnt(std::string genericRegisterName)
 {
   if(_cntInstances_map.count(genericRegisterName) !=0 )
   {
-    string aGenRegisterName =genericRegisterName;
+    std::string aGenRegisterName =genericRegisterName;
     MESSAGE("Engines_Parallel_Container_i::decInstanceCnt " << aGenRegisterName);
     ASSERT(_cntInstances_map[aGenRegisterName] > 0); 
     _numInstanceMutex.lock(); // lock to be alone
@@ -997,8 +1029,8 @@ void Engines_Parallel_Container_i::decInstanceCnt(string genericRegisterName)
     SCRUTE(_cntInstances_map[aGenRegisterName]);
     if (_cntInstances_map[aGenRegisterName] == 0)
     {
-      string impl_name =
-       Engines_Component_i::GetDynLibraryName(aGenRegisterName.c_str());
+      std::string impl_name =
+        Engines_Component_i::GetDynLibraryName(aGenRegisterName.c_str());
       SCRUTE(impl_name);
       void* handle = _library_map[impl_name];
       ASSERT(handle);
@@ -1082,6 +1114,27 @@ Engines_Parallel_Container_i::copyFile(Engines::Container_ptr container, const c
     }
 }
 
+/*! \brief create a PyNode object to execute remote python code
+ * \param nodeName the name of the node
+ * \param code the python code to load
+ * \return the PyNode
+ */
+Engines::PyNode_ptr 
+Engines_Parallel_Container_i::createPyNode(const char* nodeName, const char* code)
+{
+  INFOS("Python component not yet implemented");
+  Engines::PyNode_var node= Engines::PyNode::_nil();
+  return node._retn();
+}
+
+Engines::PyScriptNode_ptr 
+Engines_Parallel_Container_i::createPyScriptNode(const char* nodeName, const char* cod)
+{
+  INFOS("Python script node not yet implemented");
+  Engines::PyScriptNode_var node= Engines::PyScriptNode::_nil();
+  return node._retn();
+}
+
 //=============================================================================
 /*! 
  *  
@@ -1135,7 +1188,7 @@ void CallCancelThread();
 
 #ifndef WIN32
 void SigIntHandler(int what , siginfo_t * siginfo ,
-                  void * toto ) {
+                   void * toto ) {
   //PAL9042 JR : during the execution of a Signal Handler (and of methods called through Signal Handlers)
   //             use of streams (and so on) should never be used because :
   //             streams of C++ are naturally thread-safe and use pthread_mutex_lock ===>
@@ -1165,8 +1218,8 @@ void SigIntHandler(int what , siginfo_t * siginfo ,
       //      MESSAGE("SigIntHandler BEGIN sleeping.") ;
       int count = 0 ;
       while( _Sleeping ) {
-       sleep( 1 ) ;
-       count += 1 ;
+        sleep( 1 ) ;
+        count += 1 ;
       }
       //      MESSAGE("SigIntHandler LEAVE sleeping after " << count << " s.") ;
     }
@@ -1191,8 +1244,8 @@ void SigIntHandler( int what ) {
       MESSAGE("SigIntHandler BEGIN sleeping.") ;
       int count = 0 ;
       while( _Sleeping ) {
-       Sleep( 1000 ) ;
-       count += 1 ;
+        Sleep( 1000 ) ;
+        count += 1 ;
       }
       MESSAGE("SigIntHandler LEAVE sleeping after " << count << " s.") ;
     }
@@ -1200,4 +1253,3 @@ void SigIntHandler( int what ) {
   }
 }
 #endif
-