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
102 struct starpu_conf
103{
109 int magic;
110
115 int will_use_mpi;
116
122 const char *sched_policy_name;
123
129 struct starpu_sched_policy *sched_policy;
130 void (*sched_policy_init)(unsigned);
131
141 int precedence_over_environment_variables;
142
148 int ncpus;
149
155 int reserve_ncpus;
156
163 int ncuda;
164
171 int nopencl;
172
178 int nmic;
179
186 int nmpi_ms;
187
196 unsigned use_explicit_workers_bindid;
197
207 unsigned workers_bindid[STARPU_NMAXWORKERS];
208
218 unsigned use_explicit_workers_cuda_gpuid;
219
225 unsigned workers_cuda_gpuid[STARPU_NMAXWORKERS];
226
236 unsigned use_explicit_workers_opencl_gpuid;
237
243 unsigned workers_opencl_gpuid[STARPU_NMAXWORKERS];
244
254 unsigned use_explicit_workers_mic_deviceid;
255
261 unsigned workers_mic_deviceid[STARPU_NMAXWORKERS];
262
271 unsigned use_explicit_workers_mpi_ms_deviceid;
272
279 unsigned workers_mpi_ms_deviceid[STARPU_NMAXWORKERS];
280
288 int bus_calibrate;
289
300 int calibrate;
301
315 int single_combined_worker;
316
323 char *mic_sink_program_path;
324
339 int disable_asynchronous_copy;
340
352 int disable_asynchronous_cuda_copy;
353
369 int disable_asynchronous_opencl_copy;
370
382 int disable_asynchronous_mic_copy;
383
395 int disable_asynchronous_mpi_ms_copy;
396
405 unsigned *cuda_opengl_interoperability;
406
410 unsigned n_cuda_opengl_interoperability;
411
417 struct starpu_driver *not_launched_drivers;
418
425 unsigned n_not_launched_drivers;
426
434 uint64_t trace_buffer_size;
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
455 int catch_signals;
456
460 unsigned driver_spinning_backoff_min;
461
465 unsigned driver_spinning_backoff_max;
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
502 int starpu_is_initialized(void);
503
507 void starpu_wait_initialized(void);
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
572 int starpu_asynchronous_copy_disabled(void);
573
578 int starpu_asynchronous_cuda_copy_disabled(void);
579
584 int starpu_asynchronous_opencl_copy_disabled(void);
585
590 int starpu_asynchronous_mic_copy_disabled(void);
591
596 int starpu_asynchronous_mpi_ms_copy_disabled(void);
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__ */
starpu_conf::use_explicit_workers_mic_deviceid
unsigned use_explicit_workers_mic_deviceid
Definition: starpu.h:254
starpu_conf::magic
int magic
Definition: starpu.h:109
starpu_conf::driver_spinning_backoff_max
unsigned driver_spinning_backoff_max
Definition: starpu.h:465
starpu_conf::single_combined_worker
int single_combined_worker
Definition: starpu.h:315
starpu_conf::workers_bindid
unsigned workers_bindid[STARPU_NMAXWORKERS]
Definition: starpu.h:207
starpu_conf::disable_asynchronous_mic_copy
int disable_asynchronous_mic_copy
Definition: starpu.h:382
starpu_conf::use_explicit_workers_cuda_gpuid
unsigned use_explicit_workers_cuda_gpuid
Definition: starpu.h:218
starpu_conf::disable_asynchronous_cuda_copy
int disable_asynchronous_cuda_copy
Definition: starpu.h:352
starpu_conf::disable_asynchronous_copy
int disable_asynchronous_copy
Definition: starpu.h:339
starpu_conf::trace_buffer_size
uint64_t trace_buffer_size
Definition: starpu.h:434
starpu_conf::use_explicit_workers_opencl_gpuid
unsigned use_explicit_workers_opencl_gpuid
Definition: starpu.h:236
starpu_conf::use_explicit_workers_mpi_ms_deviceid
unsigned use_explicit_workers_mpi_ms_deviceid
Definition: starpu.h:271
starpu_conf::n_cuda_opengl_interoperability
unsigned n_cuda_opengl_interoperability
Definition: starpu.h:410
starpu_conf::sched_policy_name
const char * sched_policy_name
Definition: starpu.h:122
starpu_conf::workers_mic_deviceid
unsigned workers_mic_deviceid[STARPU_NMAXWORKERS]
Definition: starpu.h:261
starpu_conf::nmic
int nmic
Definition: starpu.h:178
starpu_conf::driver_spinning_backoff_min
unsigned driver_spinning_backoff_min
Definition: starpu.h:460
starpu_conf::disable_asynchronous_mpi_ms_copy
int disable_asynchronous_mpi_ms_copy
Definition: starpu.h:395
starpu_conf::mic_sink_program_path
char * mic_sink_program_path
Definition: starpu.h:323
starpu_conf::will_use_mpi
int will_use_mpi
Definition: starpu.h:115
starpu_conf::workers_opencl_gpuid
unsigned workers_opencl_gpuid[STARPU_NMAXWORKERS]
Definition: starpu.h:243
starpu_conf::ncpus
int ncpus
Definition: starpu.h:148
starpu_conf::precedence_over_environment_variables
int precedence_over_environment_variables
Definition: starpu.h:141
starpu_conf::bus_calibrate
int bus_calibrate
Definition: starpu.h:288
starpu_conf::reserve_ncpus
int reserve_ncpus
Definition: starpu.h:155
starpu_conf::nopencl
int nopencl
Definition: starpu.h:171
starpu_conf::calibrate
int calibrate
Definition: starpu.h:300
starpu_conf::workers_mpi_ms_deviceid
unsigned workers_mpi_ms_deviceid[STARPU_NMAXWORKERS]
Definition: starpu.h:279
starpu_conf::sched_policy
struct starpu_sched_policy * sched_policy
Definition: starpu.h:129
starpu_conf::cuda_opengl_interoperability
unsigned * cuda_opengl_interoperability
Definition: starpu.h:405
starpu_conf::catch_signals
int catch_signals
Definition: starpu.h:455
starpu_conf::n_not_launched_drivers
unsigned n_not_launched_drivers
Definition: starpu.h:425
starpu_conf::nmpi_ms
int nmpi_ms
Definition: starpu.h:186
starpu_conf::workers_cuda_gpuid
unsigned workers_cuda_gpuid[STARPU_NMAXWORKERS]
Definition: starpu.h:225
starpu_conf::ncuda
int ncuda
Definition: starpu.h:163
starpu_conf::disable_asynchronous_opencl_copy
int disable_asynchronous_opencl_copy
Definition: starpu.h:369
starpu_conf::not_launched_drivers
struct starpu_driver * not_launched_drivers
Definition: starpu.h:417
starpu_conf::use_explicit_workers_bindid
unsigned use_explicit_workers_bindid
Definition: starpu.h:196
starpu_topology_print
void starpu_topology_print(FILE *f)
starpu_asynchronous_copy_disabled
int starpu_asynchronous_copy_disabled(void)
starpu_shutdown
void starpu_shutdown(void)
starpu_is_initialized
int starpu_is_initialized(void)
starpu_get_next_bindid
unsigned starpu_get_next_bindid(unsigned flags, unsigned *preferred, unsigned npreferred)
starpu_conf_init
int starpu_conf_init(struct starpu_conf *conf)
starpu_pause
void starpu_pause(void)
starpu_asynchronous_opencl_copy_disabled
int starpu_asynchronous_opencl_copy_disabled(void)
starpu_asynchronous_cuda_copy_disabled
int starpu_asynchronous_cuda_copy_disabled(void)
starpu_init
int starpu_init(struct starpu_conf *conf) STARPU_WARN_UNUSED_RESULT
starpu_initialize
int starpu_initialize(struct starpu_conf *user_conf, int *argc, char ***argv)
starpu_asynchronous_mic_copy_disabled
int starpu_asynchronous_mic_copy_disabled(void)
starpu_resume
void starpu_resume(void)
starpu_asynchronous_mpi_ms_copy_disabled
int starpu_asynchronous_mpi_ms_copy_disabled(void)
starpu_wait_initialized
void starpu_wait_initialized(void)
starpu_bind_thread_on
int starpu_bind_thread_on(int cpuid, unsigned flags, const char *name)
starpu_conf
Definition: starpu.h:103
starpu_driver
Definition: starpu_driver.h:39
starpu_sched_policy
Definition: starpu_scheduler.h:83
starpu_get_version
void starpu_get_version(int *major, int *minor, int *release)
STARPU_NMAXWORKERS
#define STARPU_NMAXWORKERS
Definition: starpu_config.h:236
starpu_bitmap.h
starpu_bound.h
starpu_clusters.h
starpu_config.h
starpu_cublas.h
starpu_cuda.h
starpu_cusparse.h
starpu_data.h
starpu_data_filters.h
starpu_data_interfaces.h
starpu_deprecated_api.h
starpu_disk.h
starpu_driver.h
starpu_expert.h
starpu_fxt.h
starpu_hash.h
starpu_helper.h
starpu_opencl.h
starpu_openmp.h
starpu_perfmodel.h
starpu_profiling.h
starpu_rand.h
starpu_sched_ctx.h
starpu_scheduler.h
starpu_simgrid_wrap.h
starpu_stdlib.h
starpu_task.h
starpu_task_bundle.h
starpu_task_dep.h
starpu_task_list.h
starpu_task_util.h
starpu_thread.h
starpu_thread_util.h
starpu_tree.h
starpu_util.h
starpu_worker.h