Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

WKFThreads.C File Reference

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "WKFThreads.h"

Go to the source code of this file.

Typedefs

typedef void *(* WKFTHREAD_START_ROUTINE )(void *)

Functions

int wkf_thread_numphysprocessors (void)
int wkf_thread_numprocessors (void)
int * wkf_cpu_affinitylist (int *cpuaffinitycount)
int wkf_thread_set_self_cpuaffinity (int cpu)
int wkf_thread_setconcurrency (int nthr)
int wkf_thread_create (wkf_thread_t *thr, void *fctn(void *), void *arg)
int wkf_thread_join (wkf_thread_t thr, void **stat)
int wkf_mutex_init (wkf_mutex_t *mp)
int wkf_mutex_lock (wkf_mutex_t *mp)
int wkf_mutex_trylock (wkf_mutex_t *mp)
int wkf_mutex_spin_lock (wkf_mutex_t *mp)
int wkf_mutex_unlock (wkf_mutex_t *mp)
int wkf_mutex_destroy (wkf_mutex_t *mp)
int wkf_cond_init (wkf_cond_t *cvp)
int wkf_cond_destroy (wkf_cond_t *cvp)
int wkf_cond_wait (wkf_cond_t *cvp, wkf_mutex_t *mp)
int wkf_cond_signal (wkf_cond_t *cvp)
int wkf_cond_broadcast (wkf_cond_t *cvp)
int wkf_thread_run_barrier_init (wkf_run_barrier_t *barrier, int n_clients)
void wkf_thread_run_barrier_destroy (wkf_run_barrier_t *barrier)
void *(*)(void *) wkf_thread_run_barrier (wkf_run_barrier_t *barrier, void *fctn(void *), void *parms, void **rsltparms)
int wkf_thread_run_barrier_poll (wkf_run_barrier_t *barrier)
wkf_threadpool_twkf_threadpool_create (int workercount, int *devlist)
int wkf_threadpool_launch (wkf_threadpool_t *thrpool, void *fctn(void *), void *parms, int blocking)
int wkf_threadpool_wait (wkf_threadpool_t *thrpool)
int wkf_threadpool_poll (wkf_threadpool_t *thrpool)
int wkf_threadpool_destroy (wkf_threadpool_t *thrpool)
int wkf_threadpool_worker_getid (void *voiddata, int *threadid, int *threadcount)
int wkf_threadpool_worker_getdevid (void *voiddata, int *devid)
int wkf_threadpool_worker_setdevspeed (void *voiddata, float speed)
int wkf_threadpool_worker_getdevspeed (void *voiddata, float *speed)
int wkf_threadpool_worker_devscaletile (void *voiddata, int *tilesize)
int wkf_threadpool_worker_getdata (void *voiddata, void **clientdata)
int wkf_threadpool_sched_dynamic (wkf_threadpool_t *thrpool, wkf_tasktile_t *tile)
int wkf_threadpool_next_tile (void *voidparms, int reqsize, wkf_tasktile_t *tile)
int wkf_threadpool_tile_failed (void *voidparms, wkf_tasktile_t *tile)
int wkf_threadpool_setfatalerror (void *voidparms)
int wkf_threadpool_getfatalerror (void *voidparms)
int wkf_tilestack_init (wkf_tilestack_t *s, int size)
void wkf_tilestack_destroy (wkf_tilestack_t *s)
int wkf_tilestack_compact (wkf_tilestack_t *s)
int wkf_tilestack_push (wkf_tilestack_t *s, const wkf_tasktile_t *t)
int wkf_tilestack_pop (wkf_tilestack_t *s, wkf_tasktile_t *t)
int wkf_tilestack_popall (wkf_tilestack_t *s)
int wkf_tilestack_empty (wkf_tilestack_t *s)
int wkf_shared_iterator_init (wkf_shared_iterator_t *it)
int wkf_shared_iterator_destroy (wkf_shared_iterator_t *it)
int wkf_shared_iterator_set (wkf_shared_iterator_t *it, wkf_tasktile_t *tile)
int wkf_shared_iterator_next_tile (wkf_shared_iterator_t *it, int reqsize, wkf_tasktile_t *tile)
int wkf_shared_iterator_setfatalerror (wkf_shared_iterator_t *it)
int wkf_shared_iterator_getfatalerror (wkf_shared_iterator_t *it)
int wkf_threadlaunch (int numprocs, void *clientdata, void *fctn(void *), wkf_tasktile_t *tile)
int wkf_threadlaunch_getid (void *voidparms, int *threadid, int *threadcount)
int wkf_threadlaunch_getdata (void *voidparms, void **clientdata)
int wkf_threadlaunch_next_tile (void *voidparms, int reqsize, wkf_tasktile_t *tile)
int wkf_threadlaunch_setfatalerror (void *voidparms)


