Salome HOME
[PY3] Fix m4 macro for python 3
[modules/kernel.git] / src / Launcher / SALOME_Launcher.cxx
index 6334a8c54ffc430c18cb003d5d3b913e9c6ec104..d37cb04e56d910582ffa6d460c913facd9ad1020 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  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
@@ -6,7 +6,7 @@
 // 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.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -24,6 +24,8 @@
 #include "BatchTest.hxx"
 #include "OpUtil.hxx"
 #include "SALOME_ContainerManager.hxx"
+#include "SALOME_NamingService.hxx"
+#include "SALOME_ResourcesManager.hxx"
 #include "Utils_CorbaException.hxx"
 
 
@@ -31,6 +33,8 @@
 #include "Launcher_Job_YACSFile.hxx"
 #include "Launcher_Job_PythonSALOME.hxx"
 
+#include "utilities.h"
+
 #ifdef WIN32
 # include <process.h>
 #else
@@ -59,7 +63,7 @@ SALOME_Launcher::SALOME_Launcher(CORBA::ORB_ptr orb, PortableServer::POA_var poa
   _NS = new SALOME_NamingService(orb);
   _ResManager = new SALOME_ResourcesManager(orb,poa,_NS);
   _l.SetResourcesManager(_ResManager->GetImpl());
-  _ContManager = new SALOME_ContainerManager(orb,poa,_ResManager,_NS);
+  _ContManager = new SALOME_ContainerManager(orb,poa,_NS);
   _ResManager->_remove_ref();
   _ContManager->_remove_ref();
 
@@ -165,6 +169,14 @@ SALOME_Launcher::createJob(const Engines::JobParameters & job_parameters)
   // Memory required per CPU
   new_job->setMemPerCpu(job_parameters.mem_per_cpu);
 
+  // WC Key
+  std::string wckey = job_parameters.wckey.in();
+  new_job->setWCKey(wckey);
+
+  // Extra params
+  std::string extra_params = job_parameters.extra_params.in();
+  new_job->setExtraParams(extra_params);
+
   // Resources requirements
   try
   {
@@ -290,6 +302,22 @@ SALOME_Launcher::getJobDumpState(CORBA::Long job_id, const char * directory)
   return rtn;
 }
 
+CORBA::Boolean
+SALOME_Launcher::getJobWorkFile(CORBA::Long job_id, const char * work_file, const char * directory)
+{
+  CORBA::Boolean rtn = false;
+  try
+  {
+    rtn = _l.getJobWorkFile(job_id, work_file, directory);
+  }
+  catch(const LauncherException &ex)
+  {
+    INFOS(ex.msg.c_str());
+    THROW_SALOME_CORBA_EXCEPTION(ex.msg.c_str(),SALOME::BAD_PARAM);
+  }
+  return rtn;
+}
+
 void 
 SALOME_Launcher::removeJob(CORBA::Long job_id)
 {
@@ -502,6 +530,8 @@ SALOME_Launcher::getJobParameters(CORBA::Long job_id)
   job_parameters->queue            = CORBA::string_dup(job->getQueue().c_str());
   job_parameters->exclusive        = job->getExclusive();
   job_parameters->mem_per_cpu      = job->getMemPerCpu();
+  job_parameters->wckey            = CORBA::string_dup(job->getWCKey().c_str());
+  job_parameters->extra_params     = CORBA::string_dup(job->getExtraParams().c_str());
 
   resourceParams resource_params = job->getResourceRequiredParams();
   job_parameters->resource_required.name             = CORBA::string_dup(resource_params.name.c_str());