|
| 1 | +// Copyright CERN and copyright holders of ALICE O2. This software is |
| 2 | +// distributed under the terms of the GNU General Public License v3 (GPL |
| 3 | +// Version 3), copied verbatim in the file "COPYING". |
| 4 | +// |
| 5 | +// See http://alice-o2.web.cern.ch/license for full licensing information. |
| 6 | +// |
| 7 | +// In applying this license CERN does not waive the privileges and immunities |
| 8 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 9 | +// or submit itself to any jurisdiction. |
| 10 | +#ifndef O2_FRAMEWORK_COMPUTINGRESOURCE_H_ |
| 11 | +#define O2_FRAMEWORK_COMPUTINGRESOURCE_H_ |
| 12 | + |
| 13 | +#include <string> |
| 14 | + |
| 15 | +namespace o2::framework |
| 16 | +{ |
| 17 | + |
| 18 | +struct ComputingOffer { |
| 19 | + float cpu = 0; |
| 20 | + float memory = 0; |
| 21 | + std::string hostname = ""; |
| 22 | + unsigned short startPort = 0; |
| 23 | + unsigned short rangeSize = 0; |
| 24 | +}; |
| 25 | + |
| 26 | +/// A computing resource which can be offered to run a device |
| 27 | +struct ComputingResource { |
| 28 | + ComputingResource() = default; |
| 29 | + ComputingResource(ComputingOffer const& offer) |
| 30 | + : cpu(offer.cpu), |
| 31 | + memory(offer.memory), |
| 32 | + hostname(offer.hostname), |
| 33 | + startPort(offer.startPort), |
| 34 | + lastPort(offer.startPort), |
| 35 | + usedPorts(0) |
| 36 | + { |
| 37 | + } |
| 38 | + |
| 39 | + float cpu = 0; |
| 40 | + float memory = 0; |
| 41 | + std::string hostname = ""; |
| 42 | + unsigned short startPort = 0; |
| 43 | + unsigned short lastPort = 0; |
| 44 | + unsigned short usedPorts = 0; |
| 45 | +}; |
| 46 | + |
| 47 | +} // namespace o2::framework |
| 48 | + |
| 49 | +#endif // O2_FRAMEWORK_COMPUTINGRESOURCES_H_ |
0 commit comments