Salome HOME
Synchronize adm files
[modules/kernel.git] / src / Launcher / Launcher.hxx
old mode 100644 (file)
new mode 100755 (executable)
index 4889556..0372d22
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014  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
@@ -33,6 +33,7 @@
 
 #include <string>
 #include <vector>
+#include <list>
 
 #include <pthread.h>
 
@@ -48,6 +49,10 @@ struct batchParams{
   std::string expected_during_time;
   std::string mem;
   unsigned long nb_proc;
+
+  // Parameters for COORM
+  std::string launcher_file;
+  std::string launcher_args;
 };
 
 class LAUNCHER_EXPORT Launcher_cpp
@@ -61,16 +66,25 @@ public:
   void         createJob(Launcher::Job * new_job);
   void         launchJob(int job_id);
   const char * getJobState(int job_id);
+  const char * getAssignedHostnames(int job_id); // Get names or ids of hosts assigned to the job
   void         getJobResults(int job_id, std::string directory);
   bool         getJobDumpState(int job_id, std::string directory);
   void         stopJob(int job_id);
   void         removeJob(int job_id);
 
+  /*! Load the jobs from the file "jobs_file" and add them to the Launcher.
+   *  Return a list with the IDs of the jobs that were successfully loaded.
+   */
+  std::list<int> loadJobs(const char* jobs_file);
+
+  //! Save the jobs of the Launcher to the file "jobs_file".
+  void saveJobs(const char* jobs_file);
+
   // Useful methods
   long createJobWithFile(std::string xmlExecuteFile, std::string clusterName);
   std::map<int, Launcher::Job *> getJobs();
   void createBatchManagerForJob(Launcher::Job * job);
-  void addJobDirectlyToMap(Launcher::Job * new_job, const std::string job_reference);
+  void addJobDirectlyToMap(Launcher::Job * new_job);
 
   // Lib methods
   void SetResourcesManager( ResourcesManager_cpp* rm ) {_ResManager = rm;}