Salome HOME
PR: merge from branch BR_3_1_0deb tag mergeto_trunk_22dec05
authorprascle <prascle>
Thu, 22 Dec 2005 14:01:32 +0000 (14:01 +0000)
committerprascle <prascle>
Thu, 22 Dec 2005 14:01:32 +0000 (14:01 +0000)
34 files changed:
INSTALL
bin/VERSION
bin/launchConfigureParser.py
bin/runSalome.py
doc/salome/tui/KERNEL/doxyfile
doc/salome/tui/KERNEL/sources/static/tree.js
resources/CatalogResources.xml
resources/KERNELCatalog.xml
salome_adm/unix/config_files/check_lam.m4
salome_adm/unix/config_files/check_omniorb.m4
salome_adm/unix/config_files/check_qwt.m4
salome_adm/unix/pythonbe.py [new file with mode: 0644]
src/Container/Component_i.cxx
src/Container/Container_i.cxx
src/Container/SALOME_ContainerManager.cxx
src/Container/SALOME_ContainerManager.hxx
src/Container/SALOME_ContainerPy.py
src/KERNEL_PY/Makefile.in
src/KERNEL_PY/kernel_shared_modules.py
src/KERNEL_PY/omnipatch.py [new file with mode: 0644]
src/KERNEL_PY/salome.py
src/KERNEL_PY/salome_shared_modules.py
src/KERNEL_PY/salome_test.py
src/LifeCycleCORBA/Launchers.hxx
src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx
src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i
src/MPIContainer/MPIContainer_i.cxx
src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx
src/NamingService/SALOME_NamingService.cxx
src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx
src/ResourcesManager/SALOME_ResourcesManager.cxx
src/ResourcesManager/SALOME_ResourcesManager.hxx
src/SALOMELocalTrace/LocalTraceBufferPool.cxx
src/TOOLSDS/SALOMEDS_Tool.cxx

diff --git a/INSTALL b/INSTALL
index 526e28e9f9c72b2cf0532e985e4b02fee601aa7e..5feb42fc3910ebac6259ca97caf67f618b7c6ca5 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,4 +1,4 @@
-This is the version 3.1.0b1 of KERNEL
+This is the version 3.1.0 of KERNEL
 Previous versions :
         - 3.0.0
         - 2.2.4
index 3775769376481f8d7f863efe4d8e0aff0fd2c9c0..140772c2747a2599667a2784497cf28e48b2c7ee 100755 (executable)
@@ -1 +1 @@
-THIS IS SALOME - KERNEL VERSION: 3.1.0b1
+THIS IS SALOME - KERNEL VERSION: 3.1.0
index 0de312b040119b4e102d3eed6f5941d31f293454..a9d0c273ca2fdb6f1e67db623b5a7b0e8775b302 100755 (executable)
@@ -26,6 +26,7 @@ standalone_nam = "standalone"
 containers_nam = "containers"
 key_nam        = "key"
 interp_nam     = "interp"
+except_nam     = "noexcepthandler"
 
 # values in XML configuration file giving specific module parameters (<module_name> section)
 # which are stored in opts with key <module_name>_<parameter> (eg SMESH_plugins)
@@ -38,7 +39,7 @@ appname        = "SalomeApp"
 
 # values of boolean type (must be '0' or '1').
 # xml_parser.boolValue() is used for correct setting
-boolKeys = ( gui_nam, splash_nam, logger_nam, file_nam, xterm_nam, portkill_nam, killall_nam, interp_nam )
+boolKeys = ( gui_nam, splash_nam, logger_nam, file_nam, xterm_nam, portkill_nam, killall_nam, interp_nam, except_nam )
 
 # values of list type
 listKeys = ( containers_nam, embedded_nam, key_nam, modules_nam, standalone_nam, plugins_nam )
@@ -275,7 +276,7 @@ except:
 
 opterror=0
 for opt in cmd_opts:
-    if not opt in ("h","g","l","f","x","m","e","s","c","p","k","t","i"):
+    if not opt in ("h","g","l","f","x","m","e","s","c","p","k","t","i","r"):
         print "command line error: -", opt
         opterror=1
 
@@ -306,6 +307,7 @@ if cmd_opts.has_key("h"):
     --killall or -k               : kill all salome sessions
     --interp=n or -i=n            : number of additional xterm to open, with session environment
     -z                            : display splash screen
+    -r                            : disable centralized exception handling mechanism
     
     For each Salome module, the environment variable <modulen>_ROOT_DIR must be set.
     The module name (<modulen>) must be uppercase.
@@ -320,6 +322,8 @@ for opt in cmd_opts:
         args[gui_nam] = 1
     elif opt == 'z':
        args[splash_nam] = 1
+    elif opt == 'r':
+       args[except_nam] = 1
     elif opt == 'l':
         args[logger_nam] = 1
     elif opt == 'f':
index c4773d189c718681464821f4209195be5c7574ae..9d0a669711ce120fc1f792b9b2672313730f2ede 100755 (executable)
@@ -184,9 +184,12 @@ def set_env(args, modules_list, modules_root_dir):
         if not os.getenv("SalomeAppConfig"): os.environ["SalomeAppConfig"] =  os.getenv("GUI_ROOT_DIR") + "/share/salome/resources"
         pass   
 
-    os.environ["CSF_PluginDefaults"] \
-    = os.path.join(modules_root_dir["KERNEL"],"share",
-                   salome_subdir,"resources")
+    # set CSF_PluginDefaults variable only if it is not customized
+    # by the user
+    if not os.getenv("CSF_PluginDefaults"):
+        os.environ["CSF_PluginDefaults"] \
+        = os.path.join(modules_root_dir["KERNEL"],"share",
+                       salome_subdir,"resources")
     os.environ["CSF_SALOMEDS_ResourcesDefaults"] \
     = os.path.join(modules_root_dir["KERNEL"],"share",
                    salome_subdir,"resources")
@@ -408,6 +411,8 @@ class SessionServer(Server):
             self.SCMD2+=['GUI']
         if self.args['splash']:
             self.SCMD2+=['SPLASH']
+        if self.args['noexcepthandler']:
+            self.SCMD2+=['noexcepthandler']
         if self.args.has_key('modules'):
             self.SCMD2+=['--modules (']
             for mod in self.args['modules']:
index 64247b6b5979965fa42ae31fe26495a5f5358d04..1758a66e5a5fa148cc17f80fdce8865c256d9327 100755 (executable)
@@ -3,7 +3,7 @@
 #---------------------------------------------------------------------------
 # General configuration options
 #---------------------------------------------------------------------------
-PROJECT_NAME           = "SALOME v.2.1.0"
+PROJECT_NAME           = "SALOME v.3.1.0"
 PROJECT_NUMBER         = id#1.1
 OUTPUT_DIRECTORY       = ../
 OUTPUT_LANGUAGE        = English
index 18cf7f25f2104a7b810bd93871eeaad0a47908bb..0ddcfec0f6614e5ef787276d9f26027c35e1d27a 100755 (executable)
@@ -1,4 +1,4 @@
-foldersTree = gFld("<b>SALOME v.2.1.0 </b>", "", "")
+foldersTree = gFld("<b>SALOME v.3.1.0 </b>", "", "")
      insDoc(foldersTree, gLnk("Main Page", "", "main.html"))
 
 aux1 = insFld(foldersTree, gFld("TUI Reference Guide", ""))
