runSalome \
runSalome.csh \
runNS.sh \
+createAppli.sh \
launchConfigureParser.py \
salome.launch \
envSalome.py \
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)
@MODULE@
-install: install-bin install-include install-make install-end
+install: install-bin install-appliskel install-include install-make install-end
--- /dev/null
+<!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>
--- /dev/null
+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
--- /dev/null
+#!/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}
--- /dev/null
+#!/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}
+##
+
+#------------------------------------------------------------------------------
--- /dev/null
+#!/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
+
--- /dev/null
+#!/bin/bash
+
+for i in $1/env.d/*;do source ${i}; done
--- /dev/null
+#!/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
--- /dev/null
+#!/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 $*
--- /dev/null
+#!/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 "$*"
--- /dev/null
+#!/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
--- /dev/null
+<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>
--- /dev/null
+#!/bin/sh
+
+comName=`which $0`
+rep=`dirname $comName`
+
+cp -r $rep/appliskel $1
+chmod +x $1/*.sh $1/run* $1/envd
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
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
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();
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);
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++)
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)");
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++)
{
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());
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;
string SALOME_ContainerManager::BuildContainerNameInNS(const char *containerName,const char *machineName)
{
+ MESSAGE("BuildContainerNameInNS");
string containerNameInNS("/Containers/");
containerNameInNS+=machineName;
containerNameInNS+="/";
#include "SALOME_ContainerManager.hxx"
+#include "SALOMETraceCollector.hxx"
#include "utilities.h"
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))
}catch(...){
MESSAGE("Caught unknown exception.");
}
+ END_OF(argv[0]);
+ delete myThreadTrace;
}
comp=obj._narrow(Engines.TestComponent)
comp.Coucou(1)
+param={}
+param['hostname']='cli76ce'
+param['container_name']='myContainer'
+smesh=lcc.FindElseLoadComponent(param,'SMESH')
+
#include <sys/types.h>
#include <sys/stat.h>
+#include "utilities.h"
#define MAX_SIZE_FOR_HOSTNAME 256;
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();
}
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
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;
}