46 #ifndef ThreadPoolInterface_h
47 #define ThreadPoolInterface_h
49 #if defined( __cplusplus )
57 double TPI_Walltime();
62 #define TPI_LOCK_BUSY ((int) 1 )
63 #define TPI_ERROR_NULL ((int) -1 )
64 #define TPI_ERROR_SIZE ((int) -2 )
65 #define TPI_ERROR_LOCK ((int) -3 )
66 #define TPI_ERROR_ACTIVE ((int) -4 )
67 #define TPI_ERROR_INTERNAL ((int) -5 )
71 struct TPI_ThreadPool_Private ;
73 typedef struct TPI_ThreadPool_Private * TPI_ThreadPool ;
80 typedef void (*TPI_parallel_subprogram)(
void * shared_data ,
81 TPI_ThreadPool pool );
93 int TPI_Run( TPI_parallel_subprogram ,
106 int TPI_Rank( TPI_ThreadPool ,
int * ,
int * );
111 int TPI_Set_lock_size(
int );
116 int TPI_Lock( TPI_ThreadPool ,
int );
121 int TPI_Trylock( TPI_ThreadPool ,
int );
126 int TPI_Unlock( TPI_ThreadPool ,
int );
137 int TPI_Size(
int * );
148 int TPI_Concurrency();
156 int TPI_Partition(
int ,
164 #if defined( __cplusplus )