StarPU Handbook - StarPU Introduction
starpu.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2  *
3  * Copyright (C) 2009-2023 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
4  * Copyright (C) 2021 Federal University of Rio Grande do Sul (UFRGS)
5  *
6  * StarPU is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or (at
9  * your option) any later version.
10  *
11  * StarPU is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  *
15  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
16  */
17 
18 #ifndef __STARPU_H__
19 #define __STARPU_H__
20 
21 #include <stdlib.h>
22 
23 #ifndef _MSC_VER
24 #include <stdint.h>
25 #else
26 #include <windows.h>
27 typedef unsigned char uint8_t;
28 typedef unsigned short uint16_t;
29 typedef unsigned int uint32_t;
30 typedef unsigned long long uint64_t;
31 typedef UINT_PTR uintptr_t;
32 typedef char int8_t;
33 typedef short int16_t;
34 typedef int int32_t;
35 typedef long long int64_t;
36 typedef INT_PTR intptr_t;
37 #endif
38 
39 #include <starpu_config.h>
40 
41 #ifdef STARPU_HAVE_WINDOWS
42 #include <windows.h>
43 #endif
44 
45 #if defined(STARPU_USE_OPENCL) && !defined(__CUDACC__)
46 #include <starpu_opencl.h>
47 #endif
48 
49 #include <starpu_thread.h>
50 #include <starpu_thread_util.h>
51 #include <starpu_util.h>
52 #include <starpu_data.h>
53 #include <starpu_helper.h>
54 #include <starpu_disk.h>
55 #include <starpu_data_interfaces.h>
56 #include <starpu_data_filters.h>
57 #include <starpu_stdlib.h>
58 #include <starpu_task_bundle.h>
59 #include <starpu_task_dep.h>
60 #include <starpu_task.h>
61 #include <starpu_worker.h>
62 #include <starpu_perfmodel.h>
63 #include <starpu_worker.h>
64 #ifndef BUILDING_STARPU
65 #include <starpu_task_list.h>
66 #endif
67 #include <starpu_task_util.h>
68 #include <starpu_scheduler.h>
69 #include <starpu_sched_ctx.h>
70 #include <starpu_expert.h>
71 #include <starpu_rand.h>
72 #include <starpu_cuda.h>
73 #include <starpu_hip.h>
74 #include <starpu_hipblas.h>
75 #include <starpu_cublas.h>
76 #include <starpu_cusparse.h>
77 #include <starpu_bound.h>
78 #include <starpu_hash.h>
79 #include <starpu_profiling.h>
80 #include <starpu_profiling_tool.h>
81 #include <starpu_fxt.h>
82 #include <starpu_driver.h>
83 #include <starpu_tree.h>
84 #include <starpu_openmp.h>
85 #include <starpu_simgrid_wrap.h>
86 #include <starpu_bitmap.h>
87 #include <starpu_parallel_worker.h>
88 #include <starpu_perf_monitoring.h>
89 #include <starpu_perf_steering.h>
90 #include <starpu_max_fpga.h>
91 
92 #ifdef __cplusplus
93 extern "C" {
94 #endif
95 
110 {
116  int magic;
117 
123 
129  const char *sched_policy_name;
130 
137 
143  void (*sched_policy_callback)(unsigned);
144 
155 
161  int ncpus;
162 
169 
176  int ncuda;
177 
184  int nhip;
185 
192  int nopencl;
193 
201 
208  int nmpi_ms;
209 
217 
227 
238 
249 
256 
267 
274 
285 
292 
303 
310 
311 #ifdef STARPU_USE_MAX_FPGA
323 #else
324  void *max_fpga_load;
325 #endif
326 
336 
344 
353 
365 
377 
392 
408 
421 
434 
451 
464 
477 
490 
497 
507 
512 
519 
527 
536 
544 
552 
553 #ifdef STARPU_WORKER_CALLBACKS
554  void (*callback_worker_going_to_sleep)(unsigned workerid);
555  void (*callback_worker_waking_up)(unsigned workerid);
556 #endif
557 
569 
575 
580 
585 
597 };
598 
609 int starpu_conf_init(struct starpu_conf *conf);
610 
625 
635 int starpu_init(struct starpu_conf *conf) STARPU_WARN_UNUSED_RESULT;
636 
644 int starpu_initialize(struct starpu_conf *user_conf, int *argc, char ***argv);
645 
650 
655 
662 void starpu_shutdown(void);
663 
671 void starpu_pause(void);
672 
678 void starpu_resume(void);
679 
685 
692 #define STARPU_THREAD_ACTIVE (1 << 0)
693 
703 unsigned starpu_get_next_bindid(unsigned flags, unsigned *preferred, unsigned npreferred);
704 
718 int starpu_bind_thread_on(int cpuid, unsigned flags, const char *name);
719 
724 void starpu_topology_print(FILE *f);
725 
732 
739 
746 
753 
760 
767 
774 
780 
787 
794 
807 void starpu_get_version(int *major, int *minor, int *release);
808 
811 #ifdef __cplusplus
812 }
813 #endif
814 
815 #include "starpu_deprecated_api.h"
816 
817 #endif /* __STARPU_H__ */
int magic
Definition: starpu.h:116
unsigned driver_spinning_backoff_max
Definition: starpu.h:584
void(* sched_policy_callback)(unsigned)
Definition: starpu.h:143
int disable_asynchronous_tcpip_ms_copy
Definition: starpu.h:476
int single_combined_worker
Definition: starpu.h:391
unsigned workers_bindid[STARPU_NMAXWORKERS]
Definition: starpu.h:237
unsigned use_explicit_workers_cuda_gpuid
Definition: starpu.h:248
int disable_asynchronous_cuda_copy
Definition: starpu.h:420
int disable_asynchronous_copy
Definition: starpu.h:407
uint64_t trace_buffer_size
Definition: starpu.h:535
unsigned start_perf_counter_collection
Definition: starpu.h:574
unsigned use_explicit_workers_opencl_gpuid
Definition: starpu.h:284
unsigned use_explicit_workers_mpi_ms_deviceid
Definition: starpu.h:335
struct starpu_max_load * max_fpga_load
Definition: starpu.h:322
unsigned n_cuda_opengl_interoperability
Definition: starpu.h:511
unsigned workers_max_fpga_deviceid[STARPU_NMAXWORKERS]
Definition: starpu.h:309
unsigned workers_hip_gpuid[STARPU_NMAXWORKERS]
Definition: starpu.h:273
const char * sched_policy_name
Definition: starpu.h:129
unsigned driver_spinning_backoff_min
Definition: starpu.h:579
int disable_asynchronous_mpi_ms_copy
Definition: starpu.h:463
int disable_asynchronous_hip_copy
Definition: starpu.h:433
int will_use_mpi
Definition: starpu.h:122
int global_sched_ctx_min_priority
Definition: starpu.h:543
int nmax_fpga
Definition: starpu.h:200
unsigned workers_opencl_gpuid[STARPU_NMAXWORKERS]
Definition: starpu.h:291
int ncpus
Definition: starpu.h:161
int precedence_over_environment_variables
Definition: starpu.h:154
int bus_calibrate
Definition: starpu.h:352
unsigned use_explicit_workers_max_fpga_deviceid
Definition: starpu.h:302
int cuda_only_fast_alloc_other_memnodes
Definition: starpu.h:596
int reserve_ncpus
Definition: starpu.h:168
int enable_map
Definition: starpu.h:496
int nopencl
Definition: starpu.h:192
int calibrate
Definition: starpu.h:364
int data_locality_enforce
Definition: starpu.h:376
unsigned workers_mpi_ms_deviceid[STARPU_NMAXWORKERS]
Definition: starpu.h:343
struct starpu_sched_policy * sched_policy
Definition: starpu.h:136
int ntcpip_ms
Definition: starpu.h:216
int disable_asynchronous_max_fpga_copy
Definition: starpu.h:489
int nhip
Definition: starpu.h:184
unsigned * cuda_opengl_interoperability
Definition: starpu.h:506
int catch_signals
Definition: starpu.h:568
unsigned n_not_launched_drivers
Definition: starpu.h:526
int global_sched_ctx_max_priority
Definition: starpu.h:551
int nmpi_ms
Definition: starpu.h:208
unsigned use_explicit_workers_hip_gpuid
Definition: starpu.h:266
unsigned workers_cuda_gpuid[STARPU_NMAXWORKERS]
Definition: starpu.h:255
int ncuda
Definition: starpu.h:176
int disable_asynchronous_opencl_copy
Definition: starpu.h:450
struct starpu_driver * not_launched_drivers
Definition: starpu.h:518
unsigned use_explicit_workers_bindid
Definition: starpu.h:226
int starpu_asynchronous_copy_disabled_for(enum starpu_node_kind kind)
void starpu_topology_print(FILE *f)
int starpu_asynchronous_copy_disabled(void)
int starpu_map_enabled(void)
void starpu_shutdown(void)
int starpu_init(struct starpu_conf *conf)
int starpu_asynchronous_max_fpga_copy_disabled(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)
int starpu_asynchronous_hip_copy_disabled(void)
void starpu_pause(void)
int starpu_asynchronous_opencl_copy_disabled(void)
int starpu_asynchronous_cuda_copy_disabled(void)
int starpu_asynchronous_tcpip_ms_copy_disabled(void)
int starpu_initialize(struct starpu_conf *user_conf, int *argc, char ***argv)
int starpu_is_paused(void)
void starpu_resume(void)
int starpu_conf_noworker(struct starpu_conf *conf)
int starpu_asynchronous_mpi_ms_copy_disabled(void)
void starpu_wait_initialized(void)
void starpu_display_stats(void)
int starpu_bind_thread_on(int cpuid, unsigned flags, const char *name)
Definition: starpu.h:110
Definition: starpu_max_fpga.h:38
Definition: starpu_driver.h:49
Definition: starpu_scheduler.h:82
void starpu_get_version(int *major, int *minor, int *release)
starpu_node_kind
Definition: starpu_worker.h:44
#define STARPU_NMAXWORKERS
Definition: starpu_config.h:284