index f83a16243be7125e12b6abea478a253cad71d475..2a074cda7eaae4ff5c973bdb8061a62c232f15bf 100644 (file)
@@ -3,44 +3,44 @@
 
 <machine hostname="is111790" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" protocol="r" mode="i" nbOfNodes="1" nbOfProcPerNode="1" preReqFilePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL/salome.sh" >
 <modules modulePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL" moduleName="KERNEL" />
-<modules modulePath="/export/home/LGLS/Products/MED_3.1.0a" moduleName="MED" />
-<modules modulePath="/export/home/LGLS/Products/GEOM_3.1.0a" moduleName="GEOM" />
-<modules modulePath="/export/home/LGLS/Products/SMESH_3.1.0a" moduleName="SMESH" />
-<modules modulePath="/export/home/LGLS/Products/SUPERV_3.1.0a" moduleName="SUPERV" />
-<modules modulePath="/export/home/LGLS/Products/VISU_3.1.0a" moduleName="VISU" />
+<modules modulePath="/export/home/LGLS/Products/MED_3.1.0" moduleName="MED" />
+<modules modulePath="/export/home/LGLS/Products/GEOM_3.1.0" moduleName="GEOM" />
+<modules modulePath="/export/home/LGLS/Products/SMESH_3.1.0" moduleName="SMESH" />
+<modules modulePath="/export/home/LGLS/Products/SUPERV_3.1.0" moduleName="SUPERV" />
+<modules modulePath="/export/home/LGLS/Products/VISU_3.1.0" moduleName="VISU" />
 <modules modulePath="/home/secher/SALOME2_INSTALL/MYCOMPO_INSTALL" moduleName="MYCOMPO" />
 <modules modulePath="/home/secher/SALOME2_INSTALL/MYMPICOMPO_INSTALL" moduleName="MYMPICOMPO" />
 </machine>
 
 <machine hostname="is111915" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" protocol="r" mode="i" nbOfNodes="1" nbOfProcPerNode="1" preReqFilePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL/salome.sh" >
 <modules modulePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL" moduleName="KERNEL" />
-<modules modulePath="/export/home/LGLS/Products/MED_3.1.0a" moduleName="MED" />
-<modules modulePath="/export/home/LGLS/Products/GEOM_3.1.0a" moduleName="GEOM" />
-<modules modulePath="/export/home/LGLS/Products/SMESH_3.1.0a" moduleName="SMESH" />
-<modules modulePath="/export/home/LGLS/Products/SUPERV_3.1.0a" moduleName="SUPERV" />
-<modules modulePath="/export/home/LGLS/Products/VISU_3.1.0a" moduleName="VISU" />
+<modules modulePath="/export/home/LGLS/Products/MED_3.1.0" moduleName="MED" />
+<modules modulePath="/export/home/LGLS/Products/GEOM_3.1.0" moduleName="GEOM" />
+<modules modulePath="/export/home/LGLS/Products/SMESH_3.1.0" moduleName="SMESH" />
+<modules modulePath="/export/home/LGLS/Products/SUPERV_3.1.0" moduleName="SUPERV" />
+<modules modulePath="/export/home/LGLS/Products/VISU_3.1.0" moduleName="VISU" />
 <modules modulePath="/home/secher/SALOME2_INSTALL/MYCOMPO_INSTALL" moduleName="MYCOMPO" />
 <modules modulePath="/home/secher/SALOME2_INSTALL/MYMPICOMPO_INSTALL" moduleName="MYMPICOMPO" />
 </machine>
 
 <machine hostname="is111918" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" protocol="r" mode="i" nbOfNodes="1" nbOfProcPerNode="1" preReqFilePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL/salome.sh" >
 <modules modulePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL" moduleName="KERNEL" />
-<modules modulePath="/export/home/LGLS/Products/MED_3.1.0a" moduleName="MED" />
-<modules modulePath="/export/home/LGLS/Products/GEOM_3.1.0a" moduleName="GEOM" />
-<modules modulePath="/export/home/LGLS/Products/SMESH_3.1.0a" moduleName="SMESH" />
-<modules modulePath="/export/home/LGLS/Products/SUPERV_3.1.0a" moduleName="SUPERV" />
-<modules modulePath="/export/home/LGLS/Products/VISU_3.1.0a" moduleName="VISU" />
+<modules modulePath="/export/home/LGLS/Products/MED_3.1.0" moduleName="MED" />
+<modules modulePath="/export/home/LGLS/Products/GEOM_3.1.0" moduleName="GEOM" />
+<modules modulePath="/export/home/LGLS/Products/SMESH_3.1.0" moduleName="SMESH" />
+<modules modulePath="/export/home/LGLS/Products/SUPERV_3.1.0" moduleName="SUPERV" />
+<modules modulePath="/export/home/LGLS/Products/VISU_3.1.0" moduleName="VISU" />
 <modules modulePath="/home/secher/SALOME2_INSTALL/MYCOMPO_INSTALL" moduleName="MYCOMPO" />
 <modules modulePath="/home/secher/SALOME2_INSTALL/MYMPICOMPO_INSTALL" moduleName="MYMPICOMPO" />
 </machine>
 
 <machine hostname="is111996" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" protocol="r" mode="i" nbOfNodes="1" nbOfProcPerNode="1" preReqFilePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL/salome.sh" >
 <modules modulePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL" moduleName="KERNEL" />
-<modules modulePath="/export/home/LGLS/Products/MED_3.1.0a" moduleName="MED" />
-<modules modulePath="/export/home/LGLS/Products/GEOM_3.1.0a" moduleName="GEOM" />
-<modules modulePath="/export/home/LGLS/Products/SMESH_3.1.0a" moduleName="SMESH" />
-<modules modulePath="/export/home/LGLS/Products/SUPERV_3.1.0a" moduleName="SUPERV" />
-<modules modulePath="/export/home/LGLS/Products/VISU_3.1.0a" moduleName="VISU" />
+<modules modulePath="/export/home/LGLS/Products/MED_3.1.0" moduleName="MED" />
+<modules modulePath="/export/home/LGLS/Products/GEOM_3.1.0" moduleName="GEOM" />
+<modules modulePath="/export/home/LGLS/Products/SMESH_3.1.0" moduleName="SMESH" />
+<modules modulePath="/export/home/LGLS/Products/SUPERV_3.1.0" moduleName="SUPERV" />
+<modules modulePath="/export/home/LGLS/Products/VISU_3.1.0" moduleName="VISU" />
 <modules modulePath="/home/secher/SALOME2_INSTALL/MYCOMPO_INSTALL" moduleName="MYCOMPO" />
 <modules modulePath="/home/secher/SALOME2_INSTALL/MYMPICOMPO_INSTALL" moduleName="MYMPICOMPO" />
 </machine>
index 298eadd2df489eda006a0447bae226af06a7f7df..836c6cadbcd869e713f2b413e22ab0453bb07e44 100644 (file)
@@ -16,7 +16,7 @@
                <component-username>Salome</component-username>
                <component-type>Other</component-type>
                <component-author>NRI</component-author>
-               <component-version>3.1.0a</component-version>
+               <component-version>3.1.0</component-version>
                <component-comment>GUI Neutral Context</component-comment>
                <component-multistudy>1</component-multistudy>
 
@@ -27,7 +27,7 @@
                <component-username>SalomeTestComponent</component-username>
                <component-type>Other</component-type>
                <component-author>NRI</component-author>
