Salome HOME
launch ompi-server with salome, and kill it at the end of Salome
authorsecher <secher>
Mon, 31 Aug 2009 12:42:14 +0000 (12:42 +0000)
committersecher <secher>
Mon, 31 Aug 2009 12:42:14 +0000 (12:42 +0000)
src/Container/SALOME_ContainerManager.cxx

index a110ba69dfabd53b6f307a5c8621b56ea8aa8d8e..84900334dcd51f2e1878575fa21389a67058e9b8 100644 (file)
@@ -81,6 +81,19 @@ SALOME_ContainerManager::SALOME_ContainerManager(CORBA::ORB_ptr orb, PortableSer
 
   _NS->Register(refContMan,_ContainerManagerNameInNS);
   _isAppliSalomeDefined = (getenv("APPLI") != 0);
+
+#ifdef HAVE_MPI2
+  if( getenv("OMPI_URI_FILE") != NULL ){
+    system("killall ompi-server");
+    string command;
+    command = "ompi-server -r ";
+    command += getenv("OMPI_URI_FILE");
+    int status=system(command.c_str());
+    if(status!=0)
+      throw SALOME_Exception("Error when launching ompi-server");
+  }
+#endif
+
   MESSAGE("constructor end");
 }
 
@@ -93,6 +106,10 @@ SALOME_ContainerManager::SALOME_ContainerManager(CORBA::ORB_ptr orb, PortableSer
 SALOME_ContainerManager::~SALOME_ContainerManager()
 {
   MESSAGE("destructor");
+#ifdef HAVE_MPI2
+  if( getenv("OMPI_URI_FILE") != NULL )
+    system("killall ompi-server");
+#endif
 }
 
 //=============================================================================