]> SALOME platform Git repositories - tools/libbatch.git/blobdiff - src/Local/Batch_BatchManager_Local.cxx
Salome HOME
deactivate rlimits for jobs launched with BatchManager_Local (fix bug PAL #2354)
[tools/libbatch.git] / src / Local / Batch_BatchManager_Local.cxx
index c7d3f60d0f857065feee0ac6a341f8d4bd9f45c2..2098e1c91d8abe6520b81151cbcfcbf18ff7440b 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -549,7 +549,7 @@ namespace Batch {
     while (1) {
 #ifdef WIN32
       DWORD exitCode;
-      BOOL res = GetExitCodeProcess(child, &exitCode);
+      GetExitCodeProcess(child, &exitCode);
       if (exitCode != STILL_ACTIVE) {
         UNDER_LOCK( cout << "Father sees his child is DONE: exit code = " << exitCode << endl );
         break;
@@ -763,6 +763,9 @@ namespace Batch {
 
 
       // On positionne les limites systeme imposees au fils
+      // This part is deactivated because those limits should be set on the job process, not on
+      // the ssh process. If it is done properly one day, beware of the types used (int is not enough)
+      /*
       if (param.find(MAXCPUTIME) != param.end()) {
         int maxcputime = param[MAXCPUTIME];
         struct rlimit limit;
@@ -786,6 +789,7 @@ namespace Batch {
         limit.rlim_max = int(maxramsize * 1.1) * 1024 * 1024;
         setrlimit(RLIMIT_AS, &limit);
       }
+      */
 
 
       //char *const parmList[] = {"/usr/bin/ssh", "localhost", "-l", "aribes", "sleep 1 && echo end", NULL};
@@ -881,7 +885,7 @@ namespace Batch {
       char * buffer = strdup(comstr.c_str());
 
       // launch the new process
-      BOOL res = CreateProcess(NULL, buffer, NULL, NULL, FALSE,
+      bool res = CreateProcess(NULL, buffer, NULL, NULL, FALSE,
                                CREATE_NO_WINDOW, chNewEnv, NULL, &si, &pi);
 
       if (buffer) free(buffer);