-               <component-version>3.1.0a</component-version>
+               <component-version>3.1.0</component-version>
                <component-comment>GUI Neutral Context</component-comment>
                <component-multistudy>1</component-multistudy>
                <constraint>'linux' ~ OS</constraint>
@@ -37,7 +37,7 @@
                <component-username>SALOME_TestComponentPy</component-username>
                <component-type>Other</component-type>
                <component-author>NRI</component-author>
-               <component-version>3.1.0a</component-version>
+               <component-version>3.1.0</component-version>
                <component-comment>GUI Neutral Context</component-comment>
                <component-multistudy>1</component-multistudy>
                <constraint>'linux' ~ OS</constraint>
index ae21b56fe91d53eb910fcee86b9aa7ed7f65ab54..d15fdde312cbb7238625970aabf5c089372420c9 100644 (file)
@@ -52,7 +52,6 @@ if test "$WITHLAM" = yes; then
   CPPFLAGS_old="$CPPFLAGS"
   CPPFLAGS="$MPI_INCLUDES $CPPFLAGS"
   AC_CHECK_HEADER(mpi.h,WITHLAM="yes",WITHLAM="no")
-  CPPFLAGS="$CPPFLAGS_old"
 
   if test "$WITHLAM" = "yes";then
     AC_CHECK_LIB(util,openpty,,WITHLAM="no")
@@ -62,27 +61,24 @@ if test "$WITHLAM" = yes; then
   fi
 
   if test "$WITHLAM" = "yes";then
-    WITHLAM="no"
-
-    if test "$WITHLAM" = "no";then
-      CPPFLAGS="$MPI_INCLUDES $CPPFLAGS"
-      LIBS="$LIBS -lmpi++"
-      AC_TRY_LINK([
-      #include <mpi.h>
-      ], [int argc=0; char **argv=0; MPI_Init(&argc,&argv);],
-      WITHLAM="yes",WITHLAM="no")
-      if test "$WITHLAM" = "yes";then
-        MPI_LIBS="$MPI_LIBS -lmpi++"
-      fi
-      LIBS="$LIBS_old"
-      CPPFLAGS="$CPPFLAGS_old"
 
+    LIBS="$LIBS -lmpi++"
+    AC_MSG_CHECKING(for MPI_Init in -lmpi++)
+    AC_TRY_LINK([
+         #include <mpi.h>
+         ], [int argc=0; char **argv=0; MPI_Init(&argc,&argv);],
+         WITHLAM="yes",WITHLAM="no")
+
+    if test "$WITHLAM" = "yes";then
+
+      AC_MSG_RESULT(yes)
+      MPI_LIBS="$MPI_LIBS -lmpi++"
       AC_CHECK_LIB(mpi++,MPI_Publish_name,WITHMPI2="yes",WITHMPI2="no")
-      LDFLAGS="$LDFLAGS_old"
-      LIBS="$LIBS_old"
-    fi
 
-    if test "$WITHLAM" = "no";then
+    else
+      AC_MSG_RESULT(no)
+
+      LIBS="$LIBS_old"
       AC_CHECK_LIB(lam,lam_mp_init,WITHLAM="yes",WITHLAM="no")
       if test "$WITHLAM" = "yes";then
         MPI_LIBS="$MPI_LIBS -llam"
@@ -91,15 +87,18 @@ if test "$WITHLAM" = yes; then
 
       AC_CHECK_LIB(mpi,MPI_Init,WITHLAM="yes",WITHLAM="no")
       if test "$WITHLAM" = "yes";then
-        MPI_LIBS="$MPI_LIBS -lmpi"
+        MPI_LIBS="-lmpi $MPI_LIBS"
       fi
 
       AC_CHECK_LIB(mpi,MPI_Publish_name,WITHMPI2="yes",WITHMPI2="no")
-      LDFLAGS="$LDFLAGS_old"
-      LIBS="$LIBS_old"
+
     fi
   fi
 
+  CPPFLAGS="$CPPFLAGS_old"
+  LDFLAGS="$LDFLAGS_old"
+  LIBS="$LIBS_old"
+
   if test "$WITHLAM" = "yes";then
      WITHMPI="yes"
      mpi_ok=yes
index 1f63365bf30438d3bf8ed8057466d08d16f84114..7a6b6fd6dd8416103438511d68c22247d6dd81a5 100644 (file)
@@ -181,8 +181,11 @@ fi
 if test "x$omniORB_ok" = "xyes" 
 then
 
-  OMNIORB_IDLCXXFLAGS="-nf -I$OMNIORB_ROOT/idl"
-  OMNIORB_IDLPYFLAGS="-bpython -I$OMNIORB_ROOT/idl"
+  OMNIORB_IDLCXXFLAGS="-nf -I${OMNIORB_ROOT}/idl"
+  OMNIORB_IDLPYFLAGS_1='-bpythonbe -p ${top_srcdir}/salome_adm/unix'
+  OMNIORB_IDLPYFLAGS_2=" -I${OMNIORB_ROOT}/idl"
+  OMNIORB_IDLPYFLAGS=${OMNIORB_IDLPYFLAGS_1}${OMNIORB_IDLPYFLAGS_2}
+
   AC_SUBST(OMNIORB_IDLCXXFLAGS)
   AC_SUBST(OMNIORB_IDLPYFLAGS)
 
index 5803c5e92dc4aff097deb2b8504a147a75996311..13bf909147ba480271412e1db79e227c3a09d191 100644 (file)
@@ -47,8 +47,11 @@ if test -z $QWTHOME; then
   if test "x$exits_ok" = "xyes"; then
      if test -z $QWT_INCLUDES; then
         QWT_INCLUDES=$QWTHOME"/include/qwt"
-        if test ! -d $QWT_INCLUDES; then
-           QWT_INCLUDES=$QWTHOME"/include"
+        if test ! -f $QWT_INCLUDES/qwt.h ; then
+          QWT_INCLUDES=$QWTHOME"/include"
+        fi
+        if test ! -f $QWT_INCLUDES/qwt.h ; then
+          QWT_INCLUDES=/usr/lib/qt3/include/qwt
         fi
      fi
   fi
diff --git a/salome_adm/unix/pythonbe.py b/salome_adm/unix/pythonbe.py
new file mode 100644 (file)
index 0000000..85be617
--- /dev/null
@@ -0,0 +1,21 @@
+
+pymodule_template = """\
+# DO NOT EDIT THIS FILE!
+#
+# Python module @module@ generated by omniidl
+
+import omnipatch
+omnipatch.updateModule("@module@")
+
+# ** 1. Stub files contributing to this module
+
+# ** 2. Sub-modules
+
+# ** 3. End"""
+
+import omniidl_be.python
+omniidl_be.python.pymodule_template=pymodule_template
+
+def run(tree, args):
+    omniidl_be.python.run(tree, args)
+
index 258a7acf7e8c303429fd2f2a661bd610e0791e45..feec099fde99b9a43b01daa2e223e6cb6d02bde5 100644 (file)
@@ -250,7 +250,7 @@ void Engines_Component_i::destroy()
 
 Engines::Container_ptr Engines_Component_i::GetContainerRef()
 {
-  MESSAGE("Engines_Component_i::GetContainerRef");
+  //  MESSAGE("Engines_Component_i::GetContainerRef");
   CORBA::Object_ptr o = _poa->id_to_reference(*_contId) ;
   return Engines::Container::_narrow(o);
 }
