From 5be9b77a53a589499e8dd89f5bf8d1bc97b8a1a6 Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Mon, 15 Dec 2014 17:47:25 +0100 Subject: [PATCH] Add the possibility to retrieve one single file. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit EDF pleiade issue n° 9110 asked to have the possibility to retrieve a file before the end of the job, without retrieving all the result files. --- src/Core/BatchManager.cxx | 22 ++++++++++++++++++++++ src/Core/BatchManager.hxx | 2 ++ 2 files changed, 24 insertions(+) diff --git a/src/Core/BatchManager.cxx b/src/Core/BatchManager.cxx index 8746807..f5340bc 100644 --- a/src/Core/BatchManager.cxx +++ b/src/Core/BatchManager.cxx @@ -293,6 +293,28 @@ namespace Batch { return ret; } + bool BatchManager::importWorkFile( const Job & job, + const std::string& work_file, + const std::string& directory ) + { + Parametre params = job.getParametre(); + + // Create local result directory + int status = CommunicationProtocol::getInstance(SH).makeDirectory(directory, "", ""); + if (status) + LOG("Directory creation failed. Status is: " << status); + + bool ret = true; + status = _protocol.copyFile(string(params[WORKDIR]) + "/" + work_file, + _hostname, _username, + directory, "", ""); + if (status) { + LOG("Copy command failed. Status is: " << status); + ret = false; + } + return ret; + } + MpiImpl *BatchManager::FactoryMpiImpl(string mpiImpl) { if(mpiImpl == "lam") diff --git a/src/Core/BatchManager.hxx b/src/Core/BatchManager.hxx index fffb817..7eb9128 100644 --- a/src/Core/BatchManager.hxx +++ b/src/Core/BatchManager.hxx @@ -77,6 +77,8 @@ namespace Batch { long initSleepTime = 1, long maxSleepTime = 600); virtual void importOutputFiles( const Job & job, const std::string directory ); bool importDumpStateFile( const Job & job, const std::string directory ); + // copier le fichier work_file à partir du working_directory vers directory + virtual bool importWorkFile( const Job & job, const std::string& work_file, const std::string& directory ); // Get the underlying communication protocol const CommunicationProtocol & getProtocol() const; -- 2.39.2