MulticoreBSP for C
Version 1.1
Main Page
Namespaces
Data Structures
Files
File List
Globals
mcbsp-affinity.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2013 by Albert-Jan N. Yzelman
3
*
4
* This file is part of MulticoreBSP in C --
5
* a port of the original Java-based MulticoreBSP.
6
*
7
* MulticoreBSP for C is distributed as part of the original
8
* MulticoreBSP and is free software: you can redistribute
9
* it and/or modify it under the terms of the GNU Lesser
10
* General Public License as published by the Free Software
11
* Foundation, either version 3 of the License, or
12
* (at your option) any later version.
13
* MulticoreBSP is distributed in the hope that it will be
14
* useful, but WITHOUT ANY WARRANTY; without even the
15
* implied warranty of MERCHANTABILITY or FITNESS FOR A
16
* PARTICULAR PURPOSE. See the GNU Lesser General Public
17
* License for more details.
18
*
19
* You should have received a copy of the GNU Lesser General
20
* Public License along with MulticoreBSP. If not, see
21
* <http://www.gnu.org/licenses/>.
22
*/
23
54
#ifndef _H_MCBSP_AFFINITY
55
#define _H_MCBSP_AFFINITY
56
60
enum
mcbsp_affinity_mode
{
61
69
SCATTER
= 0,
70
75
COMPACT
,
76
82
MANUAL
83
};
84
88
enum
mcbsp_thread_numbering
{
89
96
CONSECUTIVE
= 0,
97
104
WRAPPED
105
};
106
116
void
mcbsp_set_maximum_threads
(
const
size_t
max );
117
136
void
mcbsp_set_affinity_mode
(
const
enum
mcbsp_affinity_mode
mode );
137
155
void
mcbsp_set_available_cores
(
const
size_t
num_cores );
156
177
void
mcbsp_set_threads_per_core
(
const
size_t
threads_per_core );
178
197
void
mcbsp_set_thread_numbering
(
const
enum
mcbsp_thread_numbering
numbering );
198
221
void
mcbsp_set_pinning
(
const
size_t
*
const
pinning,
const
size_t
length );
222
246
void
mcbsp_set_reserved_cores
(
const
size_t
*
const
reserved,
const
size_t
length );
247
253
size_t
mcbsp_get_maximum_threads
();
254
260
enum
mcbsp_affinity_mode
mcbsp_get_affinity_mode
();
261
267
size_t
mcbsp_get_available_cores
();
268
275
size_t
mcbsp_get_threads_per_core
();
276
282
enum
mcbsp_thread_numbering
mcbsp_get_thread_numbering
();
283
293
size_t
*
mcbsp_get_pinning
();
294
299
size_t
mcbsp_get_reserved_cores_number
();
300
308
size_t
*
mcbsp_get_reserved_cores
();
309
310
//Default values
311
315
extern
enum
mcbsp_affinity_mode
MCBSP_DEFAULT_AFFINITY
;
316
320
extern
size_t
MCBSP_DEFAULT_THREADS_PER_CORE
;
321
325
extern
enum
mcbsp_thread_numbering
MCBSP_DEFAULT_THREAD_NUMBERING
;
326
327
#endif
328
Generated by
1.8.1.1