]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
PR: distributed SALOME Application concept
authorprascle <prascle>
Wed, 8 Jun 2005 13:56:30 +0000 (13:56 +0000)
committerprascle <prascle>
Wed, 8 Jun 2005 13:56:30 +0000 (13:56 +0000)
19 files changed:
Makefile.in
bin/appliskel/CatalogResources.xml [new file with mode: 0644]
bin/appliskel/README [new file with mode: 0644]
bin/appliskel/env.d/atFirst.sh [new file with mode: 0644]
bin/appliskel/env.d/envProducts.sh [new file with mode: 0644]
bin/appliskel/env.d/envSalome.sh [new file with mode: 0644]
bin/appliskel/envd [new file with mode: 0644]
bin/appliskel/runAppli [new file with mode: 0755]
bin/appliskel/runConsole [new file with mode: 0755]
bin/appliskel/runRemote.sh [new file with mode: 0755]
bin/appliskel/runSession [new file with mode: 0755]
bin/appliskel/salome.launch [new file with mode: 0755]
bin/createAppli.sh [new file with mode: 0755]
bin/runSalome
configure.in.base
src/Container/SALOME_ContainerManager.cxx
src/Container/SALOME_ContainerManagerServer.cxx
src/LifeCycleCORBA_SWIG/TestLifeCycleCORBA.py
src/ResourcesManager/SALOME_ResourcesManager.cxx

index 5c92e402e779095989ee492e830ebc35c5d90c73..3eda287c444cd1622071a81d5011662ffae954e0 100644 (file)
@@ -96,6 +96,7 @@ killSalomeWithPort.py \
 runSalome \
 runSalome.csh \
 runNS.sh \
+createAppli.sh \
 launchConfigureParser.py \
 salome.launch \
 envSalome.py \
@@ -171,6 +172,10 @@ install-include: $(include_list)
        done
 
 # install script in $(bindir) :
+install-appliskel:
+       $(INSTALL) -d  $(bindir)
+       cp -rp $(top_builddir)/bin/salome/appliskel $(bindir)
+
 install-bin: $(BIN_SCRIPT)
        $(INSTALL) -d  $(bindir)
        $(INSTALL_PROGRAM) $^ $(bindir)
@@ -190,5 +195,5 @@ distclean-other:
 
 @MODULE@
 
-install: install-bin install-include install-make install-end
+install: install-bin install-appliskel install-include install-make install-end
 
