/* * Copyright (C) 2014 Cloudius Systems, Ltd. * * This work is open source software, licensed under the terms of the * BSD license as described in the LICENSE file in the top-level directory. */ #ifndef RESOURCE_HH_ #define RESOURCE_HH_ #include #include #include cpu_set_t cpuid_to_cpuset(unsigned cpuid); namespace resource { using std::experimental::optional; struct configuration { optional total_memory; optional reserve_memory; // if total_memory not specified optional cpus; }; struct memory { size_t bytes; unsigned nodeid; }; struct cpu { unsigned cpu_id; std::vector mem; }; std::vector allocate(configuration c); unsigned nr_processing_units(); } #endif /* RESOURCE_HH_ */