From 36b4d0d5e82155abafd70bd5e61660744da41a4d Mon Sep 17 00:00:00 2001 From: prascle Date: Thu, 22 Dec 2005 14:01:32 +0000 Subject: [PATCH] PR: merge from branch BR_3_1_0deb tag mergeto_trunk_22dec05 --- INSTALL | 2 +- bin/VERSION | 2 +- bin/launchConfigureParser.py | 8 +- bin/runSalome.py | 11 +- doc/salome/tui/KERNEL/doxyfile | 2 +- doc/salome/tui/KERNEL/sources/static/tree.js | 2 +- resources/CatalogResources.xml | 40 +-- resources/KERNELCatalog.xml | 6 +- salome_adm/unix/config_files/check_lam.m4 | 43 ++-- salome_adm/unix/config_files/check_omniorb.m4 | 7 +- salome_adm/unix/config_files/check_qwt.m4 | 7 +- salome_adm/unix/pythonbe.py | 21 ++ src/Container/Component_i.cxx | 2 +- src/Container/Container_i.cxx | 232 ++++++------------ src/Container/SALOME_ContainerManager.cxx | 2 +- src/Container/SALOME_ContainerManager.hxx | 2 +- src/Container/SALOME_ContainerPy.py | 5 +- src/KERNEL_PY/Makefile.in | 2 +- src/KERNEL_PY/kernel_shared_modules.py | 70 +----- src/KERNEL_PY/omnipatch.py | 97 ++++++++ src/KERNEL_PY/salome.py | 1 + src/KERNEL_PY/salome_shared_modules.py | 3 +- src/KERNEL_PY/salome_test.py | 2 +- src/LifeCycleCORBA/Launchers.hxx | 1 + src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx | 20 +- .../libSALOME_LifeCycleCORBA.i | 12 +- src/MPIContainer/MPIContainer_i.cxx | 1 + .../SALOME_ModuleCatalog_impl.cxx | 8 +- src/NamingService/SALOME_NamingService.cxx | 30 +-- .../SALOME_ResourcesCatalog_Handler.cxx | 32 +-- .../SALOME_ResourcesManager.cxx | 10 +- .../SALOME_ResourcesManager.hxx | 2 +- src/SALOMELocalTrace/LocalTraceBufferPool.cxx | 14 +- src/TOOLSDS/SALOMEDS_Tool.cxx | 10 +- 34 files changed, 352 insertions(+), 357 deletions(-) create mode 100644 salome_adm/unix/pythonbe.py create mode 100644 src/KERNEL_PY/omnipatch.py diff --git a/INSTALL b/INSTALL index 526e28e9f..5feb42fc3 100644 --- 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 diff --git a/bin/VERSION b/bin/VERSION index 377576937..140772c27 100755 --- a/bin/VERSION +++ b/bin/VERSION @@ -1 +1 @@ -THIS IS SALOME - KERNEL VERSION: 3.1.0b1 +THIS IS SALOME - KERNEL VERSION: 3.1.0 diff --git a/bin/launchConfigureParser.py b/bin/launchConfigureParser.py index 0de312b04..a9d0c273c 100755 --- a/bin/launchConfigureParser.py +++ b/bin/launchConfigureParser.py @@ -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 ( section) # which are stored in opts with key _ (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 _ROOT_DIR must be set. The module name () 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': diff --git a/bin/runSalome.py b/bin/runSalome.py index c4773d189..9d0a66971 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -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']: diff --git a/doc/salome/tui/KERNEL/doxyfile b/doc/salome/tui/KERNEL/doxyfile index 64247b6b5..1758a66e5 100755 --- a/doc/salome/tui/KERNEL/doxyfile +++ b/doc/salome/tui/KERNEL/doxyfile @@ -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 diff --git a/doc/salome/tui/KERNEL/sources/static/tree.js b/doc/salome/tui/KERNEL/sources/static/tree.js index 18cf7f25f..0ddcfec0f 100755 --- a/doc/salome/tui/KERNEL/sources/static/tree.js +++ b/doc/salome/tui/KERNEL/sources/static/tree.js @@ -1,4 +1,4 @@ -foldersTree = gFld("SALOME v.2.1.0 ", "", "") +foldersTree = gFld("SALOME v.3.1.0 ", "", "") insDoc(foldersTree, gLnk("Main Page", "", "main.html")) aux1 = insFld(foldersTree, gFld("TUI Reference Guide", "")) diff --git a/resources/CatalogResources.xml b/resources/CatalogResources.xml index f83a16243..2a074cda7 100644 --- a/resources/CatalogResources.xml +++ b/resources/CatalogResources.xml @@ -3,44 +3,44 @@ - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + diff --git a/resources/KERNELCatalog.xml b/resources/KERNELCatalog.xml index 298eadd2d..836c6cadb 100644 --- a/resources/KERNELCatalog.xml +++ b/resources/KERNELCatalog.xml @@ -16,7 +16,7 @@ Salome Other NRI - 3.1.0a + 3.1.0 GUI Neutral Context 1 @@ -27,7 +27,7 @@ SalomeTestComponent Other NRI - 3.1.0a + 3.1.0 GUI Neutral Context 1 'linux' ~ OS @@ -37,7 +37,7 @@ SALOME_TestComponentPy Other NRI - 3.1.0a + 3.1.0 GUI Neutral Context 1 'linux' ~ OS diff --git a/salome_adm/unix/config_files/check_lam.m4 b/salome_adm/unix/config_files/check_lam.m4 index ae21b56fe..d15fdde31 100644 --- a/salome_adm/unix/config_files/check_lam.m4 +++ b/salome_adm/unix/config_files/check_lam.m4 @@ -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 - ], [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 + ], [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 diff --git a/salome_adm/unix/config_files/check_omniorb.m4 b/salome_adm/unix/config_files/check_omniorb.m4 index 1f63365bf..7a6b6fd6d 100644 --- a/salome_adm/unix/config_files/check_omniorb.m4 +++ b/salome_adm/unix/config_files/check_omniorb.m4 @@ -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) diff --git a/salome_adm/unix/config_files/check_qwt.m4 b/salome_adm/unix/config_files/check_qwt.m4 index 5803c5e92..13bf90914 100644 --- a/salome_adm/unix/config_files/check_qwt.m4 +++ b/salome_adm/unix/config_files/check_qwt.m4 @@ -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 index 000000000..85be617d1 --- /dev/null +++ b/salome_adm/unix/pythonbe.py @@ -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) + diff --git a/src/Container/Component_i.cxx b/src/Container/Component_i.cxx index 258a7acf7..feec099fd 100644 --- a/src/Container/Component_i.cxx +++ b/src/Container/Component_i.cxx @@ -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); } diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index a893cbf03..48b3ac787 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -33,6 +33,8 @@ #else #include #endif +#include // must be before Python.h ! +#include #include "SALOME_Container_i.hxx" #include "SALOME_Component_i.hxx" #include "SALOME_NamingService.hxx" @@ -48,7 +50,6 @@ #include int SIGUSR1 = 1000; #endif -#include #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()) ; -// } - - diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index ddd796bb8..9bcf64371 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -249,7 +249,7 @@ GetFittingResources(const Engines::MachineParameters& params, //return ret; } - MESSAGE("Machine list length "<length(vec.size()); for(unsigned int i=0;i // must be before Python.h ! #include #define elDEBUG 0 diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index 31dec1835..439d10fb5 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -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; iResolveComponent(currentMachine, containerName, componentName, diff --git a/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i b/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i index 215d55985..75a8282a4 100644 --- a/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i +++ b/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i @@ -30,14 +30,14 @@ %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"); @@ -49,11 +49,11 @@ 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); } diff --git a/src/MPIContainer/MPIContainer_i.cxx b/src/MPIContainer/MPIContainer_i.cxx index 872c32d95..dfeb178e1 100644 --- a/src/MPIContainer/MPIContainer_i.cxx +++ b/src/MPIContainer/MPIContainer_i.cxx @@ -33,6 +33,7 @@ #include "Utils_SINGLETON.hxx" #include "OpUtil.hxx" #include "utilities.h" +#include // must be before Python.h ! #include #include "Container_init_python.hxx" using namespace std; diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx index 87e57d287..b6def6a59 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx @@ -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 diff --git a/src/NamingService/SALOME_NamingService.cxx b/src/NamingService/SALOME_NamingService.cxx index bce5f2338..0c046c9ea 100644 --- a/src/NamingService/SALOME_NamingService.cxx +++ b/src/NamingService/SALOME_NamingService.cxx @@ -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 splitPath; int dimension_resultat = _createContextNameDir(path.c_str(), @@ -1010,7 +1010,7 @@ throw(ServiceUnreachable) vector SALOME_NamingService::list_directory() throw(ServiceUnreachable) { - MESSAGE("list_directory"); +// MESSAGE("list_directory"); vector 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::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::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; } diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index e20832edf..434aa876b 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -124,7 +124,7 @@ GetFittingResources(const Engines::MachineParameters& params, const char *moduleName) throw(SALOME_Exception) { - MESSAGE("ResourcesManager::GetFittingResources"); +// MESSAGE("ResourcesManager::GetFittingResources"); vector 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; } diff --git a/src/ResourcesManager/SALOME_ResourcesManager.hxx b/src/ResourcesManager/SALOME_ResourcesManager.hxx index 8175919dd..4f5466494 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.hxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.hxx @@ -100,7 +100,7 @@ class RESOURCESMANAGER_EXPORT SALOME_ResourcesManager const MapOfParserResourcesType& GetList() const; - private: + protected: SALOME_NamingService *_NS; std::string BuildTempFileToLaunchRemoteContainer diff --git a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx index 4523a897d..c7d321ec6 100644 --- a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx +++ b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx @@ -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 diff --git a/src/TOOLSDS/SALOMEDS_Tool.cxx b/src/TOOLSDS/SALOMEDS_Tool.cxx index d36e87405..fa13a1eb4 100644 --- a/src/TOOLSDS/SALOMEDS_Tool.cxx +++ b/src/TOOLSDS/SALOMEDS_Tool.cxx @@ -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(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