1 #ifndef CPUBINDING_H_
2 #define CPUBINDING_H_
3 
4 #include "params.h"     // param_list
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
10 void cpubinding_decl_usage(param_list_ptr);
11 void cpubinding_lookup_parameters(param_list_ptr pl);
12 
13 /* This returns an opaque pointer to data which will be used to perform
14  * the actual cpu binding. This function must be called in
15  * single-threaded context.
16  *
17  * This returns NULL if cpubinding failed.
18  *
19  * If messages is not NULL, it is set to point to a newly allocated
20  * string indicating all messages from the cpubinding engine. This is
21  * meant to collect messages for various nodes in an MPI context, and
22  * print only the unique ones (see parallelizing_info.c)
23  */
24 void * cpubinding_get_info(char ** messages, param_list_ptr pl, int thread_split[2]);
25 
26 /* perform the actual pinning. This must be called for each thread */
27 void cpubinding_do_pinning(void * pinning_info, int i, int j);
28 
29 /* free the opaque pointer */
30 void cpubinding_free_info(void * pinning_info, int thread_split[2]);
31 
32 #ifdef __cplusplus
33 }
34 #endif
35 
36 #endif	/* CPUBINDING_H_ */
37