MulticoreBSP for C  Version 1.2
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 
61 
69  SCATTER = 0,
70 
76 
83 };
84 
89 
97 
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( void );
254 
261 
267 size_t mcbsp_get_available_cores( void );
268 
275 size_t mcbsp_get_threads_per_core( void );
276 
283 
293 size_t * mcbsp_get_pinning( void );
294 
299 size_t mcbsp_get_reserved_cores_number( void );
300 
308 size_t * mcbsp_get_reserved_cores( void );
309 
310 //Default values
311 
316 
320 extern size_t MCBSP_DEFAULT_THREADS_PER_CORE;
321 
326 
327 #endif
328