From 0ec8690734607a3a8aebd1988b4cf3dfb66347fe Mon Sep 17 00:00:00 2001 From: ribes Date: Tue, 20 May 2008 09:24:32 +0000 Subject: [PATCH] - Bug--, set home to the PBS file --- src/Launcher/BatchLight_BatchTest.cxx | 22 +++++++++++++++++----- src/Launcher/BatchLight_BatchTest.hxx | 1 + 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/Launcher/BatchLight_BatchTest.cxx b/src/Launcher/BatchLight_BatchTest.cxx index 954d33805..b81688a38 100644 --- a/src/Launcher/BatchLight_BatchTest.cxx +++ b/src/Launcher/BatchLight_BatchTest.cxx @@ -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(); diff --git a/src/Launcher/BatchLight_BatchTest.hxx b/src/Launcher/BatchLight_BatchTest.hxx index 0224965c7..b936a2854 100644 --- a/src/Launcher/BatchLight_BatchTest.hxx +++ b/src/Launcher/BatchLight_BatchTest.hxx @@ -55,6 +55,7 @@ class BatchLight_BatchTest std::string _test_filename; std::string _base_filename; std::string _date; + std::string _home; }; #endif -- 2.39.2