1 // Copyright (C) 2009-2023 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
20 #ifndef _BL_SALOMESERVICES_HXX_
21 #define _BL_SALOMESERVICES_HXX_
23 #include "BL_Engine.hxx"
24 #include "BL_Traces.hxx"
26 #include "BL_NamingService_Wrapper.hxx"
28 #include "SALOME_NamingService.hxx"
29 #include "SALOME_LifeCycleCORBA.hxx"
30 #include "SALOME_ContainerManager.hh"
31 #include "BL_JobsManager.hxx"
37 #include "JOBMANAGER_IDL.hh"
44 struct BL_Engine_EXPORT ResourceDescr
50 std::string applipath;
51 std::list<std::string> componentList;
55 unsigned int cpu_clock;
57 unsigned int nb_proc_per_node;
60 std::string iprotocol;
62 bool can_launch_batch_jobs;
63 bool can_run_containers;
64 std::string working_directory;
67 class BL_Engine_EXPORT SALOMEServices :
68 public POA_JOBMANAGER::LauncherObserver
72 virtual ~SALOMEServices();
77 void set_manager(BL::JobsManager * manager) {_manager = manager;}
79 std::list<std::string> getResourceList(bool batch_only);
80 BL::ResourceDescr getResourceDescr(const std::string& name);
81 void addResource(BL::ResourceDescr & new_resource);
82 void removeResource(const std::string & name);
84 std::string save_jobs(const std::string & file_name);
85 std::string load_jobs(const std::string & file_name);
87 std::string create_job(BL::Job * job);
88 std::string start_job(BL::Job * job);
89 std::string refresh_job(BL::Job * job);
90 std::string delete_job(BL::Job * job);
91 std::string stop_job(BL::Job * job);
92 std::string get_results_job(BL::Job * job);
93 std::string get_assigned_hostnames(BL::Job * job); // Get names or ids of hosts assigned to the job
95 BL::Job * get_new_job(int job_number);
97 virtual void notify(const char* event_name, const char * event_data);
101 BL_SALOME_NamingService_Wrapper * _salome_naming_service;
102 SALOME_LifeCycleCORBA * _lcc;
103 Engines::SalomeLauncher_var _salome_launcher;
104 Engines::ResourcesManager_var _resources_manager;
106 BL::JobsManager * _manager;