Salome HOME
Update copyrights 2014.
[modules/jobmanager.git] / src / engine / BL_Job.hxx
index 6a78e1ce86c318be31478d3b3e6526a0c19e9739..0a26e8cb6648a1bdf3a40a5551256bcd70c5f821 100644 (file)
@@ -1,33 +1,38 @@
-//  Copyright (C) 2009 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2014  CEA/DEN, EDF R&D
 //
-//  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 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, 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
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef _BL_JOB_HXX_
 #define _BL_JOB_HXX_
 
+#include "BL_Engine.hxx"
 #include "BL_Traces.hxx"
 
 #include <string>
 #include <list>
 
+#ifdef WNT
+#undef ERROR
+#endif
+
 namespace BL{
 
-  class Job
+  class BL_Engine_EXPORT Job
   {
     public:
       Job();
@@ -37,41 +42,60 @@ namespace BL{
       void setName(const std::string & name);
       std::string getName();
 
-      enum JobType {YACS_SCHEMA, COMMAND};
+      enum JobType {YACS_SCHEMA, COMMAND, PYTHON_SALOME};
       void setType(BL::Job::JobType type);
+      void setType(const std::string & type);
       BL::Job::JobType getType();
 
-      void setYACSFile(std::string & yacs_file);
-      std::string & getYACSFile();
+      void setJobFile(const std::string & job_file);
+      std::string & getJobFile();
+
+      void setEnvFile(const std::string & env_file);
+      std::string & getEnvFile();
+
+      void setDumpYACSState(const int & dump_yacs_state);
+      int getDumpYACSState();
 
-      void setCommand(std::string & command);
-      std::string & getCommand();
+      enum MemReqType {MEM_PER_NODE, MEM_PER_CPU};
 
       struct BatchParam
       {
-       std::string batch_directory;
-       std::string expected_during_time;
-       std::string expected_memory;
-       int nb_proc;
+        std::string batch_directory;
+        std::string maximum_duration;
+        unsigned long mem_limit;
+        MemReqType mem_req_type;
+        int nb_proc;
+        bool exclusive;
+
+               // Parameters for COORM
+               std::string launcher_file;
+               std::string launcher_args;
       };
-      void setBatchParameters(BL::Job::BatchParam & param);
-      BL::Job::BatchParam & getBatchParameters();
+      void setBatchParameters(const BL::Job::BatchParam & param);
+      const BL::Job::BatchParam & getBatchParameters();
 
       struct FilesParam
       {
-       std::string result_directory;
-       std::list<std::string> input_files_list;
-       std::list<std::string> output_files_list;
+        std::string result_directory;
+        std::list<std::string> input_files_list;
+        std::list<std::string> output_files_list;
       };
       void setFilesParameters(BL::Job::FilesParam & param);
       BL::Job::FilesParam & getFilesParameters();
 
-      void setMachine(std::string & machine);
-      std::string & getMachine();
+      void setResource(const std::string & resource);
+      std::string & getResource();
 
-      enum State {CREATED, IN_PROCESS, QUEUED, RUNNING, PAUSED, FINISHED, ERROR};
+      void setBatchQueue(const std::string & queue);
+      std::string & getBatchQueue();
+
+      void setLoadLevelerJobType(const std::string & jobtype);
+      std::string & getLoadLevelerJobType();
+
+      enum State {CREATED, IN_PROCESS, QUEUED, RUNNING, PAUSED, FINISHED, ERROR, FAILED, NOT_CREATED};
       void setState(BL::Job::State state);
       BL::Job::State getState();
+      std::string setStringState(const std::string & state);
 
       enum ThreadState {NOTHING, STARTING}; 
       void setThreadState(BL::Job::ThreadState state);
@@ -80,20 +104,22 @@ namespace BL{
       void setSalomeLauncherId(int id);
       int getSalomeLauncherId();
 
-
     private:
       BL::Job::State _state;
       BL::Job::ThreadState _thread_state;
+      int _dump_yacs_state;
 
       std::string _name;
 
       BL::Job::JobType _type;
-      std::string _yacs_file;
-      std::string _command;
-  
+      std::string _job_file;
+      std::string _env_file;
+
       BL::Job::BatchParam _batch_params;
       BL::Job::FilesParam _files_params;
-      std::string _machine_choosed;
+      std::string _resource_choosed;
+      std::string _batch_queue;
+      std::string _ll_jobtype;
 
       int _salome_launcher_id;
   };