StarPU Internal Handbook

starpurm_private.h
Go to the documentation of this file.
1/* StarPU --- Runtime system for heterogeneous multicore architectures.
2 *
3 * Copyright (C) 2017-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 __STARPURM_PRIVATE_H
18#define __STARPURM_PRIVATE_H
19
22 enum e_state
23{
24 state_uninitialized = 0,
25 state_init
26};
27
28 enum e_starpurm_unit_type
29{
30 starpurm_unit_cpu = 0,
31 starpurm_unit_opencl = 1,
32 starpurm_unit_cuda = 2,
33 starpurm_unit_mic = 3,
34 starpurm_unit_ntypes = 4
35};
36
37 struct s_starpurm
38{
40 hwloc_topology_t topology;
41
43 unsigned max_ncpus;
44
46 unsigned selected_ncpus;
47
49 unsigned selected_nworkers;
50
52 int state;
53
59 int dynamic_resource_sharing;
60
62 unsigned sched_ctx_id;
63
65 int unit_ntypes;
66
68 int *nunits_by_type;
69
71 int nunits;
72
74 int *unit_offsets_by_type;
75
77 struct s_starpurm_unit *units;
78
80 hwloc_cpuset_t global_cpuset;
81
83 hwloc_cpuset_t all_cpu_workers_cpuset;
84
86 hwloc_cpuset_t all_opencl_device_workers_cpuset;
87
89 hwloc_cpuset_t all_cuda_device_workers_cpuset;
90
92 hwloc_cpuset_t all_mic_device_workers_cpuset;
93
95 hwloc_cpuset_t all_device_workers_cpuset;
96
98 hwloc_cpuset_t selected_cpuset;
99
101 hwloc_cpuset_t initially_owned_cpuset_mask;
102
104 int max_worker_id;
105
107 int *worker_unit_ids;
108
110 unsigned int max_temporary_ctxs;
111 unsigned int avail_temporary_ctxs;
112 pthread_mutex_t temporary_ctxs_mutex;
113 pthread_cond_t temporary_ctxs_cond;
114
116 int starpu_in_pause;
117
119 pthread_t event_thread;
120 pthread_mutex_t event_list_mutex;
121 pthread_cond_t event_list_cond;
122 pthread_cond_t event_processing_cond;
123 int event_processing_enabled;
124 int event_processing_ended;
125 struct s_starpurm_event *event_list_head;
126 struct s_starpurm_event *event_list_tail;
127};
128
129
130#ifdef STARPURM_HAVE_DLB
131 void starpurm_dlb_init(struct s_starpurm *rm);
132 void starpurm_dlb_exit(void);
133 int starpurm_dlb_notify_starpu_worker_mask_going_to_sleep(const hwloc_cpuset_t hwloc_workers_cpuset);
134 int starpurm_dlb_notify_starpu_worker_mask_waking_up(const hwloc_cpuset_t hwloc_workers_cpuset);
135#ifdef STARPURM_STARPU_HAVE_WORKER_CALLBACKS
136 void starpurm_enqueue_event_cpu_unit_available(int cpuid);
137#endif
138#endif
139
140#endif /* __STARPURM_PRIVATE_H */
s_starpurm::all_device_workers_cpuset
hwloc_cpuset_t all_device_workers_cpuset
Definition: starpurm_private.h:95
s_starpurm::units
struct s_starpurm_unit * units
Definition: starpurm_private.h:77
s_starpurm::max_worker_id
int max_worker_id
Definition: starpurm_private.h:104
s_starpurm::all_cuda_device_workers_cpuset
hwloc_cpuset_t all_cuda_device_workers_cpuset
Definition: starpurm_private.h:89
s_starpurm::topology
hwloc_topology_t topology
Definition: starpurm_private.h:40
s_starpurm::selected_nworkers
unsigned selected_nworkers
Definition: starpurm_private.h:49
s_starpurm::global_cpuset
hwloc_cpuset_t global_cpuset
Definition: starpurm_private.h:80
s_starpurm::dynamic_resource_sharing
int dynamic_resource_sharing
Definition: starpurm_private.h:59
s_starpurm::initially_owned_cpuset_mask
hwloc_cpuset_t initially_owned_cpuset_mask
Definition: starpurm_private.h:101
s_starpurm::nunits_by_type
int * nunits_by_type
Definition: starpurm_private.h:68
s_starpurm::state
int state
Definition: starpurm_private.h:52
s_starpurm::worker_unit_ids
int * worker_unit_ids
Definition: starpurm_private.h:107
s_starpurm::unit_ntypes
int unit_ntypes
Definition: starpurm_private.h:65
s_starpurm::all_cpu_workers_cpuset
hwloc_cpuset_t all_cpu_workers_cpuset
Definition: starpurm_private.h:83
s_starpurm::starpu_in_pause
int starpu_in_pause
Definition: starpurm_private.h:116
s_starpurm::selected_cpuset
hwloc_cpuset_t selected_cpuset
Definition: starpurm_private.h:98
s_starpurm::max_ncpus
unsigned max_ncpus
Definition: starpurm_private.h:43
s_starpurm::nunits
int nunits
Definition: starpurm_private.h:71
s_starpurm::event_thread
pthread_t event_thread
Definition: starpurm_private.h:119
s_starpurm::all_opencl_device_workers_cpuset
hwloc_cpuset_t all_opencl_device_workers_cpuset
Definition: starpurm_private.h:86
s_starpurm::unit_offsets_by_type
int * unit_offsets_by_type
Definition: starpurm_private.h:74
s_starpurm::max_temporary_ctxs
unsigned int max_temporary_ctxs
Definition: starpurm_private.h:110
s_starpurm::all_mic_device_workers_cpuset
hwloc_cpuset_t all_mic_device_workers_cpuset
Definition: starpurm_private.h:92
s_starpurm::sched_ctx_id
unsigned sched_ctx_id
Definition: starpurm_private.h:62
s_starpurm::selected_ncpus
unsigned selected_ncpus
Definition: starpurm_private.h:46
s_starpurm
Definition: starpurm_private.h:38