1 // Copyright (C) 2009-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include "BL_Engine.hxx"
24 #include "BL_Traces.hxx"
35 class BL_Engine_EXPORT Job
39 Job(const std::string & name);
42 void setName(const std::string & name);
43 std::string getName();
45 enum JobType {YACS_SCHEMA, COMMAND, PYTHON_SALOME};
46 void setType(BL::Job::JobType type);
47 void setType(const std::string & type);
48 BL::Job::JobType getType();
50 void setJobFile(const std::string & job_file);
51 std::string & getJobFile();
53 void setEnvFile(const std::string & env_file);
54 std::string & getEnvFile();
56 void setPreCommand(const std::string & pre_command);
57 std::string & getPreCommand();
59 void setDumpYACSState(const int & dump_yacs_state);
60 int getDumpYACSState();
62 void setYacsDriverOptions(const std::string& options);
63 const std::string& getYacsDriverOptions()const;
65 enum MemReqType {MEM_PER_NODE, MEM_PER_CPU};
69 std::string batch_directory;
70 std::string maximum_duration;
72 MemReqType mem_req_type;
76 // Parameters for COORM
77 std::string launcher_file;
78 std::string launcher_args;
80 void setBatchParameters(const BL::Job::BatchParam & param);
81 const BL::Job::BatchParam & getBatchParameters();
85 std::string result_directory;
86 std::list<std::string> input_files_list;
87 std::list<std::string> output_files_list;
89 void setFilesParameters(BL::Job::FilesParam & param);
90 BL::Job::FilesParam & getFilesParameters();
92 void setResource(const std::string & resource);
93 std::string & getResource();
95 void setBatchQueue(const std::string & queue);
96 std::string & getBatchQueue();
98 void setWCKey(const std::string & wckey);
99 const std::string & getWCKey();
101 void setExtraParams(const std::string & extra_params);
102 const std::string & getExtraParams();
104 void setLoadLevelerJobType(const std::string & jobtype);
105 std::string & getLoadLevelerJobType();
107 enum State {CREATED, IN_PROCESS, QUEUED, RUNNING, PAUSED, FINISHED, ERROR, FAILED, NOT_CREATED};
108 void setState(BL::Job::State state);
109 BL::Job::State getState();
110 std::string setStringState(const std::string & state);
112 enum ThreadState {NOTHING, STARTING};
113 void setThreadState(BL::Job::ThreadState state);
114 BL::Job::ThreadState getThreadState();
116 void setSalomeLauncherId(int id);
117 int getSalomeLauncherId();
120 BL::Job::State _state;
121 BL::Job::ThreadState _thread_state;
122 int _dump_yacs_state;
123 std::string _yacs_driver_options;
127 BL::Job::JobType _type;
128 std::string _job_file;
129 std::string _env_file;
130 std::string _pre_command;
132 BL::Job::BatchParam _batch_params;
133 BL::Job::FilesParam _files_params;
134 std::string _resource_choosed;
135 std::string _batch_queue;
137 std::string _extra_params;
138 std::string _ll_jobtype;
140 int _salome_launcher_id;