-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
-THIS IS SALOME - KERNEL VERSION: 3.1.0b1
+THIS IS SALOME - KERNEL VERSION: 3.1.0
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)
# 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 )
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
--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.
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':
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")
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']:
#---------------------------------------------------------------------------
# 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
-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", ""))
<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>
<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>
<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>
<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>
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")
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"
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
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)
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
--- /dev/null
+
+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)
+
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);
}
#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"
#include <process.h>
int SIGUSR1 = 1000;
#endif
-#include <Python.h>
#include "Container_init_python.hxx"
#include "utilities.h"
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()) ;
}
// (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 ===>
// may have a "Dead-Lock" ===HangUp
//==INFOS is commented
// INFOS(pthread_self() << "SigIntHandler activated") ;
+
#else
signal( SIGINT, SigIntHandler );
signal( SIGUSR1, SigIntHandler );
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 ===>
// << " 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()) ;
-// }
-
-
//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++)
{
static const char *_ContainerManagerNameInNS;
-private:
+protected:
Engines::Container_ptr
FindContainer(const Engines::MachineParameters& params,
const Engines::MachineList& possibleComputers);
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 *
@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
register_pattern(lambda(x):x.endswith("_Swig"))
register_name("CORBA")
-import CORBA
+from omniORB import CORBA
register_name("omniORB")
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
--- /dev/null
+"""
+ 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
+
# Module : SALOME
# $Header$
+import omnipatch
from salome_kernel import *
from salome_study import *
from salome_iapp import *
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
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
//
// See http://www.salome-platform.org/
//
+#include <pthread.h> // must be before Python.h !
#include <Python.h>
#define elDEBUG 0
}
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);
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;
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,
%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);
}
#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;
{
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;
}
// 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);
// duplicate out DataStreamParameters
_length = S_parser.outDataStreamParameters.size();
- if(MYDEBUG) SCRUTE(_length);
+ // if(MYDEBUG) SCRUTE(_length);
S_corba.ServiceoutDataStreamParameter.length(_length);
#ifndef WNT
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);
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 = "";
{
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;
const int nbproc)
throw(ServiceUnreachable)
{
- MESSAGE("ResolveComponent");
+// MESSAGE("ResolveComponent");
Utils_Locker lock (&_myMutex);
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);
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;
}
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(),
vector<string> SALOME_NamingService::list_directory()
throw(ServiceUnreachable)
{
- MESSAGE("list_directory");
+// MESSAGE("list_directory");
vector<string> dirList ;
dirList.resize(0);
}
}
- 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();
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;
SALOME_ResourcesCatalog_Handler::~SALOME_ResourcesCatalog_Handler()
{
- MESSAGE("SALOME_ResourcesCatalog_Handler destruction");
+ // MESSAGE("SALOME_ResourcesCatalog_Handler destruction");
}
//=============================================================================
bool SALOME_ResourcesCatalog_Handler::startDocument()
{
- MESSAGE("Begin parse document");
+ // MESSAGE("Begin parse document");
// --- Empty private elements
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;
}
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.
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())
ret[i++] = (*iter2)._hostName;
}
- MESSAGE("ResourcesManager::GetFittingResources : return" << ret.size());
+ // MESSAGE("ResourcesManager::GetFittingResources : return" << ret.size());
return ret;
}
const MapOfParserResourcesType& GetList() const;
- private:
+ protected:
SALOME_NamingService *_NS;
std::string BuildTempFileToLaunchRemoteContainer
// 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)
// 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
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;
//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++) {