# $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 : working directory
-# $4 and following : local command to execute, with args
+# $3 : WORKINGDIR (if $3 == WORKINDIR a working dir is given in $4. If not the working dir is $HOME)
+# $4 : if $3 == WORKINGDIR, the path to the workingdir
+# $5 (or $3 if no workingdir given) and following : local command to execute, with args
#
# --- retrieve APPLI path, relative to $HOME, set ${APPLI}
echo "ORBInitRef $initref" > $OMNIORB_CONFIG
#go to the requested working directory if any
-if test "x$3" != x; then
- if test "x$3" = "x\$TEMPDIR"; then
+if test "x$3" == "xWORKINGDIR"; then
+ if test "x$4" = "x\$TEMPDIR"; then
#create a temp working dir and change to it
WDIR=`mktemp -d` && {
cd $WDIR
}
else
- if test -d $3; then
+ if test -d $4; then
#the dir exists, go to it
- cd $3
+ cd $4
else
- if test -a $3; then
+ if test -a $4; then
# It's a file do nothing
- echo $3 "is an existing file. Can't use it as a working directory"
+ echo $4 "is an existing file. Can't use it as a working directory"
else
#It does not exists, create it
- mkdir -p $3 && {
- cd $3
+ mkdir -p $4 && {
+ cd $4
}
fi
fi
fi
+ shift 4
+else
+ shift 2
fi
# --- execute the command in the SALOME environment
-shift 3
# suppress --rcfile option because of problem on Mandriva2006 - B Secher mai 2007
#${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/sh --rcfile $HOME/$APPLI/.bashrc -c "$*"
<objref name="CALCIUM_real" id="IDL:Ports/Calcium_Ports/Calcium_Real_Port:1.0"/>
<objref name="CALCIUM_double" id="IDL:Ports/Calcium_Ports/Calcium_Double_Port:1.0"/>
<objref name="CALCIUM_string" id="IDL:Ports/Calcium_Ports/Calcium_String_Port:1.0"/>
+ <objref name="CALCIUM_logical" id="IDL:Ports/Calcium_Ports/Calcium_Logical_Port:1.0"/>
<objref name="CALCIUM_boolean" id="IDL:Ports/Calcium_Ports/Calcium_Logical_Port:1.0"/>
+ <objref name="CALCIUM_complex" id="IDL:Ports/Calcium_Ports/Calcium_Complex_Port:1.0"/>
<objref name="BASIC_short" id="IDL:Ports/Data_Short_Port:1.0"/>
<objref name="Study" id="IDL:SALOMEDS/Study:1.0"/>
<objref name="SObject" id="IDL:SALOMEDS/SObject:1.0"/>
}
//redirect stdout and stderr in a file
- string logFilename="/tmp/"+_NS->ContainerName(params)+"_"+GetHostname()+"_"+getenv( "USER" )+".log" ;
+ string logFilename="/tmp/"+_NS->ContainerName(params)+"_"+ theMachine +"_"+getenv( "USER" )+".log" ;
command += " > " + logFilename + " 2>&1 &";
// launch container with a system call
} catch ( const CalciumException & ex) { \
DEBTRACE( ex.what() ); \
return ex.getInfo(); \
+ } catch ( ... ) { \
+ std::cerr << "Unexpected exception " << std::endl; \
+ return CalciumTypes::CPATAL; \
} \
if ( IsSameType< _name , cplx >::value ) { *nRead=_nRead/2; \
DEBTRACE( "-------- CalciumInterface(lecture Inter Part) IsSameType cplx -------------" ) \
} catch ( const CalciumException & ex) { \
std::cerr << ex.what() << std::endl; \
return ex.getInfo(); \
+ } catch ( ... ) { \
+ std::cerr << "Unexpected exception " << std::endl; \
+ return CalciumTypes::CPATAL; \
} \
DEBTRACE( "-------- CalciumInterface(ecriture Inter Part), Valeur de data :" << data ) \
return CalciumTypes::CPOK; \
* see BuildTempFileToLaunchRemoteContainer()
*
* Else rely on distant configuration. Command is under the form (example):
- * ssh user@machine distantPath/runRemote.sh hostNS portNS workingdir \
+ * ssh user@machine distantPath/runRemote.sh hostNS portNS WORKINGDIR workingdir \
* SALOME_Container containerName &"
* - where user is ommited if not specified in CatalogResources,
* use to launch SALOME and servers in $APPLI: runAppli.sh, runRemote.sh)
* - where portNS is the port used by CORBA naming server (set by scripts to
* use to launch SALOME and servers in $APPLI: runAppli.sh, runRemote.sh)
- * - where workingdir is the requested working directory for the container
+ * - where workingdir is the requested working directory for the container.
+ * If WORKINGDIR (and workingdir) is not present the working dir will be $HOME
*/
//=============================================================================
nbproc = params.nb_node * params.nb_proc_per_node;
}
- // "ssh user@machine distantPath/runRemote.sh hostNS portNS workingdir \
+ // "ssh user@machine distantPath/runRemote.sh hostNS portNS WORKINGDIR workingdir \
// SALOME_Container containerName &"
if (resInfo.Protocol == rsh)
ASSERT(getenv("NSPORT"));
command += getenv("NSPORT"); // port of CORBA name server
- command += " '";
std::string wdir=params.workingdir.in();
- if(wdir == "$TEMPDIR")
- wdir="\\$TEMPDIR";
- command += wdir; // requested working directory
- command += "'";
+ if(wdir != "")
+ {
+ command += " WORKINGDIR ";
+ command += " '";
+ if(wdir == "$TEMPDIR")
+ wdir="\\$TEMPDIR";
+ command += wdir; // requested working directory
+ command += "'";
+ }
if(params.isMPI)
{
{
command="";
std::string wdir=params.workingdir.in();
- std::cerr << wdir << std::endl;
if(wdir != "")
{
// a working directory is requested