Typedef Documentation

typedef void*(* WKFTHREAD_START_ROUTINE)(void *)
 

Definition at line 302 of file WKFThreads.C.

Referenced by wkf_thread_create.


Function Documentation

int wkf_cond_broadcast wkf_cond_t   cvp
 

Definition at line 607 of file WKFThreads.C.

References wkf_cond_t.

int wkf_cond_destroy wkf_cond_t   cvp
 

Definition at line 506 of file WKFThreads.C.

References wkf_cond_t.

int wkf_cond_init wkf_cond_t   cvp
 

Definition at line 473 of file WKFThreads.C.

References NULL, and wkf_cond_t.

int wkf_cond_signal wkf_cond_t   cvp
 

Definition at line 578 of file WKFThreads.C.

References wkf_cond_t.

int wkf_cond_wait wkf_cond_t   cvp,
wkf_mutex_t   mp
 

Definition at line 527 of file WKFThreads.C.

References wkf_cond_t, and wkf_mutex_t.

int* wkf_cpu_affinitylist int *    cpuaffinitycount
 

Definition at line 142 of file WKFThreads.C.

References NULL.

int wkf_mutex_destroy wkf_mutex_t   mp
 

Definition at line 452 of file WKFThreads.C.

References wkf_mutex_t.

int wkf_mutex_init wkf_mutex_t   mp
 

Definition at line 367 of file WKFThreads.C.

References wkf_mutex_t.

int wkf_mutex_lock wkf_mutex_t   mp
 

Definition at line 384 of file WKFThreads.C.

References wkf_mutex_t.

int wkf_mutex_spin_lock wkf_mutex_t   mp
 

Definition at line 418 of file WKFThreads.C.

References wkf_mutex_t.

int wkf_mutex_trylock wkf_mutex_t   mp
 

Definition at line 401 of file WKFThreads.C.

References wkf_mutex_t.

int wkf_mutex_unlock wkf_mutex_t   mp
 

Definition at line 435 of file WKFThreads.C.

References wkf_mutex_t.

int wkf_shared_iterator_destroy wkf_shared_iterator_t   it
 

Definition at line 1156 of file WKFThreads.C.

References wkf_shared_iterator_struct::mtx, and wkf_mutex_destroy.

int wkf_shared_iterator_getfatalerror wkf_shared_iterator_t   it
 

Definition at line 1229 of file WKFThreads.C.

References wkf_shared_iterator_struct::fatalerror, wkf_shared_iterator_struct::mtx, wkf_mutex_lock, and wkf_mutex_unlock.

int wkf_shared_iterator_init wkf_shared_iterator_t   it
 

Definition at line 1147 of file WKFThreads.C.

References wkf_shared_iterator_struct::mtx, and wkf_mutex_init.

int wkf_shared_iterator_next_tile wkf_shared_iterator_t   it,
int    reqsize,
wkf_tasktile_t   tile
 

Definition at line 1181 of file WKFThreads.C.

References wkf_shared_iterator_struct::current, wkf_shared_iterator_struct::end, wkf_tasktile_struct::end, wkf_shared_iterator_struct::fatalerror, wkf_shared_iterator_struct::mtx, wkf_tasktile_struct::start, wkf_mutex_spin_lock, wkf_mutex_unlock, WKF_SCHED_CONTINUE, and WKF_SCHED_DONE.

int wkf_shared_iterator_set wkf_shared_iterator_t   it,
wkf_tasktile_t   tile
 

Definition at line 1164 of file WKFThreads.C.

