StarPU Internal Handbook

topology.h
Go to the documentation of this file.
1/* StarPU --- Runtime system for heterogeneous multicore architectures.
2 *
3 * Copyright (C) 2009-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
4 *
5 * StarPU is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation; either version 2.1 of the License, or (at
8 * your option) any later version.
9 *
10 * StarPU is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 *
14 * See the GNU Lesser General Public License in COPYING.LGPL for more details.
15 */
16
17#ifndef __TOPOLOGY_H__
18#define __TOPOLOGY_H__
19
22#include <starpu.h>
23#include <common/config.h>
24#include <common/list.h>
25#include <common/fxt.h>
26
27 struct _starpu_machine_config;
28
29#ifndef STARPU_SIMGRID
30#ifdef STARPU_HAVE_HWLOC
32 struct _starpu_hwloc_userdata
33{
35 struct _starpu_worker_list *worker_list;
37 unsigned ngpus;
39 struct _starpu_worker *pu_worker;
40};
41#endif
42#endif
43
45 int _starpu_build_topology(struct _starpu_machine_config *config, int no_mp_config);
46
48 void _starpu_destroy_machine_config(struct _starpu_machine_config *config);
49
51 void _starpu_destroy_topology(struct _starpu_machine_config *config);
52
54 unsigned _starpu_topology_get_nhwcpu(struct _starpu_machine_config *config);
55
57 unsigned _starpu_topology_get_nhwpu(struct _starpu_machine_config *config);
58
60 unsigned _starpu_topology_get_nnumanodes(struct _starpu_machine_config *config);
61
63 unsigned _starpu_get_nhyperthreads();
64
65#ifdef STARPU_HAVE_HWLOC
67 void _starpu_topology_filter(hwloc_topology_t topology);
68#endif
69
70#define STARPU_NOWORKERID -1
71#define STARPU_ACTIVETHREAD -2
72#define STARPU_NONACTIVETHREAD -2
76 int _starpu_bind_thread_on_cpu(int cpuid, int workerid, const char *name);
77
78 struct _starpu_combined_worker;
80 void _starpu_bind_thread_on_cpus(struct _starpu_combined_worker *combined_worker);
81
82 struct _starpu_worker *_starpu_get_worker_from_driver(struct starpu_driver *d);
83
84 int starpu_memory_nodes_get_numa_count(void);
85 int starpu_memory_nodes_numa_id_to_hwloclogid(unsigned id);
86
88 int _starpu_task_data_get_node_on_node(struct starpu_task *task, unsigned index, unsigned target_node);
89 int _starpu_task_data_get_node_on_worker(struct starpu_task *task, unsigned index, unsigned worker);
90
91#endif // __TOPOLOGY_H__
fxt.h
list.h
_starpu_combined_worker
Definition: workers.h:203
_starpu_machine_config
Definition: workers.h:352
_starpu_worker
Definition: workers.h:70
_starpu_worker::workerid
int workerid
Definition: workers.h:80
_starpu_build_topology
int _starpu_build_topology(struct _starpu_machine_config *config, int no_mp_config)
_starpu_get_nhyperthreads
unsigned _starpu_get_nhyperthreads()
_starpu_destroy_topology
void _starpu_destroy_topology(struct _starpu_machine_config *config)
_starpu_task_data_get_node_on_node
int _starpu_task_data_get_node_on_node(struct starpu_task *task, unsigned index, unsigned target_node)
_starpu_bind_thread_on_cpu
int _starpu_bind_thread_on_cpu(int cpuid, int workerid, const char *name)
_starpu_topology_get_nnumanodes
unsigned _starpu_topology_get_nnumanodes(struct _starpu_machine_config *config)
_starpu_topology_filter
void _starpu_topology_filter(hwloc_topology_t topology)
_starpu_topology_get_nhwpu
unsigned _starpu_topology_get_nhwpu(struct _starpu_machine_config *config)
_starpu_destroy_machine_config
void _starpu_destroy_machine_config(struct _starpu_machine_config *config)
_starpu_bind_thread_on_cpus
void _starpu_bind_thread_on_cpus(struct _starpu_combined_worker *combined_worker)
_starpu_topology_get_nhwcpu
unsigned _starpu_topology_get_nhwcpu(struct _starpu_machine_config *config)