_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");
}
SALOME_ContainerManager::~SALOME_ContainerManager()
{
MESSAGE("destructor");
+#ifdef HAVE_MPI2
+ if( getenv("OMPI_URI_FILE") != NULL )
+ system("killall ompi-server");
+#endif
}
//=============================================================================
command = BuildCommandToLaunchRemoteContainer(theMachine,params,container_exe);
//redirect stdout and stderr in a file
- string logFilename="/tmp/"+_NS->ContainerName(params)+"_"+ theMachine +"_"+getenv( "USER" )+".log" ;
- command += " > " + logFilename + " 2>&1 &";
+#ifdef WNT
+ string logFilename=getenv("TEMP");
+ logFilename += "\\";
+#else
+ string logFilename="/tmp";
+ char* val = getenv("SALOME_TMP_DIR");
+ if(val)
+ {
+ struct stat file_info;
+ stat(val, &file_info);
+ bool is_dir = S_ISDIR(file_info.st_mode);
+ if (is_dir)logFilename=val;
+ else std::cerr << "SALOME_TMP_DIR environment variable is not a directory use /tmp instead" << std::endl;
+ }
+ logFilename += "/";
+#endif
+ logFilename += _NS->ContainerName(params)+"_"+ theMachine +"_"+getenv( "USER" )+".log" ;
+ command += " > " + logFilename + " 2>&1";
+#ifdef WNT
+ command = "%PYTHONBIN% -c \"import win32pm ; win32pm.spawnpid(r'" + command + "', '')\"";
+#else
+ command += " &";
+#endif
// launch container with a system call
int status=system(command.c_str());