GADGET-4
pinning.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * \copyright This file is part of the GADGET4 N-body/SPH code developed
3  * \copyright by Volker Springel. Copyright (C) 2014-2020 by Volker Springel
4  * \copyright (vspringel@mpa-garching.mpg.de) and all contributing authors.
5  *******************************************************************************/
6 
12 #ifndef PINNING_H
13 #define PINNING_H
14 
15 #include <gsl/gsl_rng.h>
16 #include <math.h>
17 #include <mpi.h>
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <string.h>
21 
22 #include "../data/allvars.h"
23 #include "../data/dtypes.h"
24 #include "../main/main.h"
25 #include "../mpi_utils/setcomm.h"
26 #include "../system/system.h"
27 #include "gadgetconfig.h"
28 
33 #ifdef IMPOSE_PINNING
34 #include <hwloc.h>
35 #endif
36 
37 class pinning
38 {
39  private:
40 #ifdef IMPOSE_PINNING
41  int flag_pinning_error = 0;
42 
43  hwloc_cpuset_t cpuset, cpuset_after_MPI_init;
44  hwloc_topology_t topology;
45  int topodepth;
46  int sockets;
47  int cores;
48  int pus;
49  int hyperthreads_per_core;
50 
51 #endif
52  public:
53  void get_core_set(void);
54  void detect_topology(void);
55  void pin_to_core_set(setcomm *sc);
56  void report_pinning(setcomm *sc);
57 };
58 
59 #endif
void report_pinning(setcomm *sc)
Definition: pinning.cc:170
void get_core_set(void)
Definition: pinning.cc:25
void detect_topology(void)
Definition: pinning.cc:33
void pin_to_core_set(setcomm *sc)
Definition: pinning.cc:69