From: secher Date: Tue, 25 Jan 2011 15:10:28 +0000 (+0000) Subject: add function to get dump state xml file X-Git-Tag: V1_3_0rc1~9 X-Git-Url: http://git.salome-platform.org/gitweb/?p=tools%2Flibbatch.git;a=commitdiff_plain;h=7d76447dbb0d80090c3293e71f4ec750292366be add function to get dump state xml file --- diff --git a/src/Core/Batch_BatchManager_eClient.cxx b/src/Core/Batch_BatchManager_eClient.cxx index 6b998ed..b434471 100644 --- a/src/Core/Batch_BatchManager_eClient.cxx +++ b/src/Core/Batch_BatchManager_eClient.cxx @@ -188,6 +188,33 @@ namespace Batch { } + void BatchManager_eClient::importDumpStateFile( const Job & job, const string directory ) + { + Parametre params = job.getParametre(); + + // Create local result directory + int status = CommunicationProtocol::getInstance(SH).makeDirectory(directory, "", ""); + if (status) { + string mess("Directory creation failed. Status is :"); + ostringstream status_str; + status_str << status; + mess += status_str.str(); + cerr << mess << endl; + } + + status = _protocol.copyFile(string(params[TMPDIR]) + string("/dumpState*.xml"), _hostname, _username, + directory, "", ""); + if (status) { + // Try to get what we can (logs files) + // throw BatchException("Error of connection on remote host"); + std::string mess("Copy command failed ! status is :"); + ostringstream status_str; + status_str << status; + mess += status_str.str(); + cerr << mess << endl; + } + } + MpiImpl *BatchManager_eClient::FactoryMpiImpl(string mpiImpl) { if(mpiImpl == "lam") diff --git a/src/Core/Batch_BatchManager_eClient.hxx b/src/Core/Batch_BatchManager_eClient.hxx index d46319e..55f299a 100644 --- a/src/Core/Batch_BatchManager_eClient.hxx +++ b/src/Core/Batch_BatchManager_eClient.hxx @@ -53,6 +53,7 @@ namespace Batch { CommunicationProtocolType protocolType = SSH, const char* mpiImpl="mpich1"); virtual ~BatchManager_eClient(); void importOutputFiles( const Job & job, const std::string directory ); + void importDumpStateFile( const Job & job, const std::string directory ); protected: const CommunicationProtocol & _protocol; // protocol to access _hostname