using namespace std;
//=============================================================================
-/*!
+/*!
* Constructor
* \param orb
* Define a CORBA single thread policy for the server, which avoid to deal
}
//=============================================================================
-/*!
+/*!
* destructor
*/
//=============================================================================
//=============================================================================
/*!
- * Add a job into the launcher - check resource and choose one
- */
+ * Add a job into the launcher - check resource and choose one
+ */
//=============================================================================
-void
+void
Launcher_cpp::createJob(Launcher::Job * new_job)
{
LAUNCHER_MESSAGE("Creating a new job");
//=============================================================================
/*!
- * Launch a job
- */
+ * Launch a job
+ */
//=============================================================================
-void
+void
Launcher_cpp::launchJob(int job_id)
{
LAUNCHER_MESSAGE("Launch a job");
//=============================================================================
/*!
* Get job state
- */
+ */
//=============================================================================
std::string
Launcher_cpp::getJobState(int job_id)
//=============================================================================
/*!
* Get Job result - the result directory could be changed
- */
+ */
//=============================================================================
void
Launcher_cpp::getJobResults(int job_id, std::string directory)
Launcher::Job * job = findJob(job_id);
std::string resource_name = job->getResourceDefinition().Name;
- try
+ try
{
if (directory != "")
_batchmap[job_id]->importOutputFiles(*(job->getBatchJob()), directory);
//=============================================================================
/*!
* Get Job dump state - the result directory could be changed
- */
+ */
//=============================================================================
bool
Launcher_cpp::getJobDumpState(int job_id, std::string directory)
Launcher::Job * job = findJob(job_id);
std::string resource_name = job->getResourceDefinition().Name;
- try
+ try
{
if (directory != "")
rtn = _batchmap[job_id]->importDumpStateFile(*(job->getBatchJob()), directory);
//=============================================================================
/*!
* Remove the job - into the Launcher and its batch manager
- */
+ */
//=============================================================================
void
Launcher_cpp::removeJob(int job_id)
//=============================================================================
/*!
* stop the job
- */
+ */
//=============================================================================
void
Launcher_cpp::stopJob(int job_id)
}
//=============================================================================
-/*!
+/*!
* create a launcher job based on a file
* \param xmlExecuteFile : to define the execution on the batch cluster
*/
//=============================================================================
-long
-Launcher_cpp::createJobWithFile(const std::string xmlExecuteFile,
+long
+Launcher_cpp::createJobWithFile(const std::string xmlExecuteFile,
const std::string clusterName)
{
LAUNCHER_MESSAGE("Begin of Launcher_cpp::createJobWithFile");
// Creating a new job
std::unique_ptr<Launcher::Job_Command> new_job(new Launcher::Job_Command);
- std::string cmdFile = Kernel_Utils::GetTmpFileName();
+ std::string cmdFile = Kernel_Utils::GetTmpFileName();
#ifndef WIN32
cmdFile += ".sh";
#else
//=============================================================================
/*!
* Factory to instantiate the good batch manager for chosen cluster.
- */
+ */
//=============================================================================
Batch::BatchManager *
Launcher_cpp::FactoryBatchManager(ParserResourcesType& params)
//----------------------------------------------------------
#else
-void
+void
Launcher_cpp::createJob(Launcher::Job * new_job)
{
LAUNCHER_INFOS("Launcher compiled without LIBBATCH - cannot create a job !!!");
"(libBatch was not present at compilation time)");
}
-void
+void
Launcher_cpp::launchJob(int job_id)
{
LAUNCHER_INFOS("Launcher compiled without LIBBATCH - cannot launch a job !!!");
return 0;
}
-long
+long
Launcher_cpp::createJobWithFile( const std::string xmlExecuteFile, std::string clusterName)
{
throw LauncherException("Method Launcher_cpp::createJobWithFile is not available "
#endif
-ParserLauncherType
+ParserLauncherType
Launcher_cpp::ParseXmlFile(std::string xmlExecuteFile)
{
ParserLauncherType job_params;
}
#endif
-void
+void
Launcher_cpp::addJobDirectlyToMap(Launcher::Job * new_job)
{
// Step 0: Calculated job_id
const char *SALOME_Launcher::_LauncherNameInNS = "/SalomeLauncher";
//=============================================================================
-/*!
+/*!
* Constructor
* \param orb
*/
}
//=============================================================================
-/*!
+/*!
* destructor
*/
//=============================================================================
}
-CORBA::Long
+CORBA::Long
SALOME_Launcher::createJob(const Engines::JobParameters & job_parameters)
{
JobParameters_cpp cpp_parameters = JobParameters_CORBA2CPP(job_parameters);
return jobNumber;
}
-void
+void
SALOME_Launcher::launchJob(CORBA::Long job_id)
{
try
return rtn;
}
-void
+void
SALOME_Launcher::removeJob(CORBA::Long job_id)
{
try
}
}
-void
+void
SALOME_Launcher::stopJob(CORBA::Long job_id)
{
try
* \param clusterName : machine chosen
*/
//=============================================================================
-CORBA::Long
+CORBA::Long
SALOME_Launcher::createJobWithFile(const char * xmlExecuteFile,
const char * clusterName)
{
//=============================================================================
/*! CORBA Method:
- * the test batch configuration
+ * the test batch configuration
* \param params : The batch cluster
*/
//=============================================================================
-CORBA::Boolean
+CORBA::Boolean
SALOME_Launcher::testBatch(const Engines::ResourceParameters& params)
{
MESSAGE("BEGIN OF SALOME_Launcher::testBatch");
const Engines::ResourceDefinition* p = _ResManager->GetResourceDefinition((*aMachineList)[0]);
std::string resource_name(p->name);
INFOS("Choose resource for test: " << resource_name);
-
+
BatchTest t(*p);
- if (t.test())
+ if (t.test())
{
rtn = true;
}
//=============================================================================
CORBA::Long SALOME_Launcher::getPID()
{
- return
+ return
#ifndef WIN32
(CORBA::Long)getpid();
#else
{
observer->notify("NEW_JOB", job_id.str().c_str());
}
- catch (...)
+ catch (...)
{
MESSAGE("Notify Observer, exception catch");
}
(*iter)->notify(CORBA::string_dup(event_name.c_str()),
CORBA::string_dup(event_data.c_str()));
}
- catch (...)
+ catch (...)
{
MESSAGE("Notify Observer, exception catch");
}