index a893cbf03851b51028f55f91d8d7a8a6a19c1b80..48b3ac787f6d87481e090fd2f0a8d2116819ebf8 100644 (file)
@@ -33,6 +33,8 @@
 #else
 #include <SALOME_Component.hh>
 #endif
+#include <pthread.h>  // must be before Python.h !
+#include <Python.h>
 #include "SALOME_Container_i.hxx"
 #include "SALOME_Component_i.hxx"
 #include "SALOME_NamingService.hxx"
@@ -48,7 +50,6 @@
 #include <process.h>
 int SIGUSR1 = 1000;
 #endif
-#include <Python.h>
 #include "Container_init_python.hxx"
 
 #include "utilities.h"
@@ -219,7 +220,7 @@ char* Engines_Container_i::name()
 char* Engines_Container_i::getHostName()
 {
   string s = GetHostname();
-  MESSAGE("Engines_Container_i::getHostName " << s);
+  //  MESSAGE("Engines_Container_i::getHostName " << s);
   return CORBA::string_dup(s.c_str()) ;
 }
 
@@ -816,15 +817,19 @@ void ActSigIntHandler()
 // (SIGINT | SIGUSR1) :
 // it must be only one signal ===> one call for SIGINT 
 // and an other one for SIGUSR1
+
 #ifndef WNT
-  if ( sigaction( SIGINT , &SigIntAct, NULL ) ) {
-    perror("SALOME_Container main ") ;
-    exit(0) ;
-  }
-  if ( sigaction( SIGUSR1 , &SigIntAct, NULL ) ) {
-    perror("SALOME_Container main ") ;
-    exit(0) ;
-  }
+  if ( sigaction( SIGINT , &SigIntAct, NULL ) ) 
+    {
+      perror("SALOME_Container main ") ;
+      exit(0) ;
+    }
+  if ( sigaction( SIGUSR1 , &SigIntAct, NULL ) )
+    {
+      perror("SALOME_Container main ") ;
+      exit(0) ;
+    }
+
   //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 ===>
@@ -832,6 +837,7 @@ void ActSigIntHandler()
   //             may have a "Dead-Lock" ===HangUp
   //==INFOS is commented
   //  INFOS(pthread_self() << "SigIntHandler activated") ;
+
 #else  
   signal( SIGINT, SigIntHandler );
   signal( SIGUSR1, SigIntHandler );
@@ -842,8 +848,10 @@ void ActSigIntHandler()
 void SetCpuUsed() ;
 
 #ifndef WNT
