]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
CCAR: change computer name in container log file name V5_0_0a1 V5_0_0a2
authorcaremoli <caremoli>
Fri, 28 Mar 2008 08:10:24 +0000 (08:10 +0000)
committercaremoli <caremoli>
Fri, 28 Mar 2008 08:10:24 +0000 (08:10 +0000)
add exception catch in calcium interface
add calcium types in catalog
change specification of working dir in resources manager and runRemote.sh

bin/appliskel/runRemote.sh
resources/KERNELCatalog.xml.in
src/Container/SALOME_ContainerManager.cxx
src/DSC/DSC_User/Datastream/Calcium/CalciumInterface.hxx
src/ResourcesManager/SALOME_ResourcesManager.cxx

index 522b6ddd75e9f5888d078fa83175f49dc93589d5..ad57495cd8dc8984c598daaa97c33b9740592d5e 100755 (executable)
@@ -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 "$*"
index 8986273cea20789e91fbba657eb1aca682ceb7a1..1452381ff7c638fcfa0ddd08e7930374033a842a 100644 (file)
@@ -27,7 +27,9 @@
   <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"/>
index dd6ee5a308a3239049dc91473db4ca45d0ff7aa4..b3be8a826b49f3731519e0a3b390e8b4e233de60 100644 (file)
@@ -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
index 504d3b2562d182318e0071fd9bb0af797c796610..62994aa9741c260d4ec56315fe4c80ceb95fd443 100644 (file)
@@ -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;                                       \
index ea88da8f8de8b99f184482e23d9734fc8d62fd65..b6064ac54f913b5f0747ef1b40404c56ff0ee918 100644 (file)
@@ -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