References wkf_shared_iterator_struct::current, wkf_tasktile_struct::end, wkf_shared_iterator_struct::end, wkf_shared_iterator_struct::fatalerror, wkf_shared_iterator_struct::mtx, wkf_tasktile_struct::start, wkf_shared_iterator_struct::start, wkf_mutex_lock, and wkf_mutex_unlock.

int wkf_shared_iterator_setfatalerror wkf_shared_iterator_t   it
 

Definition at line 1217 of file WKFThreads.C.

References wkf_shared_iterator_struct::fatalerror, wkf_shared_iterator_struct::mtx, wkf_mutex_spin_lock, and wkf_mutex_unlock.

int wkf_thread_create wkf_thread_t   thr,
void *fctn(void *)   ,
void *    arg
 

Definition at line 310 of file WKFThreads.C.

References NULL, wkf_thread_t, and WKFTHREAD_START_ROUTINE.

int wkf_thread_join wkf_thread_t    thr,
void **    stat
 

Definition at line 341 of file WKFThreads.C.

References wkf_thread_t.

int wkf_thread_numphysprocessors void   
 

Definition at line 81 of file WKFThreads.C.

Referenced by wkf_thread_numprocessors.

int wkf_thread_numprocessors void   
 

Definition at line 115 of file WKFThreads.C.

References NULL, and wkf_thread_numphysprocessors.

Referenced by evaluate_grid_fast, find_within, measure_gofr, vmd_bondsearch_thr, vmd_cuda_vol_cpotential, vmdinfo_tcl, VMDinitialize, and vol_cpotential_cpu.

void*(*)(void *) wkf_thread_run_barrier  
 

Definition at line 669 of file WKFThreads.C.

References wkf_run_barrier_struct::fctn, wkf_run_barrier_struct::lock, wkf_run_barrier_struct::n_clients, wkf_run_barrier_struct::n_waiting, NULL, wkf_run_barrier_struct::parms, wkf_run_barrier_struct::phase, wkf_run_barrier_struct::rslt, wkf_run_barrier_struct::rsltparms, wkf_run_barrier_struct::wait_cv, wkf_cond_broadcast, wkf_cond_wait, wkf_mutex_lock, and wkf_mutex_unlock.

Referenced by wkf_threadpool_destroy, wkf_threadpool_launch, and wkf_threadpool_wait.

void wkf_thread_run_barrier_destroy wkf_run_barrier_t   barrier
 

Definition at line 658 of file WKFThreads.C.

References wkf_run_barrier_struct::lock, wkf_run_barrier_struct::wait_cv, wkf_cond_destroy, and wkf_mutex_destroy.

int wkf_thread_run_barrier_init wkf_run_barrier_t   barrier,
int    n_clients
 

Definition at line 642 of file WKFThreads.C.

References wkf_run_barrier_struct::fctn, wkf_run_barrier_struct::lock, wkf_run_barrier_struct::n_clients, wkf_run_barrier_struct::n_waiting, NULL, wkf_run_barrier_struct::phase, wkf_run_barrier_struct::wait_cv, wkf_cond_init, and wkf_mutex_init.

int wkf_thread_run_barrier_poll wkf_run_barrier_t   barrier
 

Definition at line 714 of file WKFThreads.C.

References wkf_run_barrier_struct::lock, wkf_run_barrier_struct::n_clients, wkf_run_barrier_struct::n_waiting, wkf_mutex_lock, and wkf_mutex_unlock.

int wkf_thread_set_self_cpuaffinity int    cpu
 

Definition at line 231 of file WKFThreads.C.

int wkf_thread_setconcurrency int    nthr
 

Definition at line 276 of file WKFThreads.C.

int wkf_threadlaunch int    numprocs,
void *    clientdata,
void *fctn(void *)   ,
wkf_tasktile_t   tile
 

Definition at line 1245 of file WKFThreads.C.

References wkf_threadlaunch_struct::clientdata, wkf_threadlaunch_struct::iter, NULL, wkf_threadlaunch_struct::threadcount, wkf_threadlaunch_struct::threadid, wkf_shared_iterator_destroy, wkf_shared_iterator_getfatalerror, wkf_shared_iterator_init, wkf_shared_iterator_set, wkf_thread_create, wkf_thread_join, and wkf_thread_t.

int wkf_threadlaunch_getdata void *    voidparms,
void **    clientdata
 

