add_subdirectory (LSF)
add_subdirectory (PBS)
add_subdirectory (SGE)
+add_subdirectory (SSH)
# Make a copy of the built value and clear the built value for the next run of cmake
SET(SRC_FILES ${SRC_FILES_BUILD} CACHE INTERNAL "")
add_library (Batch SHARED ${SRC_FILES})
include_directories(${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/Core)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Local)
target_link_libraries(Batch ${PTHREAD_LIBRARY})
IF (WIN32)
#include <fstream>
#include <sstream>
+#include <stdlib.h>
+
#ifdef WIN32
#include <direct.h>
#include <io.h>
// Destructeur
BatchManager_eClient::~BatchManager_eClient()
{
- delete _mpiImpl;
+ if (_mpiImpl)
+ delete _mpiImpl;
}
void BatchManager_eClient::exportInputFiles(const Job& job)
Parametre params = job.getParametre();
Versatile V = params[OUTFILE];
Versatile::iterator Vit;
+ _username = string(params[USER]);
for(Vit=V.begin(); Vit!=V.end(); Vit++) {
CoupleType cpt = *static_cast< CoupleType * >(*Vit);
else if(mpiImpl == "prun")
return new MpiImpl_PRUN();
else if(mpiImpl == "nompi")
- throw EmulationException("you must specify an mpi implementation for batch manager");
+ return NULL;
else{
ostringstream oss;
oss << mpiImpl << " : not yet implemented";
class Job;
- class BATCH_EXPORT BatchManager_eClient : public BatchManager
+ class BATCH_EXPORT BatchManager_eClient : virtual public BatchManager
{
public:
// Constructeur et destructeur
#include <stdlib.h>
#include <iostream>
+#include <stdlib.h>
#include <Batch_config.h>
std::string getName() const;
void setName(const std::string & name);
- protected:
// Efface tous les elements internes de l'objet
virtual void eraseAll();
+ protected:
DiscriminatorType _discriminator; // type de l'element interne
size_type _maxsize; // nombre max d'elements internes
#include <string>
#include <sys/stat.h>
+#include <stdlib.h>
+#include <string.h>
+
#ifdef WIN32
#include <io.h>
#else
BatchManager_eLSF::BatchManager_eLSF(const FactBatchManager * parent, const char * host,
CommunicationProtocolType protocolType, const char * mpiImpl)
- : BatchManager_eClient(parent, host, protocolType, mpiImpl)
+ : BatchManager_eClient(parent, host, protocolType, mpiImpl),
+ BatchManager(parent, host)
{
// Nothing to do
}
string local = cp.getLocal();
string remote = cp.getRemote();
+ std::cerr << workdir << std::endl;
+ std::cerr << remote << std::endl;
+
int status = p_ta->getBatchManager().getProtocol().copyFile(local, "", "",
workdir + "/" + remote,
executionhost, user);
// On forke/exec un nouveau process pour pouvoir controler le fils
// (plus finement qu'avec un appel system)
// int rc = system(commande.c_str());
+ //char *const parmList[] = {"/usr/bin/ssh", "localhost", "-l", "aribes", "sleep 10 && echo end", NULL};
+ //execv("/usr/bin/ssh", parmList);
#ifdef WIN32
child = p_ta->launchWin32ChildProcess();
p_ta->pere(child);
int child_rc = 0;
pid_t child_wait_rc = waitpid(child, &child_rc, WNOHANG /* | WUNTRACED */);
if (child_wait_rc > 0) {
+ UNDER_LOCK( cout << "Status is: " << WIFEXITED( child_rc) << endl);
+ UNDER_LOCK( cout << "Status is: " << WEXITSTATUS( child_rc) << endl);
+ UNDER_LOCK( cout << "Status is: " << WIFSIGNALED( child_rc) << endl);
+ UNDER_LOCK( cout << "Status is: " << WTERMSIG( child_rc) << endl);
+ UNDER_LOCK( cout << "Status is: " << WCOREDUMP( child_rc) << endl);
+ UNDER_LOCK( cout << "Status is: " << WIFSTOPPED( child_rc) << endl);
+ UNDER_LOCK( cout << "Status is: " << WSTOPSIG( child_rc) << endl);
+ UNDER_LOCK( cout << "Status is: " << WIFCONTINUED( child_rc) << endl);
if (WIFSTOPPED(child_rc)) {
// NOTA : pour rentrer dans cette section, il faut que le flag WUNTRACED
// soit positionne dans l'appel a waitpid ci-dessus. Ce flag est couramment
Parametre param = _job.getParametre();
Parametre::iterator it;
+ //char *const parmList[] = {"/usr/bin/ssh", "localhost", "-l", "aribes", "sleep 1 && echo end", NULL};
+ //int result = execv("/usr/bin/ssh", parmList);
+ //UNDER_LOCK( cout << "*** debug_command = " << result << endl );
+ //UNDER_LOCK( cout << "*** debug_command = " << strerror(errno) << endl );
try {
// EXECUTABLE is MANDATORY, if missing, we exit with failure notification
argv[command.size()] = NULL;
UNDER_LOCK( cout << "*** debug_command = " << comstr << endl );
+ UNDER_LOCK( cout << "*** debug_command = " << argv[0] << endl );
// Create the environment for the new process. Note (RB): Here we change the environment for
// the process launched in local. It would seem more logical to set the environment for the
envp[i] = NULL;
}
+ //char *const parmList[] = {"/usr/bin/ssh", "localhost", "-l", "aribes", "sleep 1 && echo end", NULL};
+ //int result = execv("/usr/bin/ssh", parmList);
+ //UNDER_LOCK( cout << "*** debug_command = " << result << endl );
+ //UNDER_LOCK( cout << "*** debug_command = " << strerror(errno) << endl );
// On positionne les limites systeme imposees au fils
if (param.find(MAXCPUTIME) != param.end()) {
+ UNDER_LOCK( cout << "AAAAAAAAAAAAAAAAAAaa" << endl );
int maxcputime = param[MAXCPUTIME];
struct rlimit limit;
limit.rlim_cur = maxcputime;
}
if (param.find(MAXDISKSIZE) != param.end()) {
+ UNDER_LOCK( cout << "BBBBBBBBBBBBBBBBBBBbb" << endl );
int maxdisksize = param[MAXDISKSIZE];
struct rlimit limit;
limit.rlim_cur = maxdisksize * 1024;
}
if (param.find(MAXRAMSIZE) != param.end()) {
+ UNDER_LOCK( cout << "CCCCCCCCCCCCCCCCCcc" << endl );
int maxramsize = param[MAXRAMSIZE];
struct rlimit limit;
limit.rlim_cur = maxramsize * 1024;
}
+ //char *const parmList[] = {"/usr/bin/ssh", "localhost", "-l", "aribes", "sleep 1 && echo end", NULL};
+ //int result = execv("/usr/bin/ssh", parmList);
+ //UNDER_LOCK( cout << "*** debug_command = " << result << endl );
+ //UNDER_LOCK( cout << "*** debug_command = " << strerror(errno) << endl );
// On cree une session pour le fils de facon a ce qu'il ne soit pas
// detruit lorsque le shell se termine (le shell ouvre une session et
// On execute la commande du fils
- execve(argv[0], argv, envp);
+ //int result = execve(argv[0], argv, envp);
+ std::cerr << "EXECVE !!!!!!" << std::endl;
+ execve(argv[0], argv, NULL);
+ UNDER_LOCK( cout << "*** debug_command = " << strerror(errno) << endl );
+ //int result = execv(argv[0], argv);
+ //
+ //char *const parmList[] = {"/usr/bin/ssh", "localhost", "-l", "aribes", "sleep 10 && echo end", NULL};
+ //int result = execv("/usr/bin/ssh", parmList);
// No need to deallocate since nothing happens after a successful exec
class FactBatchManager;
- class BATCH_EXPORT BatchManager_Local : public BatchManager
+ class BATCH_EXPORT BatchManager_Local : virtual public BatchManager
{
private:
#ifdef WIN32
#include <sstream>
#include <sys/stat.h>
+#include <stdlib.h>
+#include <string.h>
#include <Batch_config.h>
#ifdef MSVC
BatchManager_ePBS::BatchManager_ePBS(const FactBatchManager * parent, const char * host,
CommunicationProtocolType protocolType, const char * mpiImpl)
- : BatchManager_eClient(parent, host, protocolType, mpiImpl)
+ : BatchManager_eClient(parent, host, protocolType, mpiImpl),
+ BatchManager(parent, host)
{
// Nothing to do
}
#include <fstream>
#include <sstream>
#include <sys/stat.h>
+
+#include <stdlib.h>
+#include <string.h>
+
#ifdef WIN32
#include <io.h>
#else
BatchManager_eSGE::BatchManager_eSGE(const FactBatchManager * parent, const char * host,
CommunicationProtocolType protocolType, const char * mpiImpl)
- : BatchManager_eClient(parent, host, protocolType, mpiImpl)
+ : BatchManager_eClient(parent, host, protocolType, mpiImpl),
+ BatchManager(parent, host)
{
// Nothing to do
}
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+/*
+ * BatchManager_eSSH.cxx : emulation of SSH client
+ *
+ * Auteur : André RIBES - EDF R&D
+ * Date : Octobre 2009
+ */
+
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <sys/stat.h>
+
+#include <stdlib.h>
+#include <string.h>
+#include <Batch_config.h>
+
+#ifdef MSVC
+#include <io.h>
+#else
+#include <libgen.h>
+#endif
+
+#include "Batch_BatchManager_eSSH.hxx"
+#include "Batch_JobInfo_eSSH.hxx"
+
+using namespace std;
+
+namespace Batch {
+
+ BatchManager_eSSH::BatchManager_eSSH(const FactBatchManager * parent, const char * host,
+ CommunicationProtocolType protocolType, const char * mpiImpl)
+ : BatchManager_eClient(parent, host, protocolType, mpiImpl),
+ BatchManager_Local(parent, host, protocolType),
+ BatchManager(parent, host)
+ {
+ // Nothing to do
+ }
+
+ // Destructeur
+ BatchManager_eSSH::~BatchManager_eSSH()
+ {
+ // Nothing to do
+ }
+
+ // Methode pour le controle des jobs : soumet un job au gestionnaire
+ const JobId BatchManager_eSSH::submitJob(const Job & job)
+ {
+ // export input files on cluster
+ std::cerr << "BatchManager_eSSH::submitJob exportInputFiles" << std::endl;
+ Parametre param = job.getParametre();
+
+ // Creates job repertories
+ if (string(param[TMPDIR]) != "")
+ {
+ string subCommand = string("mkdir -p ") + string(param[TMPDIR]);
+ string command = BatchManager_eClient::_protocol.getExecCommand(subCommand, _hostname, _username);
+ cerr << command.c_str() << endl;
+ int status = system(command.c_str());
+ if(status) {
+ std::ostringstream oss;
+ oss << status;
+ std::string ex_mess("Error of connection on remote host ! status = ");
+ ex_mess += oss.str();
+ throw EmulationException(ex_mess.c_str());
+ }
+ }
+ if (string(param[TMPDIR]) != "")
+ {
+ string subCommand = string("mkdir -p ") + string(param[WORKDIR]);
+ string command = BatchManager_eClient::_protocol.getExecCommand(subCommand, _hostname, _username);
+ cerr << command.c_str() << endl;
+ int status = system(command.c_str());
+ if(status) {
+ std::ostringstream oss;
+ oss << status;
+ std::string ex_mess("Error of connection on remote host ! status = ");
+ ex_mess += oss.str();
+ throw EmulationException(ex_mess.c_str());
+ }
+ }
+
+ Parametre new_param(param);
+ new_param[OUTFILE].eraseAll(); // Patch until Local Manager is patched
+ Job * j = new Job(new_param);
+ std::cerr << "BatchManager_eSSH::submitJob Local submitJob" << std::endl;
+ JobId id = BatchManager_Local::submitJob(*j);
+ delete j;
+ return id;
+ }
+
+ // Methode pour le controle des jobs : retire un job du gestionnaire
+ void BatchManager_eSSH::deleteJob(const JobId & jobid)
+ {
+ BatchManager_Local::deleteJob(jobid);
+ }
+
+ // Methode pour le controle des jobs : renvoie l'etat du job
+ JobInfo BatchManager_eSSH::queryJob(const JobId & jobid)
+ {
+ return BatchManager_Local::queryJob(jobid);
+ }
+
+ // Methode pour le controle des jobs : suspend un job en file d'attente
+ void BatchManager_eSSH::holdJob(const JobId & jobid)
+ {
+ BatchManager_Local::holdJob(jobid);
+ }
+
+ // Methode pour le controle des jobs : relache un job suspendu
+ void BatchManager_eSSH::releaseJob(const JobId & jobid)
+ {
+ BatchManager_Local::releaseJob(jobid);
+ }
+
+ // Methode pour le controle des jobs : modifie un job en file d'attente
+ void BatchManager_eSSH::alterJob(const JobId & jobid, const Parametre & param, const Environnement & env)
+ {
+ BatchManager_Local::alterJob(jobid, param, env);
+ }
+
+ // Methode pour le controle des jobs : modifie un job en file d'attente
+ void BatchManager_eSSH::alterJob(const JobId & jobid, const Parametre & param)
+ {
+ BatchManager_Local::alterJob(jobid, param);
+ }
+
+ // Methode pour le controle des jobs : modifie un job en file d'attente
+ void BatchManager_eSSH::alterJob(const JobId & jobid, const Environnement & env)
+ {
+ BatchManager_Local::alterJob(jobid, env);
+ }
+
+ void BatchManager_eSSH::buildBatchScript(const Job & job)
+ {
+ Parametre params = job.getParametre();
+ Environnement env = job.getEnvironnement();
+ const long nbproc = params[NBPROC];
+ const long edt = params[MAXWALLTIME];
+ const long mem = params[MAXRAMSIZE];
+ const string workDir = params[WORKDIR];
+ const std::string dirForTmpFiles = params[TMPDIR];
+ const string fileToExecute = params[EXECUTABLE];
+ const string home = params[HOMEDIR];
+ const std::string queue = params[QUEUE];
+ std::string rootNameToExecute;
+ std::string fileNameToExecute;
+ std::string filelogtemp;
+ if( fileToExecute.size() > 0 ){
+ string::size_type p1 = fileToExecute.find_last_of("/");
+ string::size_type p2 = fileToExecute.find_last_of(".");
+ rootNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
+
+#ifdef MSVC
+ char fname[_MAX_FNAME];
+ char ext[_MAX_EXT];
+ _splitpath_s(fileToExecute.c_str(), NULL, 0, NULL, 0, fname, _MAX_FNAME, ext, _MAX_EXT);
+ string execBaseName = string(fname) + ext;
+#else
+ char* basec=strdup(fileToExecute.c_str());
+ string execBaseName = string(basename(basec));
+ free(basec);
+#endif
+
+ fileNameToExecute = "~/" + dirForTmpFiles + "/" + execBaseName;
+
+ int idx = dirForTmpFiles.find("Batch/");
+ filelogtemp = dirForTmpFiles.substr(idx+6, dirForTmpFiles.length());
+ }
+ else{
+ rootNameToExecute = "command";
+ }
+
+ ofstream tempOutputFile;
+ std::string TmpFileName = createAndOpenTemporaryFile("SSH-script", tempOutputFile);
+
+ tempOutputFile << "#! /bin/sh -f" << endl;
+ if (queue != "")
+ tempOutputFile << "#BSUB -q " << queue << endl;
+ if( edt > 0 )
+ tempOutputFile << "#SSH -l walltime=" << edt*60 << endl ;
+ if( mem > 0 )
+ tempOutputFile << "#SSH -l mem=" << mem << "mb" << endl ;
+ if( fileToExecute.size() > 0 ){
+ tempOutputFile << "#SSH -o " << home << "/" << dirForTmpFiles << "/output.log." << filelogtemp << endl ;
+ tempOutputFile << "#SSH -e " << home << "/" << dirForTmpFiles << "/error.log." << filelogtemp << endl ;
+ }
+ else{
+ tempOutputFile << "#SSH -o " << dirForTmpFiles << "/" << env["LOGFILE"] << ".output.log" << endl ;
+ tempOutputFile << "#SSH -e " << dirForTmpFiles << "/" << env["LOGFILE"] << ".error.log" << endl ;
+ }
+ if( workDir.size() > 0 )
+ tempOutputFile << "cd " << workDir << endl ;
+ if( fileToExecute.size() > 0 ){
+ tempOutputFile << _mpiImpl->boot("${SSH_NODEFILE}",nbproc);
+ tempOutputFile << _mpiImpl->run("${SSH_NODEFILE}",nbproc,fileNameToExecute);
+ tempOutputFile << _mpiImpl->halt();
+ }
+ else{
+ tempOutputFile << "source " << env["SOURCEFILE"] << endl ;
+ tempOutputFile << env["COMMAND"];
+ }
+
+ tempOutputFile.flush();
+ tempOutputFile.close();
+#ifdef WIN32
+ _chmod(
+#else
+ chmod(
+#endif
+ TmpFileName.c_str(), 0x1ED);
+ cerr << TmpFileName.c_str() << endl;
+
+ int status = Batch::BatchManager_eClient::_protocol.copyFile(TmpFileName, "", "",
+ dirForTmpFiles + "/" + rootNameToExecute + "_Batch.sh",
+ _hostname, _username);
+ if (status)
+ throw EmulationException("Error of connection on remote host");
+
+ remove(TmpFileName.c_str());
+ }
+
+}
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+/*
+ * BatchManager_eSSH.hxx : emulation of SSH client
+ *
+ * Auteur : André RIBES - EDF R&D
+ * Date : Octobre 2009
+ */
+
+#ifndef _BATCHMANAGER_ESSH_H_
+#define _BATCHMANAGER_ESSH_H_
+
+#include "Batch_Defines.hxx"
+#include "Batch_JobId.hxx"
+#include "Batch_JobInfo.hxx"
+#include "Batch_FactBatchManager.hxx"
+#include "Batch_BatchManager_eClient.hxx"
+#include "Batch_BatchManager_Local.hxx"
+
+namespace Batch {
+
+ class BATCH_EXPORT BatchManager_eSSH :
+ virtual public BatchManager_eClient,
+ virtual public BatchManager_Local
+ {
+ public:
+ // Constructeur et destructeur
+ BatchManager_eSSH(const FactBatchManager * parent, const char * host="localhost",
+ CommunicationProtocolType protocolType = SSH, const char * mpiImpl="nompi"); // connexion a la machine host
+ virtual ~BatchManager_eSSH();
+
+ // Recupere le nom du serveur par defaut
+ // static string BatchManager_LSF::getDefaultServer();
+
+ // Methodes pour le controle des jobs
+ virtual const JobId submitJob(const Job & job); // soumet un job au gestionnaire
+ virtual void deleteJob(const JobId & jobid); // retire un job du gestionnaire
+ virtual JobInfo queryJob(const JobId & jobid); // renvoie l'etat du job
+
+ // Non implanté...
+ virtual void holdJob(const JobId & jobid); // suspend un job en file d'attente
+ virtual void releaseJob(const JobId & jobid); // relache un job suspendu
+ virtual void alterJob(const JobId & jobid, const Parametre & param, const Environnement & env); // modifie un job en file d'attente
+ virtual void alterJob(const JobId & jobid, const Parametre & param); // modifie un job en file d'attente
+ virtual void alterJob(const JobId & jobid, const Environnement & env); // modifie un job en file d'attente
+
+
+ protected:
+ void buildBatchScript(const Job & job);
+
+ private:
+
+#ifdef SWIG
+ public:
+ // Recupere le l'identifiant d'un job deja soumis au BatchManager
+ //virtual const JobId getJobIdByReference(const string & ref) { return BatchManager::getJobIdByReference(ref); }
+ virtual const JobId getJobIdByReference(const char * ref) { return BatchManager::getJobIdByReference(ref); }
+#endif
+ };
+}
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+/*
+ * FactBatchManager_eSSH.cxx :
+ *
+ * Auteur : André RIBES : EDF R&D
+ * Date : Octobre 2009
+ */
+
+#include <string>
+#include "Batch_BatchManager_eSSH.hxx"
+#include "Batch_FactBatchManager_eSSH.hxx"
+
+Batch::FactBatchManager_eSSH::FactBatchManager_eSSH() : FactBatchManager_eClient("eSSH") {}
+
+Batch::FactBatchManager_eSSH::~FactBatchManager_eSSH() {}
+
+Batch::BatchManager *
+Batch::FactBatchManager_eSSH::operator() (const char * hostname) const
+{
+ return new Batch::BatchManager_eSSH(this, hostname);
+}
+
+Batch::BatchManager_eClient *
+Batch::FactBatchManager_eSSH::operator() (const char * hostname,
+ CommunicationProtocolType protocolType,
+ const char * mpiImpl) const
+{
+ //protocolType and mpiImpl are ignored.
+ std::cerr << "[Batch::FactBatchManager_eSSH] creating new Batch::BatchManager_eSSH with hostname = " << hostname << std::endl;
+
+ return new Batch::BatchManager_eSSH(this, hostname);
+}
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+/*
+ * FactBatchManager_eSSH.hxx :
+ *
+ * Auteur : André RIBES : EDF R&D
+ * Date : Octobre 2009
+ */
+
+#ifndef _FACTBATCHMANAGER_eSSH_H_
+#define _FACTBATCHMANAGER_eSSH_H_
+
+#include "Batch_Defines.hxx"
+
+#include <string>
+#include <map>
+#include "Batch_BatchManager_eClient.hxx"
+#include "Batch_FactBatchManager_eClient.hxx"
+
+namespace Batch {
+
+ class BatchManager_eSSH;
+
+ class BATCH_EXPORT FactBatchManager_eSSH : public FactBatchManager_eClient
+ {
+ public:
+ FactBatchManager_eSSH();
+ virtual ~FactBatchManager_eSSH();
+
+ virtual BatchManager * operator() (const char * hostname) const; // From FactBacthManager
+ virtual BatchManager_eClient * operator() (const char * hostname,
+ CommunicationProtocolType protocolType,
+ const char * mpiImpl) const; // From FactBatchManager_eClient
+ };
+}
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+/*
+ * JobInfo_eSSH.cxx : emulation of SSH client
+ *
+ * Auteur : André RIBES - EDF R&D
+ * Date : Octobre 2009
+ */
+
+#include <cstdio>
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include "Batch_Parametre.hxx"
+#include "Batch_Environnement.hxx"
+#include "Batch_RunTimeException.hxx"
+#include "Batch_APIInternalFailureException.hxx"
+#include "Batch_JobInfo_eSSH.hxx"
+
+using namespace std;
+
+namespace Batch {
+
+ // Constructeurs
+ JobInfo_eSSH::JobInfo_eSSH(int id, string status) : JobInfo()
+ {
+ // On remplit les membres _param et _env
+ ostringstream oss;
+ oss << id;
+ _param[ID] = oss.str();
+ _param[STATE] = status;
+ }
+
+ // Destructeur
+ JobInfo_eSSH::~JobInfo_eSSH()
+ {
+ // Nothing to do
+ }
+
+ // Methode pour l'interfacage avec Python (SWIG) : affichage en Python
+ string JobInfo_eSSH::__str__() const
+ {
+ ostringstream sst;
+ sst << "<JobInfo_eSSH (" << this << ") :" << endl;
+ sst << " ID = " <<_param[ID] << endl;
+ sst << " STATE = " <<_param[STATE] << endl;
+
+ return sst.str();
+ }
+
+
+}
--- /dev/null
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+/*
+ * JobInfo_eSSH.hxx : emulation of SSH client
+ *
+ * Auteur : André RIBES - EDF R&D
+ * Date : Octobre 2009
+ */
+
+#ifndef _JOBINFO_SSH_H_
+#define _JOBINFO_SSH_H_
+
+#include <string>
+#include "Batch_RunTimeException.hxx"
+#include "Batch_JobInfo.hxx"
+
+namespace Batch {
+
+ class JobInfo_eSSH : public JobInfo
+ {
+ public:
+ // Constructeurs et destructeur
+ JobInfo_eSSH(int id, std::string status);
+ virtual ~JobInfo_eSSH();
+
+ // Methodes pour l'interfacage avec Python (SWIG)
+ // TODO : supprimer ces methodes et transferer leur definitions dans SWIG
+ std::string __str__() const; // SWIG : affichage en Python
+ std::string __repr__() const { return __str__(); }; // SWIG : affichage en Python
+
+ };
+
+}
+
+#endif
--- /dev/null
+# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(CLASS_LIST SSH/Batch_FactBatchManager_eSSH
+ SSH/Batch_BatchManager_eSSH
+ SSH/Batch_JobInfo_eSSH
+ )
+
+APPEND_CLASSES_TO_SRC_FILES(${CLASS_LIST})
+APPEND_CLASSES_TO_HDR_FILES(${CLASS_LIST})
+
+IF (TEST_ENABLED)
+ add_subdirectory(Test)
+ENDIF (TEST_ENABLED)