StarPU Handbook
starpu.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 __STARPU_H__
18 #define __STARPU_H__
19 
20 #include <stdlib.h>
21 
22 #ifndef _MSC_VER
23 #include <stdint.h>
24 #else
25 #include <windows.h>
26 typedef unsigned char uint8_t;
27 typedef unsigned short uint16_t;
28 typedef unsigned int uint32_t;
29 typedef unsigned long long uint64_t;
30 typedef UINT_PTR uintptr_t;
31 typedef char int8_t;
32 typedef short int16_t;
33 typedef int int32_t;
34 typedef long long int64_t;
35 typedef INT_PTR intptr_t;
36 #endif
37 
38 #include <starpu_config.h>
39 
40 #ifdef STARPU_HAVE_WINDOWS
41 #include <windows.h>
42 #endif
43 
44 #if defined(STARPU_USE_OPENCL) && !defined(__CUDACC__)
45 #include <starpu_opencl.h>
46 #endif
47 
48 #include <starpu_thread.h>
49 #include <starpu_thread_util.h>
50 #include <starpu_util.h>
51 #include <starpu_data.h>
52 #include <starpu_helper.h>
53 #include <starpu_disk.h>
54 #include <starpu_data_interfaces.h>
55 #include <starpu_data_filters.h>
56 #include <starpu_stdlib.h>
57 #include <starpu_task_bundle.h>
58 #include <starpu_task_dep.h>
59 #include <starpu_task.h>
60 #include <starpu_worker.h>
61 #include <starpu_perfmodel.h>
62 #include <starpu_worker.h>
63 #ifndef BUILDING_STARPU
64 #include <starpu_task_list.h>
65 #endif
66 #include <starpu_task_util.h>
67 #include <starpu_scheduler.h>
68 #include <starpu_sched_ctx.h>
69 #include <starpu_expert.h>
70 #include <starpu_rand.h>
71 #include <starpu_cuda.h>
72 #include <starpu_cublas.h>
73 #include <starpu_cusparse.h>
74 #include <starpu_bound.h>
75 #include <starpu_hash.h>
76 #include <starpu_profiling.h>
77 #include <starpu_fxt.h>
78 #include <starpu_driver.h>
79 #include <starpu_tree.h>
80 #include <starpu_openmp.h>
81 #include <starpu_simgrid_wrap.h>
82 #include <starpu_bitmap.h>
83 #include <starpu_clusters.h>
84 
85 #ifdef __cplusplus
86 extern "C"
87 {
88 #endif
89 
103 {
109  int magic;
110 
116 
122  const char *sched_policy_name;
123 
130  void (*sched_policy_init)(unsigned);
131 
142 
148  int ncpus;
149 
156 
163  int ncuda;
164 
171  int nopencl;
172 
178  int nmic;
179 
186  int nmpi_ms;
187 
197 
208 
219 
226 
237 
244 
255 
262 
272 
280 
289 
301 
316 
324 
340 
353 
370 
383 
396 
406 
411 
418 
426 
435 
436  int global_sched_ctx_min_priority;
437 
438  int global_sched_ctx_max_priority;
439 
440 #ifdef STARPU_WORKER_CALLBACKS
441  void (*callback_worker_going_to_sleep)(unsigned workerid);
442  void (*callback_worker_waking_up)(unsigned workerid);
443 #endif
444 
456 
461 
466 };
467 
478 int starpu_conf_init(struct starpu_conf *conf);
479 
489 int starpu_init(struct starpu_conf *conf) STARPU_WARN_UNUSED_RESULT;
490 
497 int starpu_initialize(struct starpu_conf *user_conf, int *argc, char ***argv);
498 
503 
508 
515 void starpu_shutdown(void);
516 
524 void starpu_pause(void);
530 void starpu_resume(void);
531 
538 #define STARPU_THREAD_ACTIVE (1 << 0)
539 
548 unsigned starpu_get_next_bindid(unsigned flags, unsigned *preferred, unsigned npreferred);
549 
561 int starpu_bind_thread_on(int cpuid, unsigned flags, const char *name);
562 
566 void starpu_topology_print(FILE *f);
567 
573 
579 
585 
591 
597 
598 void starpu_display_stats(void);
599 
600 void starpu_get_version(int *major, int *minor, int *release);
601 
604 #ifdef __cplusplus
605 }
606 #endif
607 
608 #include "starpu_deprecated_api.h"
609 
610 #endif /* __STARPU_H__ */
unsigned use_explicit_workers_mic_deviceid
Definition: starpu.h:254
int magic
Definition: starpu.h:109
unsigned driver_spinning_backoff_max
Definition: starpu.h:465
int single_combined_worker
Definition: starpu.h:315
unsigned workers_bindid[STARPU_NMAXWORKERS]
Definition: starpu.h:207
int disable_asynchronous_mic_copy
Definition: starpu.h:382
unsigned use_explicit_workers_cuda_gpuid
Definition: starpu.h:218
int disable_asynchronous_cuda_copy
Definition: starpu.h:352
int disable_asynchronous_copy
Definition: starpu.h:339
uint64_t trace_buffer_size
Definition: starpu.h:434
unsigned use_explicit_workers_opencl_gpuid
Definition: starpu.h:236
unsigned use_explicit_workers_mpi_ms_deviceid
Definition: starpu.h:271
unsigned n_cuda_opengl_interoperability
Definition: starpu.h:410
const char * sched_policy_name
Definition: starpu.h:122
unsigned workers_mic_deviceid[STARPU_NMAXWORKERS]
Definition: starpu.h:261
int nmic
Definition: starpu.h:178
unsigned driver_spinning_backoff_min
Definition: starpu.h:460
int disable_asynchronous_mpi_ms_copy
Definition: starpu.h:395
char * mic_sink_program_path
Definition: starpu.h:323
int will_use_mpi
Definition: starpu.h:115
unsigned workers_opencl_gpuid[STARPU_NMAXWORKERS]
Definition: starpu.h:243
int ncpus
Definition: starpu.h:148
int precedence_over_environment_variables
Definition: starpu.h:141
int bus_calibrate
Definition: starpu.h:288
int reserve_ncpus
Definition: starpu.h:155
int nopencl
Definition: starpu.h:171
int calibrate
Definition: starpu.h:300
unsigned workers_mpi_ms_deviceid[STARPU_NMAXWORKERS]
Definition: starpu.h:279
struct starpu_sched_policy * sched_policy
Definition: starpu.h:129
unsigned * cuda_opengl_interoperability
Definition: starpu.h:405
int catch_signals
Definition: starpu.h:455
unsigned n_not_launched_drivers
Definition: starpu.h:425
int nmpi_ms
Definition: starpu.h:186
unsigned workers_cuda_gpuid[STARPU_NMAXWORKERS]
Definition: starpu.h:225
int ncuda
Definition: starpu.h:163
int disable_asynchronous_opencl_copy
Definition: starpu.h:369
struct starpu_driver * not_launched_drivers
Definition: starpu.h:417
unsigned use_explicit_workers_bindid
Definition: starpu.h:196
void starpu_topology_print(FILE *f)
int starpu_asynchronous_copy_disabled(void)
void starpu_shutdown(void)
int starpu_is_initialized(void)
unsigned starpu_get_next_bindid(unsigned flags, unsigned *preferred, unsigned npreferred)
int starpu_conf_init(struct starpu_conf *conf)
void starpu_pause(void)
int starpu_asynchronous_opencl_copy_disabled(void)
int starpu_asynchronous_cuda_copy_disabled(void)
int starpu_init(struct starpu_conf *conf) STARPU_WARN_UNUSED_RESULT
int starpu_initialize(struct starpu_conf *user_conf, int *argc, char ***argv)
int starpu_asynchronous_mic_copy_disabled(void)
void starpu_resume(void)
int starpu_asynchronous_mpi_ms_copy_disabled(void)
void starpu_wait_initialized(void)
int starpu_bind_thread_on(int cpuid, unsigned flags, const char *name)
Definition: starpu.h:103
Definition: starpu_driver.h:39
Definition: starpu_scheduler.h:83
void starpu_get_version(int *major, int *minor, int *release)
#define STARPU_NMAXWORKERS
Definition: starpu_config.h:236