-void SigIntHandler(int what , siginfo_t * siginfo ,
-                                        void * toto ) {
+void SigIntHandler(int what ,
+                  siginfo_t * siginfo ,
+                  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 ===>
@@ -854,160 +862,66 @@ void SigIntHandler(int what , siginfo_t * siginfo ,
   //          << "              si_signo " << siginfo->si_signo << endl
   //          << "              si_code  " << siginfo->si_code << endl
   //          << "              si_pid   " << siginfo->si_pid) ;
-  if ( _Sleeping ) {
-    _Sleeping = false ;
-    //     MESSAGE("SigIntHandler END sleeping.") ;
-    return ;
-  }
-  else {
-    ActSigIntHandler() ;
-    if ( siginfo->si_signo == SIGUSR1 ) {
-      SetCpuUsed() ;
+
+  if ( _Sleeping )
+    {
+      _Sleeping = false ;
+      //     MESSAGE("SigIntHandler END sleeping.") ;
+      return ;
     }
-    else {
-      _Sleeping = true ;
-      //      MESSAGE("SigIntHandler BEGIN sleeping.") ;
-      int count = 0 ;
-      while( _Sleeping ) {
-        sleep( 1 ) ;
-        count += 1 ;
-      }
-      //      MESSAGE("SigIntHandler LEAVE sleeping after " << count << " s.") ;
+  else
+    {
+      ActSigIntHandler() ;
+      if ( siginfo->si_signo == SIGUSR1 )
+       {
+         SetCpuUsed() ;
+       }
+      else 
+       {
+         _Sleeping = true ;
+         //      MESSAGE("SigIntHandler BEGIN sleeping.") ;
+         int count = 0 ;
+         while( _Sleeping )
+           {
+             sleep( 1 ) ;
+             count += 1 ;
+           }
+         //      MESSAGE("SigIntHandler LEAVE sleeping after " << count << " s.") ;
+       }
+      return ;
     }
-    return ;
-  }
 }
 #else // Case WNT
-void SigIntHandler( int what ) {
+void SigIntHandler( int what )
+{
   MESSAGE( pthread_self() << "SigIntHandler what     " << what << endl );
-  if ( _Sleeping ) {
-    _Sleeping = false ;
-    MESSAGE("SigIntHandler END sleeping.") ;
-    return ;
-  }
-  else {
-    ActSigIntHandler() ;
-    if ( what == SIGUSR1 ) {
-      SetCpuUsed() ;
+  if ( _Sleeping )
+    {
+      _Sleeping = false ;
+      MESSAGE("SigIntHandler END sleeping.") ;
+      return ;
     }
-    else {
-      _Sleeping = true ;
-      MESSAGE("SigIntHandler BEGIN sleeping.") ;
-      int count = 0 ;
-      while( _Sleeping ) {
-        Sleep( 1000 ) ;
-        count += 1 ;
-      }
-      MESSAGE("SigIntHandler LEAVE sleeping after " << count << " s.") ;
+  else
+    {
+      ActSigIntHandler() ;
+      if ( what == SIGUSR1 )
+       {
+         SetCpuUsed() ;
+       }
+      else
+       {
+         _Sleeping = true ;
+         MESSAGE("SigIntHandler BEGIN sleeping.") ;
+         int count = 0 ;
+         while( _Sleeping ) 
+           {
+             Sleep( 1000 ) ;
+             count += 1 ;
+           }
+         MESSAGE("SigIntHandler LEAVE sleeping after " << count << " s.") ;
+       }
+      return ;
     }
-    return ;
-  }
 }
 #endif
 
-//=============================================================================
-/*! 
- *  CORBA method: Create one instance of componentName component 
- *  and register it as genericRegisterName in naming service
- */
-//=============================================================================
-
-// Engines::Component_ptr Engines_Container_i::instance( const char* genericRegisterName,
-//                                                   const char* componentName )
-// {
-//   _numInstanceMutex.lock() ; // lock on the instance number
-//   BEGIN_OF( "Container_i::instance " << componentName ) ;
-
-//   string _genericRegisterName = genericRegisterName;
-//   string component_registerName = _containerName + "/" + _genericRegisterName;
-  
-//   Engines::Component_var iobject = Engines::Component::_nil() ;
-  
-//   try 
-//     {
-//       CORBA::Object_var obj = _NS->Resolve( component_registerName.c_str() ) ;
-//       if (! CORBA::is_nil( obj ) )
-//     {
-//       MESSAGE( "Container_i::instance " << component_registerName.c_str() << " already registered" ) ;
-//       iobject = Engines::Component::_narrow( obj ) ;
-//     }
-//       else
-//     {
-//       string _compo_name = componentName;
-//       string _impl_name = "lib" + _compo_name + "Engine.so";
-//       SCRUTE(_impl_name);
-      
-//       void* handle;
-//       handle = dlopen( _impl_name.c_str() , RTLD_LAZY ) ;
-         
-//       if ( handle )
-//         {
-//           string factory_name = _compo_name + "Engine_factory";
-//           SCRUTE(factory_name) ;
-             
-//           typedef  PortableServer::ObjectId * (*FACTORY_FUNCTION)
-//             (CORBA::ORB_ptr,
-//              PortableServer::POA_ptr, 
-//              PortableServer::ObjectId *, 
-//              const char *, 
-//              const char *) ; 
-//           FACTORY_FUNCTION Component_factory = (FACTORY_FUNCTION) dlsym(handle, factory_name.c_str());
-
-//           char *error ;
-//           if ( (error = dlerror() ) == NULL)
-//             {
-//               // Instanciate required CORBA object
-//               _numInstance++ ;
-//               char _aNumI[12];
-//               sprintf( _aNumI , "%d" , _numInstance ) ;
-//               string instanceName = _compo_name + "_inst_" + _aNumI ;
-//               SCRUTE(instanceName);
-                 
-//               PortableServer::ObjectId * id ;
-//               id = (Component_factory) ( _orb, _poa, _id, instanceName.c_str() ,
-//                                          _genericRegisterName.c_str() ) ;
-//               // get reference from id
-//               obj = _poa->id_to_reference(*id);
-//               iobject = Engines::Component::_narrow( obj ) ;
-                 
-//               // register the engine under the name containerName.dir/genericRegisterName.object
-//               _NS->Register( iobject , component_registerName.c_str() ) ;
-//               MESSAGE( "Container_i::instance " << component_registerName.c_str() << " registered" ) ;
-//               _handle_map[instanceName] = handle;
-//             }
-//           else
-//             {
-//               INFOS("Can't resolve symbol: " + factory_name);
-//               SCRUTE(error);
-//             }  
-//         }
-//       else
-//         {
-//           INFOS("Can't load shared library : " << _impl_name);
-//           INFOS("error dlopen: " << dlerror());
-//         }      
-//     }
-//     }
-//   catch (...)
-//     {
-//       INFOS( "Container_i::instance exception caught" ) ;
-//     }
-//   END_OF("Container_i::instance");
-//   _numInstanceMutex.unlock() ;
-//   return Engines::Component::_duplicate(iobject);
-// }
-
-//=============================================================================
-/*! 
- *  CORBA attribute: Machine Name (hostname without domain extensions)
- */
-//=============================================================================
-
-// char* Engines_Container_i::machineName()
-// {
-//   string s = GetHostname();
-//   MESSAGE("Engines_Container_i::machineName " << s);
-//    return CORBA::string_dup(s.c_str()) ;
-// }
-
-
index ddd796bb8928f66be3ab6bc9ef3d5002708e2512..9bcf6437187e941bbe8b1f2a0495cae2df6715ca 100644 (file)
@@ -249,7 +249,7 @@ GetFittingResources(const Engines::MachineParameters& params,
       //return ret;
     }
 
-  MESSAGE("Machine list length "<<vec.size());
+  //  MESSAGE("Machine list length "<<vec.size());
   ret->length(vec.size());
   for(unsigned int i=0;i<vec.size();i++)
     {
index 602f88511334a5564139c5c41ccde2b121c92745..323c0a3fdc634abf630837551b02385cc1be94c0 100644 (file)
@@ -68,7 +68,7 @@ public:
 
   static const char *_ContainerManagerNameInNS;
 
-private:
+protected:
   Engines::Container_ptr
   FindContainer(const Engines::MachineParameters& params,
                const Engines::MachineList& possibleComputers);
index 23ac0195ace0477af9dbb4b8d7e5b19e7096f68e..0ee6b8cd06c524bd455c2c755cbfcc2de9469a6c 100755 (executable)
 import os
 import sys
 import string
+import omnipatch                     # PAL10310
 from omniORB import CORBA, PortableServer
-# import SALOMEDS before other SALOME modules
-# (if not, incomplete import done by SALOME module: no load of SALOMEDS_attributes)
 import SALOMEDS 
 import Engines, Engines__POA
-reload(Engines)
-reload(Engines__POA)
 from SALOME_NamingServicePy import *
 from SALOME_ComponentPy import *
 
index 0f9b8963e58d874ad54180311eff7829d12ad44e..f5f079c20e08d1083d106a81dc00ad36cc395ce7 100755 (executable)
@@ -31,7 +31,7 @@ VPATH=.:@srcdir@:@top_srcdir@/idl
 
 @COMMENCE@
 
-EXPORT_PYSCRIPTS = Help.py PyInterp.py salome.py salome_shared_modules.py batchmode_salome.py import_hook.py salome_test.py salome_kernel.py salome_study.py salome_iapp.py salome_ComponentGUI.py
+EXPORT_PYSCRIPTS = Help.py PyInterp.py salome.py salome_shared_modules.py batchmode_salome.py import_hook.py salome_test.py salome_kernel.py salome_study.py salome_iapp.py salome_ComponentGUI.py omnipatch.py
 
 EXPORT_SHAREDPYSCRIPTS=kernel_shared_modules.py
 
index 5be2f15f469c0c9337fdf85d090523638279a2f9..ed86187896b94d5b4b857c8e3236f28a35ab1fe8 100755 (executable)
@@ -14,7 +14,7 @@ register_pattern(lambda(x):x.endswith("_idl"))
 register_pattern(lambda(x):x.endswith("_Swig"))
 
 register_name("CORBA")
-import CORBA
+from omniORB import CORBA
 
 register_name("omniORB")
 import omniORB
@@ -22,73 +22,9 @@ import omniORB
 register_name("CosNaming")
 import CosNaming
 
-# Modify omniORB to use right sys.modules dictionnary 
-# with multi-interpreter feature
-# openModule and newModule are functions of omniORB/__init__.py module
-# modified to register modules to share
-# Function to return a Python module for the required IDL module name
-def openModule(mname, fname=None):
-    # Salome modification start
-    import sys
-    # Salome modification end
+register_name("omnipatch")
+import omnipatch
 
-    if mname == "CORBA":
-        mod = sys.modules["omniORB.CORBA"]
-    elif sys.modules.has_key(mname):
-        mod = sys.modules[mname]
-    else:
-        mod = newModule(mname)
-
-    # Salome modification start
-    import_hook.set_shared_imported(mname,mod)
-    # Salome modification end
-
-
-    if not hasattr(mod, "__doc__") or mod.__doc__ is None:
-        mod.__doc__ = "omniORB IDL module " + mname + "\n\n" + \
-                      "Generated from:\n\n"
-
-    if fname is not None:
-        mod.__doc__ = mod.__doc__ + "  " + fname + "\n"
-
-    return mod
-
-# Function to create a new module, and any parent modules which do not
-# already exist
-def newModule(mname):
-    # Salome modification start
-    import sys
-    # Salome modification end
-
-    mlist   = string.split(mname, ".")
-    current = ""
-    mod     = None
-
-    for name in mlist:
-        current = current + name
-
-        if sys.modules.has_key(current):
-            mod = sys.modules[current]
-        else:
-            newmod = imp.new_module(current)
-            if mod: setattr(mod, name, newmod)
-            sys.modules[current] = mod = newmod
-
-        current = current + "."
-
-    return mod
-# Replace openModule and newModule by modified ones
-# to take into account the sys.modules that matches
-# the right one (multi-interpreter feature)
-omniORB.openModule=openModule
-omniORB.newModule=newModule
-
-# BE CAREFUL
-# Engines, SALOME, SALOMEDS must be imported in that order because :
-# Engines imports SALOME_Component_idl
-# SALOME imports SALOME_Session_idl and SALOME_Exception_idl which imports SALOME_Component_idl
-# and SALOMEDS imports SALOMEDS_idl and SALOMEDS_Attributes_idl which imports SALOME_Exception_idl
-# If SALOME is imported before Engines, that module would not be completely imported
 import Engines
 import SALOME
 import SALOMEDS
diff --git a/src/KERNEL_PY/omnipatch.py b/src/KERNEL_PY/omnipatch.py
new file mode 100644 (file)
index 0000000..20addc6
--- /dev/null
@@ -0,0 +1,97 @@
+"""
+  This patch of omniORB is made to make it work with multiple interpreters
+  and to correct the problem of incomplete import of CORBA packages
+  in some situations common in SALOME
+
+  This patch add or modify functions in omniORB module.
+
+  In multiple interpreters context, omniORB module is meant to be shared among
+  all interpreters
+"""
+import sys,string,imp
+import omniORB
+# Map of partially-opened modules
+_partialModules = {}
+# Map of modules to share
+shared_imported={}
+
+# Function to return a Python module for the required IDL module name
+def openModule(mname, fname=None):
+    # Salome modification start
+    # Be sure to use the right module dictionnary
+    import sys
+    # Salome modification end
+
+    if mname == "CORBA":
+        mod = sys.modules["omniORB.CORBA"]
+
+    elif sys.modules.has_key(mname):
+        mod = sys.modules[mname]
+
+        if _partialModules.has_key(mname):
+            pmod = _partialModules[mname]
+            mod.__dict__.update(pmod.__dict__)
+            del _partialModules[mname]
+
+    elif _partialModules.has_key(mname):
+        mod = _partialModules[mname]
+
+    else:
+        mod = newModule(mname)
+
+    # Salome modification start
+    shared_imported[mname]=mod
+    # Salome modification end
+
+    if not hasattr(mod, "__doc__") or mod.__doc__ is None:
+        mod.__doc__ = "omniORB IDL module " + mname + "\n\n" + \
+                      "Generated from:\n\n"
+
+    if fname is not None:
+        mod.__doc__ = mod.__doc__ + "  " + fname + "\n"
+
+    return mod
+
+# Function to create a new module, and any parent modules which do not
+# already exist
+def newModule(mname):
+    # Salome modification start
+    # Be sure to use the right module dictionnary
+    import sys
+    # Salome modification end
+
+    mlist   = string.split(mname, ".")
+    current = ""
+    mod     = None
+
+    for name in mlist:
+        current = current + name
+
+        if sys.modules.has_key(current):
+            mod = sys.modules[current]
+
+        elif _partialModules.has_key(current):
+            mod = _partialModules[current]
+
+        else:
+            newmod = imp.new_module(current)
+            if mod: setattr(mod, name, newmod)
+            _partialModules[current] = mod = newmod
+
+        current = current + "."
+
+    return mod
+
+# Function to update a module with the partial module store in the
+# partial module map
+def updateModule(mname):
+    if _partialModules.has_key(mname):
+        pmod = _partialModules[mname]
+        mod  = sys.modules[mname]
+        mod.__dict__.update(pmod.__dict__)
+        del _partialModules[mname]
+
+omniORB.updateModule=updateModule
+omniORB.newModule=newModule
+omniORB.openModule=openModule
+
index e8d5d5bacaae82df26cc3eed8493f570df448af4..d853b2cb63d3df6754d7b808367ffcf3755f847b 100755 (executable)
@@ -24,6 +24,7 @@
 #  Module : SALOME
 #  $Header$
 
+import omnipatch
 from salome_kernel import *
 from salome_study import *
 from salome_iapp import *
index f746809856f1b4b2f01183a92f16750e209ddc20..1029e279e2828668cc46af01281473e28784a669 100755 (executable)
@@ -56,7 +56,8 @@ import glob,os,sys
 import import_hook
 # shared_imported, patterns, register_name, register_pattern
 # will be shared by all Python sub interpretors
-from import_hook import shared_imported
+from omnipatch import shared_imported
+import_hook.shared_imported=shared_imported
 from import_hook import patterns
 from import_hook import register_name
 from import_hook import register_pattern
index 75e5f0bbd680cee99b49df468cd9dd9d68a4ebef..2e203e5aa6442b37a670ecf9d81c302cc27c0112 100755 (executable)
@@ -275,7 +275,7 @@ import os
 dir= os.getenv("DATA_DIR")
 if dir == None:
        raise RuntimeError, "DATA_DIR is not defined"
-xmlfile = dir +"/Superv/Graphs/GraphGeomEssai.xml"
+xmlfile = dir + "/Superv/Graphs/GraphGeomEssaiGates.xml"
 print "Load dataflow from the file : "
 print xmlfile
 print
index 6c9c4f6cdf93899bbe2f390c9b2ad1f5f39dcaf7..f5ec898723a88e8c2f7327269d6ab2db9f774df8 100644 (file)
@@ -17,6 +17,7 @@
 //
 // See http://www.salome-platform.org/
 //
+#include <pthread.h>  // must be before Python.h !
 #include <Python.h>
 #define elDEBUG 0
 
index 31dec183569723d77a763acffb4eef52549c629f..439d10fb5e19a8246d8c256ed198a2b257908ff9 100644 (file)
@@ -244,13 +244,13 @@ SALOME_LifeCycleCORBA::FindOrLoad_Component(const char *containerName,
     }
   params->isMPI = false;
   SCRUTE(params->container_name);
-  SCRUTE(params->hostname);
-  SCRUTE(params->OS);
-  SCRUTE(params->mem_mb);
-  SCRUTE(params->cpu_clock);
-  SCRUTE(params->nb_proc_per_node);
-  SCRUTE(params->nb_node);
-  SCRUTE(params->isMPI);
+//   SCRUTE(params->hostname);
+//   SCRUTE(params->OS);
+//   SCRUTE(params->mem_mb);
+//   SCRUTE(params->cpu_clock);
+//   SCRUTE(params->nb_proc_per_node);
+//   SCRUTE(params->nb_node);
+//   SCRUTE(params->isMPI);
   free(stContainer);
   return FindOrLoad_Component(params,componentName);
   
@@ -381,8 +381,8 @@ _FindComponent(const Engines::MachineParameters& params,
 
   const char *containerName = params.container_name;
   int nbproc = NbProc(params);
-  MESSAGE("_FindComponent, required " << containerName <<
-         " " << componentName << " " << nbproc);
+//   MESSAGE("_FindComponent, required " << containerName <<
+//       " " << componentName << " " << nbproc);
 
   Engines::MachineList_var machinesOK = new Engines::MachineList;
 
@@ -392,7 +392,7 @@ _FindComponent(const Engines::MachineParameters& params,
   for(unsigned int i=0; i<listOfMachines.length(); i++)
     {
       const char *currentMachine=listOfMachines[i];
-      MESSAGE("_FindComponent, look at " << currentMachine);
+//       MESSAGE("_FindComponent, look at " << currentMachine);
       CORBA::Object_var obj = _NS->ResolveComponent(currentMachine,
                                                    containerName,
                                                    componentName,
index 215d55985d9a03483c720fc202ec963588372d68..75a8282a4f8cbb7d21d0fe5fdd2019efcf109125 100644 (file)
 
 %typemap(python,out) Engines::Container_ptr, Engines::Component_ptr
 {
-  MESSAGE("typemap out on CORBA object ptr");
-  SCRUTE($1);
+  //MESSAGE("typemap out on CORBA object ptr");
+  //SCRUTE($1);
 
   // --- Get the Python orb
 
   PyObject* pdict = PyDict_New();
   PyDict_SetItemString(pdict, "__builtins__", PyEval_GetBuiltins());
-  PyRun_String("import CORBA", Py_single_input, pdict, pdict);
+  PyRun_String("from omniORB import CORBA", Py_single_input, pdict, pdict);
   PyRun_String("o = CORBA.ORB_init([''], CORBA.ORB_ID);", Py_single_input,
                    pdict, pdict);
   PyObject* orb = PyDict_GetItemString(pdict, "o");
   char **argv = &xargv;
   CORBA::ORB_var ORB = CORBA::ORB_init(argc, argv);
   string s =  ORB->object_to_string($1);
-  SCRUTE(s);
+  //SCRUTE(s);
   PyObject * tmp = PyString_FromString(s.c_str());
-  SCRUTE(tmp);
+  //SCRUTE(tmp);
   $result = PyObject_CallMethod(orb, "string_to_object", "O", tmp);
-  SCRUTE($result);
+  //SCRUTE($result);
 }
 
 
index 872c32d95b7cde771318ec21f64606b88ba051de..dfeb178e13579d792ccfb0b10b30e9d79103abae 100644 (file)
@@ -33,6 +33,7 @@
 #include "Utils_SINGLETON.hxx"
 #include "OpUtil.hxx"
 #include "utilities.h"
+#include <pthread.h>  // must be before Python.h !
 #include <Python.h>
 #include "Container_init_python.hxx"
 using namespace std;
index 87e57d287f72791873bf320733611b81353707da..b6def6a59e20e95c81f827f6a31af45655768a89 100644 (file)
@@ -536,8 +536,8 @@ SALOME_ModuleCatalogImpl::findComponent(const string & name)
       {
        if (name.compare(_general_module_list[ind].name) == 0)
          {
-           if(MYDEBUG) MESSAGE("Component named " << name 
-                               << " found in the general catalog");
+           //      if(MYDEBUG) MESSAGE("Component named " << name 
+           //                  << " found in the general catalog");
            C_parser = &(_general_module_list[ind]);
            break;
          }
@@ -638,7 +638,7 @@ void SALOME_ModuleCatalogImpl::duplicate
   
   // duplicate service list
   unsigned int _length = I_parser.services.size();
-  if(MYDEBUG) SCRUTE(_length);
+  //  if(MYDEBUG) SCRUTE(_length);
   //  I_corba.interfaceservicelist 
   //  = new SALOME_ModuleCatalog::ListOfInterfaceService;
   I_corba.interfaceservicelist.length(_length);
@@ -700,7 +700,7 @@ void SALOME_ModuleCatalogImpl::duplicate
   
   // duplicate out DataStreamParameters
   _length = S_parser.outDataStreamParameters.size();
-  if(MYDEBUG) SCRUTE(_length);
+  //  if(MYDEBUG) SCRUTE(_length);
   S_corba.ServiceoutDataStreamParameter.length(_length);
 
 #ifndef WNT
index bce5f23380f99cd43714396c7f2400a235ebdcaa..0c046c9ea8b3a9a31a8fe446bc1d1a027c67f85a 100644 (file)
@@ -344,7 +344,7 @@ void SALOME_NamingService::Register(CORBA::Object_ptr ObjRef,
 CORBA::Object_ptr SALOME_NamingService::Resolve(const char* Path)
   throw(ServiceUnreachable)
 {
-  MESSAGE("BEGIN OF Resolve: " << Path);
+//   MESSAGE("BEGIN OF Resolve: " << Path);
 
   Utils_Locker lock (&_myMutex);
 
@@ -430,10 +430,10 @@ CORBA::Object_ptr SALOME_NamingService::Resolve(const char* Path)
 CORBA::Object_ptr SALOME_NamingService::ResolveFirst(const char* Path)
   throw(ServiceUnreachable)
 {
-  MESSAGE("ResolveFirst");
+//   MESSAGE("ResolveFirst");
 
   Utils_Locker lock (&_myMutex);
-  SCRUTE(Path);
+//   SCRUTE(Path);
 
   string thePath = Path;
   string basePath = "";
@@ -445,10 +445,10 @@ CORBA::Object_ptr SALOME_NamingService::ResolveFirst(const char* Path)
     {
       basePath = thePath.substr(0, idx);
       name = thePath.substr(idx + 1);
-      SCRUTE(basePath);
+//       SCRUTE(basePath);
     }
 
-  SCRUTE(name);
+//   SCRUTE(name);
   CORBA::Object_ptr obj = CORBA::Object::_nil();
 
   bool isOk = false;
@@ -503,7 +503,7 @@ SALOME_NamingService::ResolveComponent(const char* hostname,
                                       const int nbproc)
   throw(ServiceUnreachable)
 {
-  MESSAGE("ResolveComponent");
+//   MESSAGE("ResolveComponent");
 
   Utils_Locker lock (&_myMutex);
 
@@ -791,7 +791,7 @@ throw(ServiceUnreachable)
 bool SALOME_NamingService::Change_Directory(const char* Path)
 throw(ServiceUnreachable)
 {
-  MESSAGE("BEGIN OF Change_Directory " << Path);
+//   MESSAGE("BEGIN OF Change_Directory " << Path);
   Utils_Locker lock (&_myMutex);
 
   string path(Path);
@@ -805,7 +805,7 @@ throw(ServiceUnreachable)
 
   if (path == "/")
     {
-      MESSAGE("Change_Directory is called to go to the root_context");
+//       MESSAGE("Change_Directory is called to go to the root_context");
       _current_context = _root_context;
       return true;
     }
@@ -823,7 +823,7 @@ throw(ServiceUnreachable)
   ASSERT(!CORBA::is_nil(current_context));
   
   if (path[path.length()-1] != '/') path += '/';
-  SCRUTE(path);
+//   SCRUTE(path);
   CosNaming::Name context_name;
   vector<string> splitPath;
   int dimension_resultat = _createContextNameDir(path.c_str(),
@@ -1010,7 +1010,7 @@ throw(ServiceUnreachable)
 vector<string> SALOME_NamingService::list_directory()
 throw(ServiceUnreachable)
 {
-  MESSAGE("list_directory");
+//   MESSAGE("list_directory");
   vector<string> dirList ;
   dirList.resize(0);
 
@@ -1038,8 +1038,8 @@ throw(ServiceUnreachable)
         }
     }
 
-  for (unsigned int ind = 0; ind < dirList.size(); ind++)
-    MESSAGE("list_directory : Object : " << dirList[ind]);
+//   for (unsigned int ind = 0; ind < dirList.size(); ind++)
+//     MESSAGE("list_directory : Object : " << dirList[ind]);
 
   binding_iterator->destroy();
 
@@ -1573,17 +1573,17 @@ SALOME_NamingService::_createContextNameDir(string path,
   context_name.length(dim);
   for (int i=0; i<dim; i++)
     {
-      SCRUTE(splitPath[i]);
+//       SCRUTE(splitPath[i]);
       context_name[i].id = CORBA::string_dup(splitPath[i].c_str());
       if (!endWithDelim && (i == dim-1)) // here, the last string is an object
        {
          context_name[i].kind = CORBA::string_dup("object");
-         MESSAGE("--- " <<splitPath[i] <<".object");
+//       MESSAGE("--- " <<splitPath[i] <<".object");
        }
       else
        {
          context_name[i].kind = CORBA::string_dup("dir");
-         MESSAGE("--- " <<splitPath[i] <<".dir");
+//       MESSAGE("--- " <<splitPath[i] <<".dir");
        }
     }
   return dim;
index f635431c7b496a2d79126c3165e493124e44b8f5..19f5f410ae42f50689c23962d4ff341eecba739f 100755 (executable)
@@ -75,7 +75,7 @@ SALOME_ResourcesCatalog_Handler(MapOfParserResourcesType& listOfResources):
 
 SALOME_ResourcesCatalog_Handler::~SALOME_ResourcesCatalog_Handler()
 {
-  MESSAGE("SALOME_ResourcesCatalog_Handler destruction");
+  //  MESSAGE("SALOME_ResourcesCatalog_Handler destruction");
 }
 
 //=============================================================================
@@ -101,7 +101,7 @@ SALOME_ResourcesCatalog_Handler::GetResourcesAfterParsing() const
 
 bool SALOME_ResourcesCatalog_Handler::startDocument()
 {
-  MESSAGE("Begin parse document");
+  //  MESSAGE("Begin parse document");
 
   // --- Empty private elements
 
@@ -261,21 +261,21 @@ bool SALOME_ResourcesCatalog_Handler::characters(const QString& chars)
 
 bool SALOME_ResourcesCatalog_Handler::endDocument()
 {
-  for (map<string, ParserResourcesType>::const_iterator iter =
-         _resources_list.begin();
-       iter != _resources_list.end();
-       iter++)
-    {
-      SCRUTE((*iter).second.Alias);
-      SCRUTE((*iter).second.UserName);
-      SCRUTE((*iter).second.AppliPath);
-      SCRUTE((*iter).second.PreReqFilePath);
-      SCRUTE((*iter).second.OS);
-      SCRUTE((*iter).second.Protocol);
-      SCRUTE((*iter).second.Mode);
-   }
+//   for (map<string, ParserResourcesType>::const_iterator iter =
+//          _resources_list.begin();
+//        iter != _resources_list.end();
+//        iter++)
+//     {
+//       SCRUTE((*iter).second.Alias);
+//       SCRUTE((*iter).second.UserName);
+//       SCRUTE((*iter).second.AppliPath);
+//       SCRUTE((*iter).second.PreReqFilePath);
+//       SCRUTE((*iter).second.OS);
+//       SCRUTE((*iter).second.Protocol);
+//       SCRUTE((*iter).second.Mode);
+//    }
   
-  MESSAGE("This is the end of document");
+//  MESSAGE("This is the end of document");
   return true;
 }
 
index e20832edffdc420151f41fbaee5f7878da25f7cf..434aa876b91fff24f6e5a40377e032d5a6b53a6c 100644 (file)
@@ -124,7 +124,7 @@ GetFittingResources(const Engines::MachineParameters& params,
                     const char *moduleName)
 throw(SALOME_Exception)
 {
-  MESSAGE("ResourcesManager::GetFittingResources");
+//   MESSAGE("ResourcesManager::GetFittingResources");
   vector <std::string> ret;
 
   // --- To be sure that we search in a correct list.
@@ -135,14 +135,14 @@ throw(SALOME_Exception)
 
   if (hostname[0] != '\0')
     {
-      MESSAGE("ResourcesManager::GetFittingResources : hostname specified" );
+//       MESSAGE("ResourcesManager::GetFittingResources : hostname specified" );
 
       if ( strcmp(hostname, "localhost") == 0 ||
            strcmp(hostname, GetHostname().c_str()) == 0 )
         {
-          MESSAGE("ResourcesManager::GetFittingResources : localhost" );
+//           MESSAGE("ResourcesManager::GetFittingResources : localhost" );
           ret.push_back(GetHostname().c_str());
-          MESSAGE("ResourcesManager::GetFittingResources : " << ret.size());
+//       MESSAGE("ResourcesManager::GetFittingResources : " << ret.size());
         }
 
       else if (_resourcesList.find(hostname) != _resourcesList.end())
@@ -197,7 +197,7 @@ throw(SALOME_Exception)
         ret[i++] = (*iter2)._hostName;
     }
 
-  MESSAGE("ResourcesManager::GetFittingResources : return" << ret.size());
+  //  MESSAGE("ResourcesManager::GetFittingResources : return" << ret.size());
   return ret;
 }
 
index 8175919dda12ea0b7638e61fa194e1622d0a44fb..4f5466494d487052edce290e654a0652bddb2084 100644 (file)
@@ -100,7 +100,7 @@ class RESOURCESMANAGER_EXPORT SALOME_ResourcesManager
 
     const MapOfParserResourcesType& GetList() const;
 
-  private:
+  protected:
     SALOME_NamingService *_NS;
 
     std::string BuildTempFileToLaunchRemoteContainer
index 4523a897dfc5d02d1de9d62ef68bcba57b43d697..c7d321ec6597dbb7093f1f8e1547a5fcf7efdcfc 100644 (file)
@@ -169,7 +169,12 @@ int LocalTraceBufferPool::insert(int traceType, const char* msg)
 
   // wait until there is a free buffer in the pool
 
-  int ret = sem_wait(&_freeBufferSemaphore);
+  int ret = -1;
+  while (ret)
+    {
+      ret = sem_wait(&_freeBufferSemaphore);
+      if (ret) perror(" LocalTraceBufferPool::insert, sem_wait");
+    }
 
   // get the next free buffer available (mutex protected) 
 
@@ -209,7 +214,12 @@ int LocalTraceBufferPool::retrieve(LocalTrace_TraceInfo& aTrace)
 
   // wait until there is a buffer in the pool, with a message to print
 
-  int ret = sem_wait(&_fullBufferSemaphore);
+  int ret = -1;
+  while (ret)
+    {
+      ret = sem_wait(&_fullBufferSemaphore);
+      if (ret) perror(" LocalTraceBufferPool::retrieve, sem_wait");
+    }
 
   // get the next buffer to print
 
index d36e8740509213c58adb9debf65630dc2ce24772..fa13a1eb42756a3ed27dbcdae66f5ab00c00a053 100644 (file)
@@ -267,15 +267,18 @@ SALOMEDS_Tool::PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
                                const std::string& theToDirectory,
                                const int theNamesOnly)
 {
-  if(theStream.length() == 0) 
-    return NULL;
+  SALOMEDS::ListOfFileNames_var aFiles = new SALOMEDS::ListOfFileNames;
+
+  if(theStream.length() == 0)
+    return aFiles;
 
   //Get a temporary directory for saving a file
   TCollection_AsciiString aTmpDir(const_cast<char*>(theToDirectory.c_str()));
 
   unsigned char *aBuffer = (unsigned char*)theStream.NP_data();
 
-  if(aBuffer == NULL) return NULL;
+  if(aBuffer == NULL)
+    return aFiles;
 
   long aFileSize, aCurrentPos = 4;
   int i, aFileNameSize, aNbFiles = 0;
@@ -283,7 +286,6 @@ SALOMEDS_Tool::PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
   //Copy the number of files in the stream
   memcpy(&aNbFiles, aBuffer, sizeof(int)); 
 
-  SALOMEDS::ListOfFileNames_var aFiles = new SALOMEDS::ListOfFileNames;
   aFiles->length(aNbFiles);
 
   for(i=0; i<aNbFiles; i++) {