StarPU Handbook
starpu.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2  *
3  * Copyright (C) 2011-2017 Inria
4  * Copyright (C) 2009-2014,2016-2019 Université de Bordeaux
5  * Copyright (C) 2010-2015,2017,2019 CNRS
6  *
7  * StarPU is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License as published by
9  * the Free Software Foundation; either version 2.1 of the License, or (at
10  * your option) any later version.
11  *
12  * StarPU is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *
16  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
17  */
18 
19 #ifndef __STARPU_H__
20 #define __STARPU_H__
21 
22 #include <stdlib.h>
23 
24 #ifndef _MSC_VER
25 #include <stdint.h>
26 #else
27 #include <windows.h>
28 typedef unsigned char uint8_t;
29 typedef unsigned short uint16_t;
30 typedef unsigned int uint32_t;
31 typedef unsigned long long uint64_t;
32 typedef UINT_PTR uintptr_t;
33 typedef char int8_t;
34 typedef short int16_t;
35 typedef int int32_t;
36 typedef long long int64_t;
37 typedef INT_PTR intptr_t;
38 #endif
39 
40 #include <starpu_config.h>
41 
42 #ifdef STARPU_HAVE_WINDOWS
43 #include <windows.h>
44 #endif
45 
46 #if defined(STARPU_USE_OPENCL) && !defined(__CUDACC__)
47 #include <starpu_opencl.h>
48 #endif
49 
50 #include <starpu_thread.h>
51 #include <starpu_thread_util.h>
52 #include <starpu_util.h>
53 #include <starpu_data.h>
54 #include <starpu_helper.h>
55 #include <starpu_disk.h>
56 #include <starpu_data_interfaces.h>
57 #include <starpu_data_filters.h>
58 #include <starpu_stdlib.h>
59 #include <starpu_task_bundle.h>
60 #include <starpu_task_dep.h>
61 #include <starpu_task.h>
62 #include <starpu_worker.h>
63 #include <starpu_perfmodel.h>
64 #include <starpu_worker.h>
65 #ifndef BUILDING_STARPU
66 #include <starpu_task_list.h>
67 #endif
68 #include <starpu_task_util.h>
69 #include <starpu_scheduler.h>
70 #include <starpu_sched_ctx.h>
71 #include <starpu_expert.h>
72 #include <starpu_rand.h>
73 #include <starpu_cuda.h>
74 #include <starpu_cublas.h>
75 #include <starpu_cusparse.h>
76 #include <starpu_bound.h>
77 #include <starpu_hash.h>
78 #include <starpu_profiling.h>
79 #include <starpu_fxt.h>
80 #include <starpu_driver.h>
81 #include <starpu_tree.h>
82 #include <starpu_openmp.h>
83 #include <starpu_simgrid_wrap.h>
84 #include <starpu_bitmap.h>
85 #include <starpu_clusters.h>
86 
87 #ifdef __cplusplus
88 extern "C"
89 {
90 #endif
91 
105 {
111  int magic;
112 
118  const char *sched_policy_name;
119 
126  void (*sched_policy_init)(unsigned);
127 
133  int ncpus;
134 
141 
148  int ncuda;
149 
156  int nopencl;
157 
163  int nmic;
164 
171  int nmpi_ms;
172 
192 
209 
226 
243 
260 
280 
295 
303 
371 
385 
399 
408  int global_sched_ctx_min_priority;
409  int global_sched_ctx_max_priority;
410 
411 #ifdef STARPU_WORKER_CALLBACKS
412  void (*callback_worker_going_to_sleep)(unsigned workerid);
413  void (*callback_worker_waking_up)(unsigned workerid);
414 #endif
415 
427 };
428 
439 int starpu_conf_init(struct starpu_conf *conf);
440 
450 int starpu_init(struct starpu_conf *conf) STARPU_WARN_UNUSED_RESULT;
451 
458 int starpu_initialize(struct starpu_conf *user_conf, int *argc, char ***argv);
459 
463 int starpu_is_initialized(void);
464 
468 void starpu_wait_initialized(void);
469 
476 void starpu_shutdown(void);
477 
485 void starpu_pause(void);
490 void starpu_resume(void);
491 
498 #define STARPU_THREAD_ACTIVE (1 << 0)
499 
508 unsigned starpu_get_next_bindid(unsigned flags, unsigned *preferred, unsigned npreferred);
509 
521 int starpu_bind_thread_on(int cpuid, unsigned flags, const char *name);
522 
526 void starpu_topology_print(FILE *f);
527 
533 
539 
545 
551 
557 
558 void starpu_display_stats(void);
559 
560 void starpu_get_version(int *major, int *minor, int *release);
561 
564 #ifdef __cplusplus
565 }
566 #endif
567 
568 #include "starpu_deprecated_api.h"
569 
570 #endif /* __STARPU_H__ */
int disable_asynchronous_cuda_copy
Definition: starpu.h:330
void starpu_pause(void)
unsigned workers_mic_deviceid[STARPU_NMAXWORKERS]
Definition: starpu.h:242
int ncpus
Definition: starpu.h:133
int bus_calibrate
Definition: starpu.h:268
int starpu_asynchronous_opencl_copy_disabled(void)
int reserve_ncpus
Definition: starpu.h:140
int starpu_bind_thread_on(int cpuid, unsigned flags, const char *name)
struct starpu_sched_policy * sched_policy
Definition: starpu.h:125
int nmic
Definition: starpu.h:163
int disable_asynchronous_opencl_copy
Definition: starpu.h:346
int nmpi_ms
Definition: starpu.h:171
struct starpu_driver * not_launched_drivers
Definition: starpu.h:391
int starpu_asynchronous_mic_copy_disabled(void)
unsigned trace_buffer_size
Definition: starpu.h:407
void starpu_resume(void)
int calibrate
Definition: starpu.h:279
Definition: starpu.h:104
unsigned workers_opencl_gpuid[STARPU_NMAXWORKERS]
Definition: starpu.h:225
int starpu_conf_init(struct starpu_conf *conf)
int disable_asynchronous_mpi_ms_copy
Definition: starpu.h:370
int magic
Definition: starpu.h:111
void starpu_shutdown(void)
unsigned use_explicit_workers_bindid
Definition: starpu.h:181
void starpu_get_version(int *major, int *minor, int *release)
int starpu_init(struct starpu_conf *conf) STARPU_WARN_UNUSED_RESULT
unsigned n_not_launched_drivers
Definition: starpu.h:398
void starpu_wait_initialized(void)
unsigned * cuda_opengl_interoperability
Definition: starpu.h:380
void starpu_topology_print(FILE *f)
const char * sched_policy_name
Definition: starpu.h:118
unsigned workers_cuda_gpuid[STARPU_NMAXWORKERS]
Definition: starpu.h:208
int starpu_asynchronous_cuda_copy_disabled(void)
int nopencl
Definition: starpu.h:156
unsigned use_explicit_workers_mpi_ms_deviceid
Definition: starpu.h:252
unsigned use_explicit_workers_mic_deviceid
Definition: starpu.h:236
#define STARPU_NMAXWORKERS
Definition: starpu_config.h:110
int starpu_initialize(struct starpu_conf *user_conf, int *argc, char ***argv)
int disable_asynchronous_copy
Definition: starpu.h:318
unsigned use_explicit_workers_cuda_gpuid
Definition: starpu.h:202
unsigned n_cuda_opengl_interoperability
Definition: starpu.h:384
Definition: starpu_scheduler.h:84
char * mic_sink_program_path
Definition: starpu.h:302
int starpu_is_initialized(void)
int single_combined_worker
Definition: starpu.h:294
int disable_asynchronous_mic_copy
Definition: starpu.h:358
unsigned use_explicit_workers_opencl_gpuid
Definition: starpu.h:219
int ncuda
Definition: starpu.h:148
unsigned workers_mpi_ms_deviceid[STARPU_NMAXWORKERS]
Definition: starpu.h:259
Definition: starpu_driver.h:39
int catch_signals
Definition: starpu.h:426
int starpu_asynchronous_copy_disabled(void)
unsigned starpu_get_next_bindid(unsigned flags, unsigned *preferred, unsigned npreferred)
unsigned workers_bindid[STARPU_NMAXWORKERS]
Definition: starpu.h:191
int starpu_asynchronous_mpi_ms_copy_disabled(void)