]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
clean warning message
authorsecher <secher>
Thu, 3 Mar 2011 14:39:57 +0000 (14:39 +0000)
committersecher <secher>
Thu, 3 Mar 2011 14:39:57 +0000 (14:39 +0000)
src/Container/SALOME_ContainerManager.cxx

index f2a5469a016256fd8e6aad19c0fa6c5af7123249..66577e1c1d51c65817d084155c74deab4fad5ff5 100644 (file)
@@ -86,11 +86,9 @@ SALOME_ContainerManager::SALOME_ContainerManager(CORBA::ORB_ptr orb, PortableSer
 
 #ifdef HAVE_MPI2
 #ifdef WITHOPENMPI
-  std::string urifile = getenv("HOME");
-  std::ostringstream mypid;
-  mypid << getpid();
-  urifile += "/.urifile_" + mypid.str();
-  setenv("OMPI_URI_FILE",urifile.c_str(),0);
+  std::stringstream urifile;
+  urifile << getenv("HOME") << "/.urifile_" << getpid();
+  setenv("OMPI_URI_FILE",urifile.str().c_str(),1);
   if( getenv("OMPI_URI_FILE") != NULL ){
     system("killall -q ompi-server");
     std::string command;
@@ -118,8 +116,12 @@ SALOME_ContainerManager::~SALOME_ContainerManager()
 #ifdef HAVE_MPI2
 #ifdef WITHOPENMPI
   if( getenv("OMPI_URI_FILE") != NULL ){
-    system("killall -q ompi-server");
-    system("rm -f ${OMPI_URI_FILE}");
+    int status=system("killall -q ompi-server");
+    if(status!=0)
+      throw SALOME_Exception("Error when killing ompi-server");
+    status=system("rm -f ${OMPI_URI_FILE}");
+    if(status!=0)
+      throw SALOME_Exception("Error when removing urifile");
   }
 #endif
 #endif