Definition at line 1335 of file WKFThreads.C.

References wkf_threadlaunch_struct::clientdata, and NULL.

int wkf_threadlaunch_getid void *    voidparms,
int *    threadid,
int *    threadcount
 

Definition at line 1322 of file WKFThreads.C.

References NULL, wkf_threadlaunch_struct::threadcount, and wkf_threadlaunch_struct::threadid.

int wkf_threadlaunch_next_tile void *    voidparms,
int    reqsize,
wkf_tasktile_t   tile
 

Definition at line 1344 of file WKFThreads.C.

References wkf_threadlaunch_struct::iter, and wkf_shared_iterator_next_tile.

int wkf_threadlaunch_setfatalerror void *    voidparms
 

Definition at line 1351 of file WKFThreads.C.

References wkf_threadlaunch_struct::iter, and wkf_shared_iterator_setfatalerror.

wkf_threadpool_t* wkf_threadpool_create int    workercount,
int *    devlist
 

Definition at line 748 of file WKFThreads.C.

References wkf_threadpool_workerdata_struct::devid, wkf_threadpool_struct::devlist, wkf_threadpool_workerdata_struct::devspeed, wkf_threadpool_workerdata_struct::errorstack, wkf_threadpool_struct::errorstack, wkf_threadpool_workerdata_struct::iter, wkf_threadpool_struct::iter, NULL, wkf_threadpool_struct::runbar, wkf_threadpool_workerdata_struct::threadcount, wkf_threadpool_workerdata_struct::threadid, wkf_threadpool_struct::threads, wkf_threadpool_workerdata_struct::thrpool, wkf_shared_iterator_init, wkf_thread_create, wkf_thread_run_barrier_init, wkf_thread_t, wkf_tilestack_init, wkf_threadpool_struct::workercount, and wkf_threadpool_struct::workerdata.

int wkf_threadpool_destroy wkf_threadpool_t   thrpool
 

Definition at line 843 of file WKFThreads.C.

References wkf_threadpool_struct::devlist, wkf_threadpool_struct::errorstack, wkf_threadpool_struct::iter, NULL, wkf_threadpool_struct::runbar, wkf_threadpool_struct::threads, wkf_shared_iterator_destroy, wkf_thread_join, wkf_thread_run_barrier, wkf_thread_run_barrier_destroy, wkf_tilestack_destroy, wkf_threadpool_struct::workercount, and wkf_threadpool_struct::workerdata.

int wkf_threadpool_getfatalerror void *    voidparms
 

Definition at line 989 of file WKFThreads.C.

References wkf_threadpool_workerdata_struct::iter, and wkf_shared_iterator_getfatalerror.

int wkf_threadpool_launch wkf_threadpool_t   thrpool,
void *fctn(void *)   ,
void *    parms,
int    blocking
 

Definition at line 808 of file WKFThreads.C.

References NULL, wkf_threadpool_workerdata_struct::parms, wkf_threadpool_struct::runbar, wkf_thread_run_barrier, and wkf_threadpool_struct::workerdata.

int wkf_threadpool_next_tile void *    voidparms,
int    reqsize,
wkf_tasktile_t   tile
 

Definition at line 956 of file WKFThreads.C.

References wkf_threadpool_workerdata_struct::errorstack, wkf_threadpool_workerdata_struct::iter, WKF_SCHED_CONTINUE, WKF_SCHED_DONE, wkf_shared_iterator_next_tile, WKF_TILESTACK_EMPTY, and wkf_tilestack_pop.

int wkf_threadpool_poll wkf_threadpool_t   thrpool
 

Definition at line 834 of file WKFThreads.C.

References wkf_threadpool_struct::runbar, and wkf_thread_run_barrier_poll.

int wkf_threadpool_sched_dynamic wkf_threadpool_t   thrpool,
wkf_tasktile_t   tile
 

Definition at line 948 of file WKFThreads.C.

References wkf_threadpool_struct::iter, NULL, and wkf_shared_iterator_set.

int wkf_threadpool_setfatalerror void *    voidparms
 

Definition at line 981 of file WKFThreads.C.

References wkf_threadpool_workerdata_struct::iter, and wkf_shared_iterator_setfatalerror.

int wkf_threadpool_tile_failed void *    voidparms,
wkf_tasktile_t   tile
 

