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_ntypes = 3
34 };
35 
36 struct s_starpurm
37 {
39  hwloc_topology_t topology;
40 
42  int max_ncpus;
43 
46 
49 
51  int state;
52 
59 
61  unsigned sched_ctx_id;
62 
65 
68 
70  int nunits;
71 
74 
76  struct s_starpurm_unit *units;
77 
79  hwloc_cpuset_t global_cpuset;
80 
82  hwloc_cpuset_t all_cpu_workers_cpuset;
83 
86 
89 
91  hwloc_cpuset_t all_device_workers_cpuset;
92 
94  hwloc_cpuset_t selected_cpuset;
95 
98 
101 
104 
106  unsigned int max_temporary_ctxs;
107  unsigned int avail_temporary_ctxs;
108  starpu_pthread_mutex_t temporary_ctxs_mutex;
109  starpu_pthread_cond_t temporary_ctxs_cond;
110 
113 
115  pthread_t event_thread;
116  starpu_pthread_mutex_t event_list_mutex;
117  starpu_pthread_cond_t event_list_cond;
118  starpu_pthread_cond_t event_processing_cond;
119  int event_processing_enabled;
120  int event_processing_ended;
121  struct s_starpurm_event *event_list_head;
122  struct s_starpurm_event *event_list_tail;
123 };
124 
125 
126 #ifdef STARPURM_HAVE_DLB
127 void starpurm_dlb_init(struct s_starpurm *rm);
128 void starpurm_dlb_exit(void);
129 int starpurm_dlb_notify_starpu_worker_mask_going_to_sleep(const hwloc_cpuset_t hwloc_workers_cpuset);
130 int starpurm_dlb_notify_starpu_worker_mask_waking_up(const hwloc_cpuset_t hwloc_workers_cpuset);
131 #ifdef STARPURM_STARPU_HAVE_WORKER_CALLBACKS
132 void starpurm_enqueue_event_cpu_unit_available(int cpuid);
133 #endif
134 #endif
135 
136 #endif /* __STARPURM_PRIVATE_H */
hwloc_cpuset_t all_device_workers_cpuset
Definition: starpurm_private.h:91
struct s_starpurm_unit * units
Definition: starpurm_private.h:76
int max_worker_id
Definition: starpurm_private.h:100
hwloc_cpuset_t all_cuda_device_workers_cpuset
Definition: starpurm_private.h:88
hwloc_topology_t topology
Definition: starpurm_private.h:39
hwloc_cpuset_t global_cpuset
Definition: starpurm_private.h:79
int dynamic_resource_sharing
Definition: starpurm_private.h:58
hwloc_cpuset_t initially_owned_cpuset_mask
Definition: starpurm_private.h:97
int * nunits_by_type
Definition: starpurm_private.h:67
int state
Definition: starpurm_private.h:51
int selected_ncpus
Definition: starpurm_private.h:45
int * worker_unit_ids
Definition: starpurm_private.h:103
int unit_ntypes
Definition: starpurm_private.h:64
hwloc_cpuset_t all_cpu_workers_cpuset
Definition: starpurm_private.h:82
int starpu_in_pause
Definition: starpurm_private.h:112
int selected_nworkers
Definition: starpurm_private.h:48
int max_ncpus
Definition: starpurm_private.h:42
hwloc_cpuset_t selected_cpuset
Definition: starpurm_private.h:94
int nunits
Definition: starpurm_private.h:70
pthread_t event_thread
Definition: starpurm_private.h:115
hwloc_cpuset_t all_opencl_device_workers_cpuset
Definition: starpurm_private.h:85
int * unit_offsets_by_type
Definition: starpurm_private.h:73
unsigned int max_temporary_ctxs
Definition: starpurm_private.h:106
unsigned sched_ctx_id
Definition: starpurm_private.h:61
Definition: starpurm_private.h:37