BeBOP: pOSKI  v1.0.0
parallel Optimized Sparse Kernel Interface library
 All Files Functions Variables
Functions
poski_ThreadHandler.c File Reference

Handle threading model routines. More...

#include <stdio.h>
#include <stdlib.h>
#include <poski/poski_threadcommon.h>
#include <poski/poski_matrix.h>
#include <poski/poski_malloc.h>
#include <poski/poski_print.h>
#include <poski/poski_system.h>

Functions

poski_threadarg_t * poski_InitThreads ()
 Create and initialize a thread object.
int poski_DestroyThreads (poski_threadarg_t *threadargs)
 Destory a thread object.
int poski_ThreadHints (poski_threadarg_t *threadargs, poski_mat_t A_tunable, poski_threadtype_t ttype, poski_int_t nthreads)
 Modify the threading model by user's threading hint.
int poski_report_threadmodel (poski_threadarg_t *threadargs, poski_mat_t A)
 Report information of a thread object.

Detailed Description

Handle threading model routines.

This module implements the routines to handle the threading model.

Attention:
Currently, only support Pthread, Pthreadpool, and OpenMP.

Also, refer poski_Thread_common.c


Function Documentation

poski_threadarg_t* poski_InitThreads ( )

Create and initialize a thread object.

This routine sets the threading model, number of threads, and map schedule for threads.

Returns:
A thread object if success, or an error message otherwise.
int poski_DestroyThreads ( poski_threadarg_t *  threadargs)

Destory a thread object.

Parameters:
[in]threadargsA thread object.
Returns:
1 if success, or an error message otherwise.
int poski_ThreadHints ( poski_threadarg_t *  threadargs,
poski_mat_t  A_tunable,
poski_threadtype_t  ttype,
poski_int_t  nthreads 
)

Modify the threading model by user's threading hint.

Parameters:
[in,out]threadargsA thread object.
[in,out]A_tunableA tunable matrix object.
[in]ttypeThe threading model type in {POSKI_PTHREAD, POSKI_THREADPOOL, POSKI_OPENMP}.
[in]nthreadsNumber of threads.
Returns:
0 if success, or an error message otherwise.
int poski_report_threadmodel ( poski_threadarg_t *  threadargs,
poski_mat_t  A 
)

Report information of a thread object.

Parameters:
[in]threadargsThread object.
[in]ATunable matrix object.
Returns:
0 if success, or an error message otherwise.