Definition at line 974 of file WKFThreads.C.

References wkf_threadpool_workerdata_struct::errorstack, and wkf_tilestack_push.

int wkf_threadpool_wait wkf_threadpool_t   thrpool
 

Definition at line 826 of file WKFThreads.C.

References NULL, wkf_threadpool_struct::runbar, and wkf_thread_run_barrier.

int wkf_threadpool_worker_devscaletile void *    voiddata,
int *    tilesize
 

Definition at line 922 of file WKFThreads.C.

References wkf_threadpool_workerdata_struct::devspeed, and NULL.

int wkf_threadpool_worker_getdata void *    voiddata,
void **    clientdata
 

Definition at line 938 of file WKFThreads.C.

References NULL, and wkf_threadpool_workerdata_struct::parms.

int wkf_threadpool_worker_getdevid void *    voiddata,
int *    devid
 

Definition at line 890 of file WKFThreads.C.

References wkf_threadpool_workerdata_struct::devid, and NULL.

int wkf_threadpool_worker_getdevspeed void *    voiddata,
float *    speed
 

Definition at line 912 of file WKFThreads.C.

References wkf_threadpool_workerdata_struct::devspeed, and NULL.

int wkf_threadpool_worker_getid void *    voiddata,
int *    threadid,
int *    threadcount
 

Definition at line 877 of file WKFThreads.C.

References NULL, wkf_threadpool_workerdata_struct::threadcount, and wkf_threadpool_workerdata_struct::threadid.

int wkf_threadpool_worker_setdevspeed void *    voiddata,
float    speed
 

Definition at line 903 of file WKFThreads.C.

References wkf_threadpool_workerdata_struct::devspeed.

int wkf_tilestack_compact wkf_tilestack_t   s
 

Definition at line 1031 of file WKFThreads.C.

References wkf_tasktile_stack_struct::mtx, NULL, wkf_tasktile_stack_struct::s, wkf_tasktile_stack_struct::size, wkf_tasktile_stack_struct::top, wkf_mutex_lock, and wkf_mutex_unlock.

void wkf_tilestack_destroy wkf_tilestack_t   s
 

Definition at line 1022 of file WKFThreads.C.

References wkf_tasktile_stack_struct::mtx, NULL, wkf_tasktile_stack_struct::s, and wkf_mutex_destroy.

int wkf_tilestack_empty wkf_tilestack_t   s
 

Definition at line 1122 of file WKFThreads.C.

References wkf_tasktile_stack_struct::mtx, wkf_tasktile_stack_struct::top, wkf_mutex_lock, and wkf_mutex_unlock.

int wkf_tilestack_init wkf_tilestack_t   s,
int    size
 

Definition at line 999 of file WKFThreads.C.

References wkf_tasktile_stack_struct::growthrate, wkf_tasktile_stack_struct::mtx, NULL, wkf_tasktile_stack_struct::s, wkf_tasktile_stack_struct::size, wkf_tasktile_stack_struct::top, and wkf_mutex_init.

int wkf_tilestack_pop wkf_tilestack_t   s,
wkf_tasktile_t   t
 

Definition at line 1084 of file WKFThreads.C.

References wkf_tasktile_stack_struct::mtx, wkf_tasktile_stack_struct::s, wkf_tasktile_stack_struct::top, wkf_mutex_lock, wkf_mutex_unlock, and WKF_TILESTACK_EMPTY.

int wkf_tilestack_popall wkf_tilestack_t   s
 

Definition at line 1107 of file WKFThreads.C.

References wkf_tasktile_stack_struct::mtx, wkf_tasktile_stack_struct::top, wkf_mutex_lock, and wkf_mutex_unlock.

int wkf_tilestack_push wkf_tilestack_t   s,
const wkf_tasktile_t   t
 

Definition at line 1055 of file WKFThreads.C.

References wkf_tasktile_stack_struct::growthrate, wkf_tasktile_stack_struct::mtx, NULL, wkf_tasktile_stack_struct::s, wkf_tasktile_stack_struct::size, wkf_tasktile_stack_struct::top, wkf_mutex_lock, and wkf_mutex_unlock.


Generated on Tue Nov 24 01:41:25 2009 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002