]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
- Bug--, set home to the PBS file
authorribes <ribes>
Tue, 20 May 2008 09:24:32 +0000 (09:24 +0000)
committerribes <ribes>
Tue, 20 May 2008 09:24:32 +0000 (09:24 +0000)
src/Launcher/BatchLight_BatchTest.cxx
src/Launcher/BatchLight_BatchTest.hxx

index 954d338058febac9486daadd52fae0486a6615cd..b81688a38f83dd30091e2e0d9c3b63be2e1aeca9 100644 (file)
@@ -108,7 +108,9 @@ BatchLight_BatchTest::test_connection()
   // Build command
   command += protocol
          + " "
-         + username + "@" + alias;
+         + username + "@" + alias
+         + " 'echo $HOME' > "
+         + _test_filename + "_home";
 
   // Test
   status = system(command.c_str());
@@ -120,6 +122,16 @@ BatchLight_BatchTest::test_connection()
     return result;
   }
 
+  std::string file_home_name = _test_filename + "_home";
+  std::ifstream file_home(file_home_name.c_str());
+  if (!file_home)
+  {
+    result += "Error in reading temporary file ! filename = " + file_home_name;
+    return result;
+  }
+  std::getline(file_home, _home);
+  file_home.close();
+
   result = "OK";
   return result;
 }
@@ -273,8 +285,8 @@ BatchLight_BatchTest::test_jobsubmit_simple()
   file << "#!/bin/bash\n"
        << "#PBS -l nodes=1\n"
        << "#PBS -l walltime=00:01:00\n"
-       << "#PBS -o " + _date + "_simple_output.log\n"
-       << "#PBS -e " + _date + "_simple_error.log\n"
+       << "#PBS -o " + _home + "/" + _date + "_simple_output.log\n"
+       << "#PBS -e " + _home + "/" + _date + "_simple_error.log\n"
        << "echo Bonjour\n"
        << "echo Error >&2\n";
   file.flush();
@@ -446,8 +458,8 @@ BatchLight_BatchTest::test_jobsubmit_mpi()
   file_mpi << "#!/bin/bash\n"
           << "#PBS -l nodes=1\n"
           << "#PBS -l walltime=00:01:00\n"
-          << "#PBS -o "<< _date << "_mpi_output.log\n"
-          << "#PBS -e " << _date << "_mpi_error.log\n"
+          << "#PBS -o " << _home << "/" << _date << "_mpi_output.log\n"
+          << "#PBS -e " << _home << "/" << _date << "_mpi_error.log\n"
           << mpiImpl->boot("${PBS_NODEFILE}", 1)
           << mpiImpl->run("${PBS_NODEFILE}", 1, _base_filename + "_script")
           << mpiImpl->halt();
index 0224965c7bda219d13684fbecee7d91ad7021eb9..b936a2854b91e6f5c67dbf8ccc057f87f298e6c3 100644 (file)
@@ -55,6 +55,7 @@ class BatchLight_BatchTest
     std::string _test_filename;
     std::string _base_filename;
     std::string _date;
+    std::string _home;
 };
 
 #endif