From: prascle Date: Tue, 13 Dec 2005 14:37:05 +0000 (+0000) Subject: PR: mergefrom branch BR_PR_V310b1 tag mergeto_BR_3_1_0deb_13dec05 X-Git-Tag: T_3_1_0pre~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cce138fe99e4c1757b79290bc6c2719d0be73dd4;p=modules%2Fkernel.git PR: mergefrom branch BR_PR_V310b1 tag mergeto_BR_3_1_0deb_13dec05 --- 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/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index a893cbf03..8d21a5809 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" @@ -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.hxx b/src/Container/SALOME_ContainerManager.hxx index 602f88511..323c0a3fd 100644 --- a/src/Container/SALOME_ContainerManager.hxx +++ b/src/Container/SALOME_ContainerManager.hxx @@ -68,7 +68,7 @@ public: static const char *_ContainerManagerNameInNS; -private: +protected: Engines::Container_ptr FindContainer(const Engines::MachineParameters& params, const Engines::MachineList& possibleComputers); diff --git a/src/KERNEL_PY/kernel_shared_modules.py b/src/KERNEL_PY/kernel_shared_modules.py index 3dea9f995..ed8618789 100755 --- a/src/KERNEL_PY/kernel_shared_modules.py +++ b/src/KERNEL_PY/kernel_shared_modules.py @@ -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 diff --git a/src/LifeCycleCORBA/Launchers.hxx b/src/LifeCycleCORBA/Launchers.hxx index 6c9c4f6cd..f5ec89872 100644 --- a/src/LifeCycleCORBA/Launchers.hxx +++ b/src/LifeCycleCORBA/Launchers.hxx @@ -17,6 +17,7 @@ // // See http://www.salome-platform.org/ // +#include // must be before Python.h ! #include #define elDEBUG 0 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/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