diff --git a/bin/appliskel/CatalogResources.xml b/bin/appliskel/CatalogResources.xml
new file mode 100644 (file)
index 0000000..8caed2b
--- /dev/null
@@ -0,0 +1,28 @@
+<!DOCTYPE ResourcesCatalog>
+<resources>
+  <machine 
+          protocol="ssh"
+          nbOfNodes="1"
+          mode="interactif"
+          OS="LINUX"
+          CPUFreqMHz="2800"
+          userName="prascle"
+          memInMB="1500"
+          nbOfProcPerNode="2"
+          alias="cli76cd"
+          hostname="cli76cd" >
+  </machine>
+
+  <machine
+          protocol="ssh"
+          nbOfNodes="1"
+          mode="interactif"
+          OS="LINUX"
+          CPUFreqMHz="2000"
+          userName="prascle"
+          memInMB="1000"
+          nbOfProcPerNode="1"
+          alias="cli76ce"
+          hostname="cli76ce" >
+  </machine>
+</resources>
diff --git a/bin/appliskel/README b/bin/appliskel/README
new file mode 100644 (file)
index 0000000..3a0b1fe
--- /dev/null
@@ -0,0 +1,42 @@
+Set of scripts for a SALOME application
+=======================================
+
+#     - A SALOME application distributed on several computers needs APPLI
+#       directories on the same path ($APPLI) relative to $HOME directory
+#       of the user, on each computer.
+
+user scripts:
+-------------
+
+runAppli   : SALOME launch (idem runSalome but different name to avoid
+             confusion with ${KERNEL_ROOT_DIR}/bin/salome/runSalome
+
+runConsole : a python console in the current SALOME session environment
+
+runSession : a shell in SALOME environment, either interactive (without args)
+             or used to run a program (defined by given args)
+
+internal application scripts:
+-----------------------------
+
+runRemote.sh : called from remote computer, via ssh, rsh...
+               used for instance to create container
+
+envd         : sets SALOME application environment
+               called by other scripts
+
+The following files must be adapted to your environment and SALOME Application:
+-------------------------------------------------------------------------------
+
+salome.launch        - list of modules, options on server launch...
+CatalogResources.xml - configuration of machines used in SALOME application
+                       (no need of modules list and path here)
+
+env.d directory must contain the necessary files to source, to define 
+the SALOME Application environment :
+  (  envd script source these files in alphanumeric order )
+
+For instance,
+ atFirst.sh     - general presets
+ envProducts.sh - prerequisite SALOME environment
+ envSalome.sh   - list of MODULE_ROOT_DIR
diff --git a/bin/appliskel/env.d/atFirst.sh b/bin/appliskel/env.d/atFirst.sh
new file mode 100644 (file)
index 0000000..0c6715f
--- /dev/null
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+#------------------------------------------------
+# to be sourced first, used in following scripts
+#------------------------------------------------
+
+export LD_LIBRARY_PATH="."
+export PATH="/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/prascle/bin:."
+export PYTHONPATH=""
+
+export RAC=${HOME}
+export PAKSAL=/opt
+export PUB=${RAC}/public
+export TARP=${RAC}/tarpublic
+export PYPACKAGES=${PUB}/site_packages
+
+# ------------------------------------------------
+# ---- gdb 5.3
+
+export PATH=${PAKSAL}/gdb53/bin:${PATH}
+export LD_LIBRARY_PATH=${PAKSAL}/gdb53/lib:${LD_LIBRARY_PATH}
+
+# ------------------------------------------------
+# ---- ddd 3.3.7
+
+export PATH=${PAKSAL}/ddd337/bin:${PATH}
+export LD_LIBRARY_PATH=${PAKSAL}/ddd337/lib:${LD_LIBRARY_PATH}
+
+# ------------------------------------------------
+# --- Java 1.4
+
+export JDKHOME=${PUB}/j2sdk_nb/j2sdk1.4.2
+export JAVAHOME=${PUB}/j2sdk_nb/j2sdk1.4.2
+export PATH=${JAVAHOME}/bin:${PATH}
+export LD_LIBRARY_PATH=${JAVAHOME}/lib:${LD_LIBRARY_PATH}
+export LD_LIBRARY_PATH=${JAVAHOME}/jre/lib/i386:${LD_LIBRARY_PATH}
+export LD_LIBRARY_PATH=${JAVAHOME}/jre/lib/i386/client:${LD_LIBRARY_PATH}
+
+# ------------------------------------------------
+# --- gsl -1.4
+
+export GSLHOME=${PAKSAL}/gsl-1.4
+export PATH=${GSLHOME}/bin:${PATH}
+export LD_LIBRARY_PATH=${GSLHOME}/lib:${LD_LIBRARY_PATH}
+
+# ------------------------------------------------
+# --- fltk 1.1.4
+
+export FLTKHOME=${PAKSAL}/fltk114
+export PATH=${FLTKHOME}/bin:${PATH}
+export LD_LIBRARY_PATH=${FLTKHOME}/lib:${LD_LIBRARY_PATH}
+
+# ------------------------------------------------
+# --- gmsh 1.48
+
+export GMSHHOME=${PAKSAL}/gmsh148
+export PATH=${GMSHHOME}/bin:${PATH}
+
+# ------------------------------------------------
+# ---- tkcvs, tkdiffb, cvs
+
+export PATH=${PAKSAL}/tkcvs7.2/bin:${PAKSAL}/cvs1.11.14/bin:${PATH}
diff --git a/bin/appliskel/env.d/envProducts.sh b/bin/appliskel/env.d/envProducts.sh
new file mode 100644 (file)
index 0000000..aa05705
--- /dev/null
@@ -0,0 +1,120 @@
+#!/bin/sh
+
+# ------------------------------------------------
+# ---- openpbs
+
+export OPENPBS=/optroot/openpbs2316
+export PATH=${OPENPBS}/bin:${PATH}
+export LD_LIBRARY_PATH=${OPENPBS}/lib:${LD_LIBRARY_PATH}
+
+#------------------------------------------------------------------------------
+
+export INSTALL_ROOT=/home/prascle/PAL_SALOME141
+#------ gcc ------
+export GCC_ROOT=/usr
+export CXX=${GCC_ROOT}/bin/g++
+export CC=${GCC_ROOT}/bin/gcc
+##
+#------ boost ------ 
+export BOOSTDIR=${INSTALL_ROOT}/boost-1.30.2
+##
+
+#------ tcltk ------
+export TCLHOME=/usr
+
+#------ Python ------
+export PYTHONHOME=/usr
+export PYTHONPATH=${PYPACKAGES}:${PYTHONPATH}
+##
+#------ Qt ------
+#export QTDIR=/usr/lib/qt-3.0.5
+export QTDIR=/usr/lib/qt3-gcc3.2
+export PATH=${PATH}:${QTDIR}/bin
+export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${QTDIR}/lib
+##
+#------ Sip ------
+export SIPDIR=/usr
+export PYQTDIR=/usr
+##
+#------ PyQt ------
+export PYQT_SIPS=/usr/share/sip/qt
+export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib/python2.2/site-packages
+##
+#------ Swig ------ 
+export SWIG_ROOT=${INSTALL_ROOT}/SWIG-1.3.17
+export PATH=${SWIG_ROOT}/bin:${PATH}
+export LD_LIBRARY_PATH=${SWIG_ROOT}/lib:${LD_LIBRARY_PATH}
+##
+#------ OpenCascade ------
+export CASROOT=/opt/CAS52patch
+export LD_LIBRARY_PATH=${CASROOT}/Linux/lib:${LD_LIBRARY_PATH}
+export PATH=${CASROOT}/Linux/bin:${PATH}
+# Variable for Foundation Classes : 
+export CSF_UnitsLexicon=${CASROOT}/src/UnitsAPI/Lexi_Expr.dat 
+export CSF_UnitsDefinition=${CASROOT}/src/UnitsAPI/Units.dat 
+# Variable for DataExchange : 
+export CSF_SHMessage=${CASROOT}/src/SHMessage
+export CSF_XSMessage=${CASROOT}/src/XSMessage 
+# Variable for Font : 
+export CSF_MDTVFontDirectory=${CASROOT}/src/FontMFT 
+export CSF_MDTVTexturesDirectory=${CASROOT}/src/Textures 
+##
+export CSF_LANGUAGE=us
+export MMGT_CLEAR=1
+export CSF_EXCEPTION_PROMPT=1
+export CSF_StandardDefaults=${CASROOT}/src/StdResource
+export CSF_PluginDefaults=${CASROOT}/src/StdResource
+export CSF_XCAFDefaults=${CASROOT}/src/StdResource
+export CSF_GraphicShr=${CASROOT}/Linux/lib/libTKOpenGl.so
+export CSF_IGESDefaults=${CASROOT}/src/XSTEPResource
+export CSF_STEPDefaults=${CASROOT}/src/XSTEPResource
+##
+#export TCLLIBPATH=$TCLHOME/lib
+##
+#------ Qwt ------
+export QWTHOME=${INSTALL_ROOT}/qwt-0.4.1
+export LD_LIBRARY_PATH=${QWTHOME}/lib:${LD_LIBRARY_PATH} 
+##
+#------ Hdf ------
+export HDF5HOME=${INSTALL_ROOT}/hdf5-1.4.4
+export PATH=${HDF5HOME}/bin:$PATH
+export LD_LIBRARY_PATH=${HDF5HOME}/lib:${LD_LIBRARY_PATH}
+##
+#------ Med ------
+export MED2HOME=/opt/med2.2.2
+export PATH=${MED2HOME}/bin:${PATH}
+export LD_LIBRARY_PATH=${MED2HOME}/lib:${LD_LIBRARY_PATH}
+##
+#------ Vtk ------
+export VTKHOME=${INSTALL_ROOT}/VTK-4.2.2
+export PATH=${VTKHOME}/bin:${PATH}
+export LD_LIBRARY_PATH=${VTKHOME}/lib/vtk:${LD_LIBRARY_PATH}
+export PYTHONPATH=${VTKHOME}/lib/vtk:${VTKHOME}/lib/python2.2/site-packages/vtk_python:${PYTHONPATH}
+##
+#------ netgen ------
+export NETGENROOT=${INSTALL_ROOT}/netgen4.3
+export NETGEN_HOME=${INSTALL_ROOT}/netgen4.3
+##
+#------ OmniORB ------
+export OMNIORBDIR=${INSTALL_ROOT}/omniORB-3.0.5
+export OMNIORB_CONFIG=${OMNIORBDIR}/.omniORB.cfg
+export PYTHONPATH=${OMNIORBDIR}/lib/python:${OMNIORBDIR}/lib/i586_linux_2.0_glibc2.1:${PYTHONPATH}
+export PATH=$OMNIORBDIR/bin/i586_linux_2.0_glibc2.1:$PATH
+export LD_LIBRARY_PATH=$OMNIORBDIR/lib/i586_linux_2.0_glibc2.1:$LD_LIBRARY_PATH 
+##
+#------ Numeric ------
+export PYTHONPATH=${INSTALL_ROOT}/Numeric-22.0/lib/python2.2/site-packages/Numeric:${PYTHONPATH}
+##
+#------ HappyDoc ------
+export PATH=${INSTALL_ROOT}/HappyDoc-r2_1/bin:${PATH}
+export PYTHONPATH=${INSTALL_ROOT}/HappyDoc-r2_1/lib/python2.2/site-packages:${PYTHONPATH}
+##
+#------ Doxygen ------
+export PATH=${INSTALL_ROOT}/doxygen-1.3-rc2/bin:${PATH}
+##
+#------ Graphviz ------
+export PATH=${INSTALL_ROOT}/graphviz-1.9/bin:${PATH}
+export LD_LIBRARY_PATH=${INSTALL_ROOT}/graphviz-1.9/lib/graphviz:${LD_LIBRARY_PATH}
+##
+
+#------------------------------------------------------------------------------
diff --git a/bin/appliskel/env.d/envSalome.sh b/bin/appliskel/env.d/envSalome.sh
new file mode 100644 (file)
index 0000000..a7ea9a3
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# --- example to adapt to your own configuration ---
+#
+# --- envSalome.sh gives a set of MODULE_ROOT_DIR, to source
+# --- you must at least define and export KERNEL_ROOT_DIR
+
+REPINST=/home/prascle/SALOME2/Install
+
+export KERNEL_ROOT_DIR=${REPINST}/KERNEL_V222_lc
+
+export GEOM_ROOT_DIR=${REPINST}/GEOM_V222_lc
+export MED_ROOT_DIR=${REPINST}/MED_V222_lc
+export SMESH_ROOT_DIR=${REPINST}/SMESH_V222_lc
+export SUPERV_ROOT_DIR=${REPINST}/SUPERV_V222_lc
+export VISU_ROOT_DIR=${REPINST}/VISU_V222_lc
+export NETGENPLUGIN_ROOT_DIR=${REPINST}/NETGENPLUGIN_V222_lc
+export COMPONENT_ROOT_DIR=${REPINST}/COMPONENT_V222_lc
+export PYCALCULATOR_ROOT_DIR=${REPINST}/PYCALCULATOR_V222_lc
+export PYHELLO_ROOT_DIR=${REPINST}/PYHELLO_V222_lc
+export PYTIX_ROOT_DIR=${REPINST}/PYTIX_V222_lc
+
diff --git a/bin/appliskel/envd b/bin/appliskel/envd
new file mode 100644 (file)
index 0000000..80261ad
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+for i in $1/env.d/*;do source ${i}; done
diff --git a/bin/appliskel/runAppli b/bin/appliskel/runAppli
new file mode 100755 (executable)
index 0000000..e2d7e97
--- /dev/null
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+# --- retrieve APPLI path, relative to $HOME
+     
+comName=`which $0`
+APPLI=`echo ${HOME} \`dirname $comName\` | awk ' { print substr($2,length($1)+2) } '`
+export APPLI
+
+# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
+
+${HOME}/${APPLI}/envd ${HOME}/${APPLI}
+
+# --- define port for CORBA naming service
+
+searchFreePort() {
+    echo -n "Searching for a free port for naming service: "
+    export NSPORT=2810
+    local limit=$NSPORT
+    let limit=limit+100
+    while [ 1 ]
+    do
+        aRes=`netstat -ltn | grep -E :${NSPORT}`
+        if [ -z "$aRes" ]; then
+            echo ${NSPORT} - Ok
+           local myhost=`hostname`
+            export OMNIORB_CONFIG=${HOME}/$APPLI//.omniORB_${myhost}_${NSPORT}.cfg
+           export NSPORT
+            local initref="NameService=corbaname::"`hostname`":$NSPORT"
+            echo "ORBInitRef $initref" > $OMNIORB_CONFIG
+            break
+        fi
+        echo -n "${NSPORT} "
+        if [[ $NSPORT -eq $limit ]] ; then
+            echo
+            echo "Can't find a free port to launch omniNames"
+            echo "Try to kill the running servers and then launch SALOME again."
+            exit
+        fi
+        let NSPORT=NSPORT+1
+    done
+}
+
+# --- run SALOME
+#    (default arguments defined in local salome.launch could be completed
+#     by arguments to this command)
+
+searchFreePort
+
+if [ $# -ne 0 ] ; then
+    ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python -i ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $*
+else
+    ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py 
+fi
diff --git a/bin/appliskel/runConsole b/bin/appliskel/runConsole
new file mode 100755 (executable)
index 0000000..950caf6
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# --- retrieve APPLI path, relative to $HOME
+     
+comName=`which $0`
+APPLI=`echo ${HOME} \`dirname $comName\` | awk ' { print substr($2,length($1)+2) } '`
+export APPLI
+
+# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
+
+${HOME}/${APPLI}/envd ${HOME}/${APPLI}
+
+# --- open a Python interpreter with SALOME environment
+
+${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python -i ${KERNEL_ROOT_DIR}/bin/salome/salomeConsole.py $*
diff --git a/bin/appliskel/runRemote.sh b/bin/appliskel/runRemote.sh
new file mode 100755 (executable)
index 0000000..868dab9
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/bash
+#
+# --- run command in SALOME environment from remote call, ssh or rsh
+#     - SALOME configuration is defined by :
+#        - list of MODULE_ROOT_DIR
+#        - prerequisite environment
+#        - specific configuration for a particular SALOME application
+#     - These elements of configuration are defined locally on each computer
+#       in the directory APPLI:
+#     - A SALOME application distributed on several computers needs APPLI
+#       directories on the same path ($APPLI) relative to $HOME directory
+#       of the user, on each computer.
+#
+# --- call example (from cli76cd to cli76ce):
+# ssh cli76ce ${APPLI}/runRemote.sh cli76cd 2810 SALOME_Container myContainerName
+#
+# --- local arguments
+#     $0 : ${APPLI}/runRemote.sh: from arg name, rebuild and export $APPLI variable
+#     $1 : computer name for CORBA name service (where SALOME was launched)
+#     $2 : port for CORBA name service
+#     $3 and following : local command to execute, with args
+#
+
+# --- retrieve APPLI path, relative to $HOME
+     
+comName=`which $0`
+APPLI=`echo ${HOME} \`dirname $comName\` | awk ' { print substr($2,length($1)+2) } '`
+export APPLI
+
+# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
+
+${HOME}/${APPLI}/envd ${HOME}/${APPLI}
+
+# --- set the OMNIORB_CONFIG file and environment relative to this run of SALOME
+
+export OMNIORB_CONFIG=${HOME}/${APPLI}/.omniORB_$1_$2.cfg
+initref="NameService=corbaname::"$1":$2"
+echo "ORBInitRef $initref" > $OMNIORB_CONFIG
+
+# --- execute the command in the SALOME environment
+
+shift 2
+
+${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile $HOME/$APPLI/.bashrc -c "$*"
diff --git a/bin/appliskel/runSession b/bin/appliskel/runSession
new file mode 100755 (executable)
index 0000000..ec0486c
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+#
+# Useful shell to run executable progs or shells under Salome env
+# Use it with args to run a program : runSession python -i myprog.py
+# Use it without args to run an interactive shell under Salome env
+#
+
+# --- retrieve APPLI path, relative to $HOME
+     
+comName=`which $0`
+APPLI=`echo ${HOME} \`dirname $comName\` | awk ' { print substr($2,length($1)+2) } '`
+export APPLI
+
+# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
+
+${HOME}/${APPLI}/envd ${HOME}/${APPLI}
+
+# --- invoque shell with or without args
+
+if [ $# -ne 0 ] ; then
+    ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc -c "$*"
+else
+    ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc
+fi
diff --git a/bin/appliskel/salome.launch b/bin/appliskel/salome.launch
new file mode 100755 (executable)
index 0000000..92c5eab
--- /dev/null
@@ -0,0 +1,32 @@
+<Configuration-list>
+       <launchoptions>
+               <gui>yes</gui>
+               <logger>no</logger>
+               <!-- <file>atrace.log</file> -->
+               <xterm>no</xterm>
+               <portkill>yes</portkill>
+               <killall>no</killall>
+       </launchoptions>
+        <modules-list>
+               <module name="GEOM"/>
+               <module name="SMESH">
+                       <plugin name="NETGENPlugin"/>
+                       <plugin name="GHS3DPlugin"/>
+               </module>
+               <module name="VISU"/>
+               <module name="SUPERV"/>
+               <module name="MED"/>
+               <module name="COMPONENT"/>
+               <module name="PYCALCULATOR"/>
+        </modules-list>
+       <embedded-list>
+               <embeddedserver>registry</embeddedserver>
+               <embeddedserver>study</embeddedserver>
+               <embeddedserver>moduleCatalog</embeddedserver>
+               <embeddedserver>cppContainer</embeddedserver>
+       </embedded-list>
+       <standalone-list>
+               <standaloneserver>pyContainer</standaloneserver>
+               <standaloneserver>supervContainer</standaloneserver>
+       </standalone-list>
+</Configuration-list>
diff --git a/bin/createAppli.sh b/bin/createAppli.sh
new file mode 100755 (executable)
index 0000000..c6c4de0
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+comName=`which $0`
+rep=`dirname $comName`
+
+cp -r $rep/appliskel $1
+chmod +x $1/*.sh $1/run* $1/envd
index 7505e8b891648bfbf556c3f7719ac61327ed4b34..1112c8433d7ffb3b2de6ed70aab6da5daf6487e4 100755 (executable)
@@ -12,6 +12,7 @@ searchFreePort() {
             echo ${NSPORT} - Ok
            local myhost=`hostname`
             export OMNIORB_CONFIG=${HOME}/.omniORB_${myhost}_${NSPORT}.cfg
+           export NSPORT
             local initref="NameService=corbaname::"`hostname`":$NSPORT"
             echo "ORBInitRef $initref" > $OMNIORB_CONFIG
             break
index 687d5d093b8c9e96437c4c4646b5e2365bb82fbf..2b66e799c3ecd08b254deeb208757f319a507589 100644 (file)
@@ -436,13 +436,14 @@ dnl directory
 
 mkdir -p bin/salome
 cd bin/salome
-for i in $ROOT_SRCDIR/bin/*
+for i in  `find $ROOT_SRCDIR/bin`
 do
-  local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
+  local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR/bin,.,"`
   case "$local_bin" in
         *.in | *~) ;;
-        ./bin/CVS | ./bin/salome) ;;
-        *) $INSTALL $i .; echo $local_bin ;;
+        . | */CVS | */CVS/* | ./salome) ;;
+        ./appliskel |./appliskel/env.d) $INSTALL -d $local_bin ; echo $local_bin ;;
+        *) $INSTALL $i $local_bin; echo $local_bin ;;
   esac
 done
 cd $ROOT_BUILDDIR
index 77cebf354f276ab3fdf1011c6f677b222330fcbb..cc6c5d752e7e7264b1ce03911be9acd9338b268c 100644 (file)
@@ -13,6 +13,7 @@ const char *SALOME_ContainerManager::_ContainerManagerNameInNS="/ContainerManage
 
 SALOME_ContainerManager::SALOME_ContainerManager(CORBA::ORB_ptr orb)
 {
+  MESSAGE("constructor");
   _NS=new SALOME_NamingService(orb);
   PortableServer::POA_var root_poa=PortableServer::POA::_the_root_poa();
   PortableServer::POAManager_var pman = root_poa->the_POAManager();
@@ -27,15 +28,18 @@ SALOME_ContainerManager::SALOME_ContainerManager(CORBA::ORB_ptr orb)
   CORBA::Object_var obj=my_poa->id_to_reference(id);
   Engines::ContainerManager_var refContMan = Engines::ContainerManager::_narrow(obj);
   _NS->Register(refContMan,_ContainerManagerNameInNS);
+  MESSAGE("constructor end");
 }
 
 SALOME_ContainerManager::~SALOME_ContainerManager()
 {
+  MESSAGE("destructor");
   delete _NS;
 }
 
 void SALOME_ContainerManager::Shutdown()
 {
+  MESSAGE("Shutdown");
   ShutdownContainers();
   PortableServer::ObjectId_var oid = _default_POA()->servant_to_id(this);
   _default_POA()->deactivate_object(oid);
@@ -45,6 +49,7 @@ void SALOME_ContainerManager::Shutdown()
 
 void SALOME_ContainerManager::ShutdownContainers()
 {
+  MESSAGE("ShutdownContainers");
   _NS->Change_Directory("/Containers");
   vector<string> vec=_NS->list_directory_recurs();
   for(vector<string>::iterator iter=vec.begin();iter!=vec.end();iter++)
@@ -59,18 +64,20 @@ void SALOME_ContainerManager::ShutdownContainers()
 
 Engines::Container_ptr SALOME_ContainerManager::FindOrStartContainer(const char *containerName, const Engines::MachineList& possibleComputers)
 {
+  MESSAGE("FindOrStartContainer "<<containerName);
   Engines::Container_ptr ret=FindContainer(containerName,possibleComputers);
   if(!CORBA::is_nil(ret))
     return ret;
-  // Container doesn't exist try to launch it ...
+  MESSAGE("Container doesn't exist try to launch it ...");
   vector<string> vector;
   string theMachine=_LoadManager.FindBest(possibleComputers);
+  SCRUTE(theMachine);
   string command;
   if(theMachine==GetHostname())
     command=_ResManager.BuildCommandToLaunchLocalContainer(containerName);
   else
     command=_ResManager.BuildTempFileToLaunchRemoteContainer(theMachine,containerName);
-  _ResManager.RmTmpFile();
+  //_ResManager.RmTmpFile();
   int status=system(command.c_str());
   if (status == -1) {
     MESSAGE("SALOME_LifeCycleCORBA::StartOrFindContainer rsh failed (system command status -1)");
@@ -101,8 +108,10 @@ Engines::Container_ptr SALOME_ContainerManager::FindOrStartContainer(const char
 
 Engines::MachineList *SALOME_ContainerManager::GetFittingResources(const Engines::MachineParameters& params, const char *componentName)
 {
+  MESSAGE("GetFittingResources");
   vector<string> vec=_ResManager.GetFittingResources(params,componentName);
   Engines::MachineList *ret=new Engines::MachineList;
+  MESSAGE("Machine list length "<<vec.size());
   ret->length(vec.size());
   for(unsigned int i=0;i<vec.size();i++)
     {
@@ -113,12 +122,14 @@ Engines::MachineList *SALOME_ContainerManager::GetFittingResources(const Engines
 
 char* SALOME_ContainerManager::FindBest(const Engines::MachineList& possibleComputers)
   {
+    MESSAGE("FindBest");
     string theMachine=_LoadManager.FindBest(possibleComputers);
     return CORBA::string_dup(theMachine.c_str());
   }
 
 Engines::Container_ptr SALOME_ContainerManager::FindContainer(const char *containerName,const char *theMachine)
 {
+  MESSAGE("FindContainer "<<theMachine);
   string containerNameInNS(BuildContainerNameInNS(containerName,theMachine));
   SCRUTE(containerNameInNS);
   CORBA::Object_var obj = _NS->Resolve(containerNameInNS.c_str());
@@ -130,8 +141,10 @@ Engines::Container_ptr SALOME_ContainerManager::FindContainer(const char *contai
 
 Engines::Container_ptr SALOME_ContainerManager::FindContainer(const char *containerName,const Engines::MachineList& possibleComputers)
 {
+  MESSAGE("FindContainer "<<possibleComputers.length());
   for(unsigned int i=0;i<possibleComputers.length();i++)
     {
+      SCRUTE(possibleComputers[i]);
       Engines::Container_ptr cont=FindContainer(containerName,possibleComputers[i]);
       if( !CORBA::is_nil(cont) )
        return cont;
@@ -141,6 +154,7 @@ Engines::Container_ptr SALOME_ContainerManager::FindContainer(const char *contai
 
 string SALOME_ContainerManager::BuildContainerNameInNS(const char *containerName,const char *machineName)
 {
+  MESSAGE("BuildContainerNameInNS");
   string containerNameInNS("/Containers/");
   containerNameInNS+=machineName;
   containerNameInNS+="/";
index 77297a4124363e76282eab1578212a2796770de1..b63bca83775ff508ce684a0d3d6cce0259e541f8 100644 (file)
@@ -1,4 +1,5 @@
 #include "SALOME_ContainerManager.hxx"
+#include "SALOMETraceCollector.hxx"
 #include "utilities.h"
 
 int main(int argc, char* argv[])
@@ -8,6 +9,9 @@ int main(int argc, char* argv[])
   CORBA::Object_var obj;
 
   CORBA::ORB_var orb = CORBA::ORB_init( argc , argv ) ;
+  SALOMETraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
+  INFOS_COMPILATION;
+  BEGIN_OF(argv[0]);
   try{ 
        obj = orb->resolve_initial_references("RootPOA");
        if(!CORBA::is_nil(obj))
@@ -35,5 +39,7 @@ int main(int argc, char* argv[])
   }catch(...){
     MESSAGE("Caught unknown exception.");
   }
+  END_OF(argv[0]);
+  delete myThreadTrace;
 }
 
index c8241085f1ce6712c99c83e46cc5d17634ed60ef..2cfb6d17402c99abf51b8559c8b878bd5eb6fb19 100644 (file)
@@ -8,3 +8,8 @@ obj=lcc.FindOrLoad_Component("FactoryServer","SalomeTestComponent")
 comp=obj._narrow(Engines.TestComponent)
 comp.Coucou(1)
 
+param={}
+param['hostname']='cli76ce'
+param['container_name']='myContainer'
+smesh=lcc.FindElseLoadComponent(param,'SMESH')
+
index da3c8997719c5ed064796246f516d69831eba151..b9954ade1fc07586ffcb93a7e20baa95535e403a 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#include "utilities.h"
 
 #define MAX_SIZE_FOR_HOSTNAME 256;
 
@@ -27,8 +28,12 @@ SALOME_ResourcesManager::SALOME_ResourcesManager(const char *xmlFilePath):_path_
 
 SALOME_ResourcesManager::SALOME_ResourcesManager()
 {
-  _path_resources=getenv("KERNEL_ROOT_DIR");
-  _path_resources+="/share/salome/resources/CatalogResources.xml";
+//   _path_resources=getenv("KERNEL_ROOT_DIR");
+//   _path_resources+="/share/salome/resources/CatalogResources.xml";
+  _path_resources=getenv("HOME");
+  _path_resources+="/";
+  _path_resources+=getenv("APPLI");
+  _path_resources+="/CatalogResources.xml";
   ParseXmlFile();
 }
 
@@ -38,18 +43,26 @@ SALOME_ResourcesManager::~SALOME_ResourcesManager()
 
 vector<string> SALOME_ResourcesManager::GetFittingResources(const Engines::MachineParameters& params,const char *moduleName) throw(SALOME_Exception)
 {
+  MESSAGE("GetFittingResources");
   vector <std::string> ret;
   //To be sure that we search in a correct list.
   ParseXmlFile();
   const char *hostname=(const char *)params.hostname;
+  SCRUTE(hostname);
   if(hostname[0]!='\0')
     {
       if(_resourcesList.find(hostname)!=_resourcesList.end())
-       // params.hostame is in the list of resources so return it.
-       ret.push_back(hostname);
+       {
+         // params.hostame is in the list of resources so return it.
+         MESSAGE("hostname " << hostname << " in catalog");
+         ret.push_back(hostname);
+       }
       else
-       //user specified an unknown hostame so notify to him.
-       throw SALOME_Exception("unknown host");
+       {
+         ASSERT(0);
+         //user specified an unknown hostame so notify to him.
+         throw SALOME_Exception("unknown host");
+       }
     }
   else
     // Search for available resources sorted by priority
@@ -178,64 +191,77 @@ string SALOME_ResourcesManager::FindBest(const Engines::MachineList& listOfMachi
 
 string SALOME_ResourcesManager::BuildTempFileToLaunchRemoteContainer(const string& machine,const char *containerName)
 {
-  _TmpFileName=BuildTemporaryFileName();
-  ofstream tempOutputFile;
-  tempOutputFile.open(_TmpFileName.c_str(),ofstream::out );
+//   _TmpFileName=BuildTemporaryFileName();
+//   SCRUTE(_TmpFileName);
+//   ofstream tempOutputFile;
+//   tempOutputFile.open(_TmpFileName.c_str(),ofstream::out );
+
   const ParserResourcesType& resInfo=_resourcesList[machine];
-  tempOutputFile << "#! /bin/sh" << endl;
-  //set env vars
-  for(map<string,string>::const_iterator iter=resInfo.ModulesPath.begin();iter!=resInfo.ModulesPath.end();iter++)
-    {
-      string curModulePath((*iter).second);
-      tempOutputFile << (*iter).first << "_ROOT_DIR="<< curModulePath << endl;
-      tempOutputFile << "export " << (*iter).first << "_ROOT_DIR" << endl;
-      tempOutputFile << "LD_LIBRARY_PATH=" << curModulePath << "/lib/salome" << ":${LD_LIBRARY_PATH}" << endl;
-      tempOutputFile << "PYTHONPATH=" << curModulePath << "/bin/salome:" << curModulePath << "/lib/salome:" << curModulePath << "/lib/python2.2/site-packages/salome:";
-      tempOutputFile << curModulePath << "/lib/python2.2/site-packages/salome/shared_modules:${PYTHONPATH}" << endl;
-    }
-  tempOutputFile << "export LD_LIBRARY_PATH" << endl;
-  tempOutputFile << "export PYTHONPATH" << endl;
-  tempOutputFile << "source " << resInfo.PreReqFilePath << endl;
-  // ! env vars
-  tempOutputFile << (*(resInfo.ModulesPath.find("KERNEL"))).second << "/bin/salome/";
-  if(Engines_Container_i::isPythonContainer(containerName))
-    tempOutputFile << "SALOME_ContainerPy.py ";
-  else
-    tempOutputFile << "SALOME_Container ";
-  tempOutputFile << containerName << " -";
-  AddOmninamesParams(tempOutputFile);
-  tempOutputFile << " &" << endl;
-  tempOutputFile.flush();
-  tempOutputFile.close();
-  chmod(_TmpFileName.c_str(),0x1ED);
+
+//   tempOutputFile << "#! /bin/sh" << endl;
+//   //set env vars
+//   for(map<string,string>::const_iterator iter=resInfo.ModulesPath.begin();iter!=resInfo.ModulesPath.end();iter++)
+//     {
+//       string curModulePath((*iter).second);
+//       tempOutputFile << (*iter).first << "_ROOT_DIR="<< curModulePath << endl;
+//       tempOutputFile << "export " << (*iter).first << "_ROOT_DIR" << endl;
+//       tempOutputFile << "LD_LIBRARY_PATH=" << curModulePath << "/lib/salome" << ":${LD_LIBRARY_PATH}" << endl;
+//       tempOutputFile << "PYTHONPATH=" << curModulePath << "/bin/salome:" << curModulePath << "/lib/salome:" << curModulePath << "/lib/python2.2/site-packages/salome:";
+//       tempOutputFile << curModulePath << "/lib/python2.2/site-packages/salome/shared_modules:${PYTHONPATH}" << endl;
+//     }
+//   tempOutputFile << "export LD_LIBRARY_PATH" << endl;
+//   tempOutputFile << "export PYTHONPATH" << endl;
+//   tempOutputFile << "source " << resInfo.PreReqFilePath << endl;
+//   // ! env vars
+//   tempOutputFile << (*(resInfo.ModulesPath.find("KERNEL"))).second << "/bin/salome/";
+//   if(Engines_Container_i::isPythonContainer(containerName))
+//     tempOutputFile << "SALOME_ContainerPy.py ";
+//   else
+//     tempOutputFile << "SALOME_Container ";
+//   tempOutputFile << containerName << " -";
+//   AddOmninamesParams(tempOutputFile);
+//   tempOutputFile << " &" << endl;
+//   tempOutputFile.flush();
+//   tempOutputFile.close();
+//   chmod(_TmpFileName.c_str(),0x1ED);
   //Build command
   string command;
   if(resInfo.Protocol==rsh)
     {
       command = "rsh ";
-      string commandRcp="rcp ";
-      commandRcp+=_TmpFileName;
-      commandRcp+=" ";
-      commandRcp+=machine;
-      commandRcp+=":";
-      commandRcp+=_TmpFileName;
-      system(commandRcp.c_str());
+//       string commandRcp="rcp ";
+//       commandRcp+=_TmpFileName;
+//       commandRcp+=" ";
+//       commandRcp+=machine;
+//       commandRcp+=":";
+//       commandRcp+=_TmpFileName;
+//       system(commandRcp.c_str());
     }
   else if(resInfo.Protocol==ssh)
     command = "ssh ";
   else
     throw SALOME_Exception("Unknown protocol");
-  command+=machine;
-  _CommandForRemAccess=command;
-  command+=" ";
-  command+=_TmpFileName;
-  command += " > ";
-  command += "/tmp/";
-  command += containerName;
-  command += "_";
+//   command+=machine;
+//   _CommandForRemAccess=command;
+//   command+=" ";
+//   command+=_TmpFileName;
+//   command += " > ";
+//   command += "/tmp/";
+//   command += containerName;
+//   command += "_";
+//   command += machine;
+//   command += ".log &";
   command += machine;
-  command += ".log &";
-  cout << "Command is ... " << command << endl;
+  command += " ${HOME}/";
+  command += getenv("APPLI");
+  command += "/runRemote.sh ";
+  command += GetHostname();
+  command += " ";
+  command += getenv("NSPORT");
+  command += " SALOME_Container ";
+  command += containerName;
+  command += "&";
+  MESSAGE( "Command is ... " << command);
   return command;
 }