1 // Copyright (C) 2020 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
24 namespace WorkloadManager
28 // parameters needed by WorkloadManager
29 float neededCores = 0.0;
30 bool ignoreResources = false; // if true, the task can be run as soon as
31 // added to the manager without any resource
33 // parameters for client use, used by WorkloadManager to distinguish objects
36 bool operator==(const ContainerType& other)const
37 { return id == other.id && name == other.name;}
38 bool operator<(const ContainerType& other)const
40 return (id < other.id) ||
41 (id == other.id && name < other.name);
47 unsigned int nbCores = 0; // needed by WorkloadManager
48 // parameters for client use, used by WorkloadManager to distinguish objects
51 bool operator==(const Resource& other)const
52 { return id == other.id && name == other.name;}
53 bool operator<(const Resource& other)const
55 return (id < other.id) ||
56 (id == other.id && name < other.name);
64 unsigned int index=0; // worker index on the resource for this type
74 virtual const ContainerType& type()const =0;
75 virtual void run(const RunInfo& c)=0;
77 // Is it possible to run the task on this resource?
78 virtual bool isAccepted(const Resource& r)
80 // by default, a task can be run on any resource.