echo
CHECK_LIBBATCH
-AM_CONDITIONAL(WITH_BATCH, [test x"$libbatch_ok" = xyes])
+AM_CONDITIONAL(WITH_LIBBATCH, [test x"$libbatch_ok" = xyes])
echo
echo ============================================================
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "BatchTest.hxx"
+#include "Launcher.hxx"
+#ifdef WITH_LIBBATCH
#include <Batch/Batch_Date.hxx>
#include <Batch/Batch_MpiImpl.hxx>
+#endif
+
#include "utilities.h"
#include <sys/stat.h>
#endif
BatchTest::BatchTest(const Engines::MachineDefinition& batch_descr)
{
+#ifdef WITH_LIBBATCH
_batch_descr = batch_descr;
// Getting date
_test_filename += _date + "_test_cluster_file_";
_test_filename += _batch_descr.alias.in();
_base_filename = _date + "_test_cluster_file_" + _batch_descr.alias.in();
+#endif
}
BatchTest::~BatchTest() {}
std::string
BatchTest::test_jobsubmit_mpi()
{
+#ifdef WITH_LIBBATCH
int status;
std::string home;
std::string command;
}
result = "OK";
return result;
+#else
+ throw LauncherException("Method BatchTest::test_jobsubmit_mpi is not available "
+ "(libBatch was not present at compilation time)");
+#endif
}
std::string
+++ /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
-//
-
-// This implementation is an empty shell compiled only when libBatch is absent.
-// It will just throw exceptions when it is called.
-
-#include "BatchTest.hxx"
-#include "Launcher.hxx"
-
-BatchTest::BatchTest(const Engines::MachineDefinition& batch_descr)
-{
-}
-
-BatchTest::~BatchTest()
-{
-}
-
-bool BatchTest::test()
-{
- throw LauncherException("Method BatchTest::test() is not available "
- "(libBatch was not found at compilation time).");
-}
+++ /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
-//
-
-// This implementation is an empty shell compiled only when libBatch is absent.
-// It will just throw exceptions when it is called.
-
-#include "Launcher.hxx"
-
-using namespace std;
-
-Launcher_cpp::Launcher_cpp()
-{
-}
-
-Launcher_cpp::~Launcher_cpp()
-{
-}
-
-long Launcher_cpp::submitJob(const string xmlExecuteFile,
- const string clusterName) throw (LauncherException)
-{
- throw LauncherException("Method Launcher_cpp::submitJob is not available "
- "(libBatch was not found at compilation time).");
-}
-
-long Launcher_cpp::submitSalomeJob(const string fileToExecute,
- const vector<string>& filesToExport,
- const vector<string>& filesToImport,
- const batchParams& batch_params,
- const machineParams& params) throw (LauncherException)
-{
- throw LauncherException("Method Launcher_cpp::submitSalomeJob is not available "
- "(libBatch was not found at compilation time).");
-}
-
-string Launcher_cpp::queryJob(long id,
- const machineParams& params) throw (LauncherException)
-{
- throw LauncherException("Method Launcher_cpp::queryJob is not available "
- "(libBatch was not found at compilation time).");
-}
-
-string Launcher_cpp::queryJob(long id,
- const string clusterName) throw (LauncherException)
-{
- throw LauncherException("Method Launcher_cpp::queryJob is not available "
- "(libBatch was not found at compilation time).");
-}
-
-void Launcher_cpp::deleteJob(const long id,
- const machineParams& params) throw (LauncherException)
-{
- throw LauncherException("Method Launcher_cpp::deleteJob is not available "
- "(libBatch was not found at compilation time).");
-}
-
-void Launcher_cpp::deleteJob(long id,
- const string clusterName) throw (LauncherException)
-{
- throw LauncherException("Method Launcher_cpp::deleteJob is not available "
- "(libBatch was not found at compilation time).");
-}
-
-void Launcher_cpp::getResultsJob(const string directory,
- const long id,
- const machineParams& params) throw (LauncherException)
-{
- throw LauncherException("Method Launcher_cpp::getResultsJob is not available "
- "(libBatch was not found at compilation time).");
-}
-
-void Launcher_cpp::getResultsJob(const string directory,
- long id,
- const string clusterName) throw (LauncherException)
-{
- throw LauncherException("Method Launcher_cpp::getResultsJob is not available "
- "(libBatch was not found at compilation time).");
-}
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+#ifdef WITH_LIBBATCH
#include <Batch/Batch_Date.hxx>
#include <Batch/Batch_FactBatchManager_eLSF.hxx>
#include <Batch/Batch_FactBatchManager_ePBS.hxx>
#include <Batch/Batch_BatchManager_eClient.hxx>
#include <Batch/Batch_FactBatchManager_eSGE.hxx>
+#endif
+
#include "SALOME_Launcher_Handler.hxx"
#include "Launcher.hxx"
#include <iostream>
#if defined(_DEBUG_) || defined(_DEBUG)
cerr << "Launcher_cpp destructor" << endl;
#endif
+
+#ifdef WITH_LIBBATCH
std::map < string, Batch::BatchManager_eClient * >::const_iterator it1;
for(it1=_batchmap.begin();it1!=_batchmap.end();it1++)
delete it1->second;
std::map < std::pair<std::string,long> , Batch::Job* >::const_iterator it2;
for(it2=_jobmap.begin();it2!=_jobmap.end();it2++)
delete it2->second;
+#endif
}
//=============================================================================
long Launcher_cpp::submitJob( const std::string xmlExecuteFile,
const std::string clusterName) throw(LauncherException)
{
+#ifdef WITH_LIBBATCH
#if defined(_DEBUG_) || defined(_DEBUG)
cout << "BEGIN OF Launcher_cpp::submitJob" << endl;
#endif
}
return jobId;
+#else
+ throw LauncherException("Method Launcher_cpp::submitJob is not available "
+ "(libBatch was not present at compilation time)");
+#endif
}
//=============================================================================
const batchParams& batch_params,
const machineParams& params) throw(LauncherException)
{
+#ifdef WITH_LIBBATCH
#if defined(_DEBUG_) || defined(_DEBUG)
cerr << "BEGIN OF Launcher_cpp::submitSalomeJob" << endl;
#endif
}
return jobId;
+#else
+ throw LauncherException("Method Launcher_cpp::submitSalomeJob is not available "
+ "(libBatch was not present at compilation time)");
+#endif
}
//=============================================================================
string Launcher_cpp::queryJob( long id,
const machineParams& params) throw(LauncherException)
{
+#ifdef WITH_LIBBATCH
if(!_ResManager)
throw LauncherException("You must set Resources Manager to Launcher!!");
}
return par[STATE];
+#else
+ throw LauncherException("Method Launcher_cpp::queryJob is not available "
+ "(libBatch was not present at compilation time)");
+#endif
}
string Launcher_cpp::queryJob( long id,
void Launcher_cpp::deleteJob( const long id,
const machineParams& params) throw(LauncherException)
{
+#ifdef WITH_LIBBATCH
if(!_ResManager)
throw LauncherException("You must set Resources Manager to Launcher!!");
Batch::JobId jobId( _batchmap[clustername], oss.str() );
jobId.deleteJob();
+#else
+ throw LauncherException("Method Launcher_cpp::deleteJob is not available "
+ "(libBatch was not present at compilation time)");
+#endif
}
void Launcher_cpp::deleteJob( long id,
const long id,
const machineParams& params) throw(LauncherException)
{
+#ifdef WITH_LIBBATCH
if(!_ResManager)
throw LauncherException("You must set Resources Manager to Launcher!!");
Batch::Job* job = _jobmap[ pair<string,long>(clustername,id) ];
_batchmap[clustername]->importOutputFiles( *job, directory );
+#else
+ throw LauncherException("Method Launcher_cpp::getResultsJob is not available "
+ "(libBatch was not present at compilation time)");
+#endif
}
void Launcher_cpp::getResultsJob( const std::string directory,
Batch::BatchManager_eClient *Launcher_cpp::FactoryBatchManager( const ParserResourcesType& params ) throw(LauncherException)
{
-
+#ifdef WITH_LIBBATCH
std::string hostname, mpi;
Batch::CommunicationProtocolType protocol;
Batch::FactBatchManager_eClient* fact;
throw LauncherException("no batchmanager for that cluster");
}
return (*fact)(hostname.c_str(), protocol, mpi.c_str());
+#else
+ throw LauncherException("Method Launcher_cpp::FactoryBatchManager is not available "
+ "(libBatch was not present at compilation time)");
+#endif
}
string Launcher_cpp::buildSalomeCouplingScript(const string fileToExecute, const string dirForTmpFiles, const ParserResourcesType& params)
{
+#ifdef WITH_LIBBATCH
#ifndef WIN32 //TODO: need for porting on Windows
int idx = dirForTmpFiles.find("Batch/");
std::string filelogtemp = dirForTmpFiles.substr(idx+6, dirForTmpFiles.length());
return "";
#endif
+#else
+ throw LauncherException("Method Launcher_cpp::buildSalomeCouplingScript is not available "
+ "(libBatch was not present at compilation time)");
+#endif
}
MpiImpl *Launcher_cpp::FactoryMpiImpl(MpiImplType mpi) throw(LauncherException)
{
+#ifdef WITH_LIBBATCH
switch(mpi){
case lam:
return new MpiImpl_LAM();
oss << mpi << " : not yet implemented";
throw LauncherException(oss.str().c_str());
}
-
+#else
+ throw LauncherException("Method Launcher_cpp::FactoryMpiImpl is not available "
+ "(libBatch was not present at compilation time)");
+#endif
}
string Launcher_cpp::getTmpDirForBatchFiles()
{
+#ifdef WITH_LIBBATCH
string ret;
string thedate;
ret = string("Batch/");
ret += thedate;
return ret;
+#else
+ throw LauncherException("Method Launcher_cpp::getTmpDirForBatchFiles is not available "
+ "(libBatch was not present at compilation time)");
+#endif
}
string Launcher_cpp::getRemoteFile( std::string remoteDir, std::string localFile )
-I$(top_builddir)/idl \
@CORBA_CXXFLAGS@ @CORBA_INCLUDES@
+if WITH_LIBBATCH
+ COMMON_CPPFLAGS += -DWITH_LIBBATCH
+endif
+
# This local variable defines the list of dependant libraries common to all target in this package.
COMMON_LIBS =\
../Registry/libRegistry.la \
else
lib_LTLIBRARIES = libLauncher.la libSalomeLauncher.la
endif
-
libSalomeLauncher_la_SOURCES=\
+ BatchTest.cxx \
SALOME_Launcher.cxx
-if WITH_BATCH
- libSalomeLauncher_la_SOURCES += BatchTest.cxx
-else
- libSalomeLauncher_la_SOURCES += DummyBatchTest.cxx
-endif
-
libSalomeLauncher_la_CPPFLAGS =\
$(COMMON_CPPFLAGS)
libLauncher_la_SOURCES=\
SALOME_Launcher_Parser.cxx \
- SALOME_Launcher_Handler.cxx
-
-if WITH_BATCH
- libLauncher_la_SOURCES += Launcher.cxx
-else
- libLauncher_la_SOURCES += DummyLauncher.cxx
-endif
+ SALOME_Launcher_Handler.cxx \
+ Launcher.cxx
libLauncher_la_CPPFLAGS =\
-I$(srcdir)/../ResourcesManager \
@MPI_INCLUDES@ \
@LIBXML_INCLUDES@
+if WITH_LIBBATCH
+ libLauncher_la_CPPFLAGS += -DWITH_LIBBATCH
+endif
+
libLauncher_la_LDFLAGS =\
-no-undefined -version-info=0:0:0 \
@LDEXPDYNFLAGS@