]> SALOME platform Git repositories - tools/libbatch.git/commitdiff
Salome HOME
Fix bug with WallTime in OAR (minutes instead of seconds) V2_0_0 V2_0_0b1 V2_0_0rc1
authorbarate <barate>
Wed, 3 Apr 2013 08:06:39 +0000 (08:06 +0000)
committerbarate <barate>
Wed, 3 Apr 2013 08:06:39 +0000 (08:06 +0000)
src/COORM/BatchManager_COORM.cxx
src/COORM/BatchManager_COORM.hxx
src/OAR/BatchManager_OAR.cxx
src/OAR/BatchManager_OAR.hxx

index 9e50e5be96a3d3d4cdb371a88786324034c2da05..7873bc98c6b966e6cc0d2e3a2978db70fcd3edcd 100644 (file)
@@ -224,18 +224,6 @@ namespace Batch
     return remoteFileName;
        }
 
-       const string BatchManager_COORM::convertSecTo_H_M_S(const long seconds)
-       {
-               int h(seconds / 3600);
-               int m((seconds % 3600) / 60);
-               int s((seconds % 3600) % 60);
-
-               stringstream ss;
-               ss << h << ":" << m << ":" << s;
-               
-               return ss.str();
-       }
-
        void BatchManager_COORM::exportInputFiles(const Job & job)
        {
                BatchManager::exportInputFiles(job);
index 33790b2c6a96bdf8125aa964875e445a986aabbc..037eaf3ddad09eda11e8bb15d03ab94b660f18e3 100644 (file)
@@ -56,7 +56,6 @@ namespace Batch
 
                protected:
                        std::string buildBatchScript(const Job & job);
-                       const std::string convertSecTo_H_M_S(const long seconds);
                        void exportInputFiles(const Job & job);
 
 #ifdef SWIG
index 5c050a92c915a05273441cbcce6a945522e5b96e..6b28be0a1a2c7708f39443281612a4dc22a81e92 100644 (file)
@@ -134,7 +134,6 @@ namespace Batch
                string fileToExecute = "";
                string tmpDir = "";
                int nbproc               = 0;
-               int edt          = 0;
                int mem              = 0;
                string queue         = "";
 
@@ -154,8 +153,9 @@ namespace Batch
     int nbprocpernode = 1;
     if (params.find(NBPROCPERNODE) != params.end())
       nbprocpernode = params[NBPROCPERNODE];
+    long walltimeSecs = 0;
                if (params.find(MAXWALLTIME) != params.end()) 
-                       edt = params[MAXWALLTIME];
+                 walltimeSecs = (long)params[MAXWALLTIME] * 60;
                if (params.find(MAXRAMSIZE) != params.end()) 
                        mem = params[MAXRAMSIZE];
                if (params.find(QUEUE) != params.end()) 
@@ -191,9 +191,9 @@ namespace Batch
                if (nb_full_nodes > 0)
                {
                        tempOutputFile << "#OAR -l nodes=" << nb_full_nodes;
-                       if (edt > 0)
+                       if (walltimeSecs > 0)
                        {
-                               tempOutputFile << ",walltime=" << convertSecTo_H_M_S(edt) << endl;
+                               tempOutputFile << ",walltime=" << convertSecTo_H_M_S(walltimeSecs) << endl;
                        }
                        else
                        {
@@ -202,9 +202,9 @@ namespace Batch
                }
                else
                {
-                       if (edt > 0)
+                       if (walltimeSecs > 0)
                        {
-                               tempOutputFile << "#OAR -l walltime=" << convertSecTo_H_M_S(edt) << endl;
+                               tempOutputFile << "#OAR -l walltime=" << convertSecTo_H_M_S(walltimeSecs) << endl;
                        }
                }
 
@@ -237,7 +237,7 @@ namespace Batch
     return remoteFileName;
        }
 
-       const string BatchManager_OAR::convertSecTo_H_M_S(const long seconds)
+       string BatchManager_OAR::convertSecTo_H_M_S(long seconds) const
        {
                int h(seconds / 3600);
                int m((seconds % 3600) / 60);
index eef325bcb3400585410556e8acdf47f55272b816..482a4e562127a7e3e2b90dee215917c7c8ab264a 100644 (file)
@@ -56,7 +56,7 @@ namespace Batch
 
                protected:
                        std::string buildBatchScript(const Job & job);
-                       const std::string convertSecTo_H_M_S(const long seconds);
+                       std::string convertSecTo_H_M_S(long seconds) const;
 
 #ifdef SWIG
                public: