From: Ovidiu Mircescu Date: Mon, 15 Dec 2014 16:47:25 +0000 (+0100) Subject: Add the possibility to retrieve one single file. X-Git-Tag: V2_3_0~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fomu%2Fpleiade9110;p=tools%2Flibbatch.git Add the possibility to retrieve one single file. 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. --- 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;