From: caremoli Date: Fri, 28 Mar 2008 08:10:24 +0000 (+0000) Subject: CCAR: change computer name in container log file name X-Git-Tag: V5_0_0a1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d024cd232a3222c35e929f593010584f638ac183;p=modules%2Fkernel.git CCAR: change computer name in container log file name add exception catch in calcium interface add calcium types in catalog change specification of working dir in resources manager and runRemote.sh --- diff --git a/bin/appliskel/runRemote.sh b/bin/appliskel/runRemote.sh index 522b6ddd7..ad57495cd 100755 --- a/bin/appliskel/runRemote.sh +++ b/bin/appliskel/runRemote.sh @@ -37,8 +37,9 @@ # $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} @@ -62,33 +63,35 @@ initref="NameService=corbaname::"$1":$2" 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 "$*" diff --git a/resources/KERNELCatalog.xml.in b/resources/KERNELCatalog.xml.in index 8986273ce..1452381ff 100644 --- a/resources/KERNELCatalog.xml.in +++ b/resources/KERNELCatalog.xml.in @@ -27,7 +27,9 @@ + + diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index dd6ee5a30..b3be8a826 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -279,7 +279,7 @@ StartContainer(const Engines::MachineParameters& params, } //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 diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumInterface.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumInterface.hxx index 504d3b256..62994aa97 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumInterface.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumInterface.hxx @@ -105,6 +105,9 @@ ecp_fin_ (void * component, int code) { } 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 -------------" ) \ @@ -144,6 +147,9 @@ ecp_fin_ (void * component, int code) { } 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; \ diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index ea88da8f8..b6064ac54 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -473,7 +473,7 @@ bool isPythonContainer(const char* ContainerName) * 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, @@ -483,7 +483,8 @@ bool isPythonContainer(const char* ContainerName) * 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 */ //============================================================================= @@ -515,7 +516,7 @@ SALOME_ResourcesManager::BuildCommandToLaunchRemoteContainer 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) @@ -551,12 +552,16 @@ SALOME_ResourcesManager::BuildCommandToLaunchRemoteContainer 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) { @@ -632,7 +637,6 @@ SALOME_ResourcesManager::BuildCommandToLaunchLocalContainer { command=""; std::string wdir=params.workingdir.in(); - std::cerr << wdir << std::endl; if(wdir != "") { // a working directory is requested