Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
IProcessorAffinityService.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* IProcessorAffinityService.h (C) 2000-2025 */
9/* */
10/* Interface of a CPU core affinity management service. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_IPROCESSORAFFINITYSERVICE_H
13#define ARCANE_UTILS_IPROCESSORAFFINITYSERVICE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
33{
34 public:
35
36 virtual ~IProcessorAffinityService() {} //<! Frees resources
37
38 public:
39
40 virtual void build() = 0;
41
42 public:
43
45 virtual void printInfos() = 0;
46
54 virtual String cpuSetString() = 0;
55
57 virtual void bindThread(Int32 cpu) = 0;
58
60 virtual Int32 numberOfCore() = 0;
61
63 virtual Int32 numberOfSocket() = 0;
64
67};
68
69/*---------------------------------------------------------------------------*/
70/*---------------------------------------------------------------------------*/
71
72} // namespace Arcane
73
74/*---------------------------------------------------------------------------*/
75/*---------------------------------------------------------------------------*/
76
77#endif
Arcane configuration file.
Interface of a CPU core affinity management service.
virtual void bindThread(Int32 cpu)=0
Constrains the current thread to stay on the core with index cpu.
virtual Int32 numberOfSocket()=0
Number of sockets (-1 if unknown).
virtual Int32 numberOfProcessingUnit()=0
Number of logical cores (-1 if unknown).
virtual String cpuSetString()=0
Returns the cpuset for the current thread.
virtual void printInfos()=0
Displays complete topology information via info().
virtual Int32 numberOfCore()=0
Number of CPU cores (-1 if unknown).
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int32_t Int32
Signed integer type of 32 bits.